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

Serf crashes on fork [was: r1380608 breaks svnsync]

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Sat, 17 Nov 2012 14:01:57 +0100

On Fri, Nov 16, 2012 at 5:24 PM, Stefan Sperling wrote:

> On Fri, Nov 16, 2012 at 03:35:12PM +0100, Stefan Fuhrmann wrote:
> > Hi Stefan,
> >
> > For some reason, this commit causes the forked process
> > executing the pre-revprop-change script to segfault under
> > certain circumstances.
>
> I don't have time to look into this right now, unfortunately :(
> Can you please file an issue with a 1.8.0 milestone? I'll get
> to it later.
>

As it turns out, your commit has only be the trigger but
not the root cause.

serf_trunk/allocator.c, serf_bucket_allocator_create(), line 147:

    /* ### this implies buckets cannot cross a fork/exec. desirable?
     *
     * ### hmm. it probably also means that buckets cannot be AROUND
     * ### during a fork/exec. the new process will try to clean them
     * ### up and figure out there are unfreed blocks...
     */
    apr_pool_cleanup_register(pool, allocator,
                              allocator_cleanup, allocator_cleanup);

Since we fork() for hooks, we can't use hooks in ra_local
while there is an open serf connection. Otherwise, we get
into trouble with pool cleanups:

==7392== Invalid read of size 8
==7392== at 0x5055694: clean_resp (outgoing.c:51)
==7392== by 0x50C65D: cleanup_pool_for_exec (apr_pools.c:2359)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x5142F6: apr_proc_create (proc.c:430)
==7392== by 0x4D24F4: svn_io_start_cmd3 (io.c:2686)
==7392== by 0x42308D: run_hook_cmd (hooks.c:249)
==7392== by 0x423BC2: svn_repos__hooks_pre_revprop_change (hooks.c:565)
==7392== by 0x421A82: svn_repos_fs_change_rev_prop4 (fs-wrap.c:351)
==7392== by 0x41B56D: svn_ra_local__change_rev_prop (ra_plugin.c:674)
==7392== Address 0x72457c8 is 13,448 bytes inside a block of size 106,496
free'd
==7392== at 0x4C2A739: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7392== by 0x50D002: apr_allocator_free (apr_pools.c:425)
==7392== by 0x5057B45: allocator_cleanup (allocator.c:108)
==7392== by 0x50C65D: cleanup_pool_for_exec (apr_pools.c:2359)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x50C677: cleanup_pool_for_exec (apr_pools.c:2369)
==7392== by 0x5142F6: apr_proc_create (proc.c:430)
==7392== by 0x4D24F4: svn_io_start_cmd3 (io.c:2686)
==7392== by 0x42308D: run_hook_cmd (hooks.c:249)
==7392== by 0x423BC2: svn_repos__hooks_pre_revprop_change (hooks.c:565)
==7392== by 0x421A82: svn_repos_fs_change_rev_prop4 (fs-wrap.c:351)

So, no svnsync from http[s]:// to file:// anymore :(
Any further operations where that might bite us?

-- Stefan^2.

-- 
Certified & Supported Apache Subversion Downloads:
*
http://www.wandisco.com/subversion/download
*
Received on 2012-11-17 14:02:36 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.