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

Re: svn import/svn_client_import Segfault

From: se˝ior ┐tyrtle? <machtyrtle_at_gmail.com>
Date: 2005-04-12 16:28:02 CEST

On 4/12/05 2:00 AM, "kfogel@collab.net" <kfogel@collab.net> sneezed:

> se˝ior ┐tyrtle? <machtyrtle@gmail.com> writes:
>> On me travels today, stumbled across a heinous little bug in
>> svn_client_import in libsvn_client/commit.c
>>
>> Durring svn_client_import, 'subpool' is created as a child of 'pool'. If an
>> fs-module is dynamically loaded (from 'get_ra_editor'), it is done with
>> 'subpool'. The actual transaction ('import') ; however, will be done in
>> 'pool'.
>>
>> In the case of BerkelyDB, control will eventually flow to
>> 'svn_fs_base__track_dbt', where 'apr_pool_cleanup_register' will be called
>> to register a free function ('apr_free_cleanup') for the trail.
>>
>> Problem is that the trail has created a subpool as well...but in the parent.
>> When apr_destroy_pool is called on the parent, 'subpool' wil get destroyed
>> first triggering apr_dso_unload on the fs-module...and eventually apr will
>> try to call 'apr_free_cleanup', but it's been unloaded.
>>
>> Attached is a patch that fixes this, calling import with the subpool, and
>> destroying it as well.
>
> Thanks for the patch, but could you provide a reproduction recipe as
> well? I'm not doubting you that there's a bug, and in any case it's
> clear that the subpool needs to be destroyed, but I'm not sure how to
> test this patch since I don't know how to make the bug happen.
>
> -Karl

Basically I just ran 'svn import file.c file:///usr/local/svnrep/...'

The build is a little non-standard (Metrowerks Codewarrior as Mac OS
frameworks)....but 1.1.2 worked flawlessly. No ra* or fs* modules are
linked (i.e. --enable-dso).

The machine has only 386mb memory...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 12 03:12:56 2005

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