Re: Recommended apr / openssl etc. library version for svn ?

2017-11-22 Thread Branko Čibej
On 22.11.2017 07:28, Cooke, Mark wrote:
>> -Original Message-
>> From: Branko Čibej [mailto:br...@apache.org]
>> Sent: 21 November 2017 21:01
>>
>> On 21.11.2017 21:43, Eric Johnson wrote:
>>> I don't know if this helps, but I run Subversion on a Gentoo system,
>>> which is constantly upgrading to newer versions of software. Gentoo
>>> does a really good job of only marking stuff stable when it is
>>> actually stable. So if Gentoo doesn't have openssl 1.1 in use, there's
>>> a really good reason.
>>>
>>> This is what is currently "stable" on my Gentoo system running
>>> Subversion (which is a few weeks old - minor updates might be available):
>> Not-so-minor updates are, in fact available. :)
>>
>>> *Apache httpd 2.4.27
>>> *Apache Serf(tm) 1.3.8
>> Should be 1.3.9.
>>
>>> *APR 1.5.2
>> Should be 1.6.3.
>>
>>> *APR-util 1.5.4
>> Should be 1.6.1.
>>
>>> *APR iconv (not installed on my machine)
>> Not needed in Unix-like environments that have libiconv generally available. 
>> Not needed on Windows
>> because we use the native character encoding conversion functions (since ... 
>> I don't recall when, but
>> it's been quite a while).
>>
>>> *Expat 2.2.1
>>> *OpenSSL 1.0.2l
>>> *PCRE 8.41
>> I have _no_ idea how PCRE got on this list. Subversion itself does not use 
>> it, nor, as far as I'm
>> aware, do Serf, APR or APR-Util.
> I imagine that APR-iconv and PCRE are in the MaxSVN list (and mine) due to 
> building apache httpd as well? 

That's possible; HTTPD does use PCRE and possibly APR-iconv (on Windows).

>>> *SQLite 3.19.3
>>> *ZLib 1.2.11
>>>
>>> Specifically, in the case of openssl, I found this bug tracking all
>>> the compatibility problems: https://bugs.gentoo.org/592438 . Seems
>>> like you probably want to stay away from it.
>> Serf trunk can be compiled with 1.1, but I'm not sure how far along the 
>> 1.3.x release branch is.
>> Whilst OpenSSL 1.1 has made some really unfortunate decisions that break API 
>> compatibility with the
>> 1.0.x line, there are also a number of serious bugs fixed in it ...
>>
>> -- Brane
> ...so is svn still waiting on support in other packages?

Subversion does not use OpenSSL directly. It uses Serf, which in turn
uses OpenSSL to support HTTPS.

>   Bottom line is that I should still use the 1.0.2 line for now?

Yes.

-- Brane



Re: Error E140001: Sum of subblock sizes larger than total block content length

2017-11-22 Thread Julian Foad
> *From:* Ronald Taneza [mailto:ronald.tan...@gmail.com]
> *Sent:* dinsdag 21 november 2017 15:44
> *To:* users@subversion.apache.org
> 
> I got the error below while running "svnadmin load -M 0" to load a dump 
> file created by "svnrdump dump".
> 
>    svnadmin: E140001: Sum of subblock sizes larger than total block 
> content length
> 
> This error was reported when "svnadmin load" was loading a big file 
> (around 2 GB) from a revision in the dump file.
[...]
> Checking the dump file produced by svnrdump (svn version 1.8.19), I
> noticed that the Content-length for the 2GB file is a negative value!
[...]
>    SVN-fs-dump-format-version: 3
>    Node-path: TheBigFile
>    Node-kind: file
>    Node-action: add
>    Prop-delta: true
>    Prop-content-length: 59
>    Text-delta: true
>    Text-content-length: 2238208329
>    Text-content-md5: d2f79377abb0db99b37460c8156727fb
>    Content-length: -2056758908

Thank you for finding this!

I can see this bug existed in svnrdump up to 1.8.19. (For 1.9 I refactored this 
to use common code shared with 'svnadmin dump' which does not have this bug.)

In 1.8.19, subversion/svnrdump/svnrdump.c:close_file() contains:

  if (fb->dump_text)
  ...
  SVN_ERR(svn_stream_printf(eb->stream, pool,
SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH
": %lu\n",
(unsigned long)info->size));
  ...
  if (fb->dump_props)
SVN_ERR(svn_stream_printf(eb->stream, pool,
  SVN_REPOS_DUMPFILE_CONTENT_LENGTH
  ": %ld\n\n",
  (unsigned long)info->size +
propstring->len));
  else if (fb->dump_text)
SVN_ERR(svn_stream_printf(eb->stream, pool,
  SVN_REPOS_DUMPFILE_CONTENT_LENGTH
  ": %ld\n\n",
  (unsigned long)info->size));
  ...


info->size is apr_off_t ... probably 64 bits on most systems.
propstring->len is apr_size_t ... probably 64 bits on most systems.

It uses "%lu" for the text content, which thus work OK up to 4 GB, and "%ld" 
for the overall content length which thus only works up to 2 GB.

Earlier in this file, the property content length is printed correctly:

  buf = apr_psprintf(pool, SVN_REPOS_DUMPFILE_CONTENT_LENGTH
 ": %" APR_SIZE_T_FMT "\n", len);

The attached patch should fix it; not yet tested.

- Julian
On the '1.8.x' branch: Fix 2GB limit on content-length header in svnrdump.

On platforms where 'long' is 32 bits, such as at least some versions of
Windows, svnrdump printed bad headers for file-representations more than 2GB
in length, up to version 1.8.19.

Attempting to load such a dump file gave this error: "svnadmin: E140001: Sum
of subblock sizes larger than total block content length".

This code was refactored before version 1.9.0 such that the bug was no
longer present.

Found by: Ronald Taneza 

* subversion/svnrdump/dump_editor.c
  (close_file): Print lengths using APR_SIZE_T_FMT instead of 'long'.
--This line, and those below, will be ignored--

Index: subversion/svnrdump/dump_editor.c
===
--- subversion/svnrdump/dump_editor.c	(revision 1816054)
+++ subversion/svnrdump/dump_editor.c	(working copy)
@@ -1037,14 +1037,14 @@ close_file(void *file_baton,
   ": %s\n",
   fb->base_checksum));
 
   /* Text-content-length: 39 */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
 SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH
-": %lu\n",
-(unsigned long)info->size));
+": %" APR_SIZE_T_FMT "\n",
+info->size));
 
   /* Text-content-md5: 82705804337e04dcd0e586bfa2389a7f */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
 SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5
 ": %s\n",
 text_checksum));
@@ -1052,19 +1052,19 @@ close_file(void *file_baton,
 
   /* Content-length: 1549 */
   /* If both text and props are absent, skip this header */
   if (fb->dump_props)
 SVN_ERR(svn_stream_printf(eb->stream, pool,
   SVN_REPOS_DUMPFILE_CONTENT_LENGTH
-  ": %ld\n\n",
-  (unsigned long)info->size + propstring->len));
+  ": %" APR_SIZE_T_FMT "\n\n",
+  info->size + propstring->len));
   else if (fb->dump_text)
 SVN_ERR(svn_stream_printf(eb->stream, pool,
   SVN_REPOS_DUMPFILE_CONTENT_LENGTH
-  ": %ld\n\n",
-  (unsigned long)info->size));
+  ": %" APR_S