[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: segfault in 1.6.6

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Wed, 18 Nov 2009 19:17:44 +0100

Stefan Sperling wrote:
> On Tue, Nov 17, 2009 at 07:45:31PM +0100, Stefan Küng wrote:
>> Hi,
>>
>> Just got a stacktrace from a TSVN user. The problem (I think) starts here:
>>
>> libsvn_fs_fs\fs_fs.c: line 793
>> err = svn_io_file_seek(*file, APR_END, &offset, 0);
>>
>> the last parameter is 0 here, but svn_io_file_seek() takes as the last
>> parameter an 'apr_pool_t *'. So the pool passed to it is invalid?
>>
>> this then goes further down the stacktrace:
>> libsvn_subr\io.c: line 2822
>> libsvn_subr\io.c: line 2742 (do_io_file_wrapper_cleanup)
>> libsvn_subr\io.c: line 1786 (file_name_get)
>> libsvn_subr\path.c: line 1079 (svn_path_cstring_to_utf8)
>> and then down to the apr lib (apr_pstrdup) where the segfault happens
>> due to the pool being NULL.
>>
>>
>> Shouldn't the line libsvn_fs_fs\fs_fs.c: line 793 read:
>> err = svn_io_file_seek(*file, APR_END, &offset, pool);
>> instead of
>> err = svn_io_file_seek(*file, APR_END, &offset, 0);
>
> Yes, I'd say it should.

Since the repo is now readonly and my ICLA for the apache repo is still
in status 'sent', here's my patch for this.
This should of course get nominated for backport since I discovered this
with 1.6.6.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2419638

[[[
Avoid a segfault when committing.

* subversion/libsvn_fs_fs/fs_fs.c
  (get_writable_proto_rev_body) : pass a valid memory pool instead of 0 to
  svn_io_file_seek().
]]]
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 40515)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -798,7 +798,7 @@
   if (!err)
     {
       apr_off_t offset = 0;
- err = svn_io_file_seek(*file, APR_END, &offset, 0);
+ err = svn_io_file_seek(*file, APR_END, &offset, pool);
     }
 
   if (err)
Received on 2009-11-18 19:17:53 CET

This is an archived mail posted to the Subversion Dev mailing list.