On 2010-04-18 14:42, Aaron Turner wrote:
> On Sun, Apr 18, 2010 at 11:58 AM, Kevin Grover <ke...@kevingrover.net> wrote:
> > On Sat, Apr 17, 2010 at 10:12 PM, Aaron Turner <synfina...@gmail.com> wrote:
> >> Not sure why, but sometimes svnserve segfaults when it runs via
> >> xinetd.  It turns out to be highly repeatable for specific svn
> >> transactions/commands.  Ie:
> >>
> >>  svn merge -c 2454 . ../../branches/3.4/src
> >>
> >> causes the segfault, but another svn command works fine (I had just
> >> done a number of commits).  I've seen it happen with svn update as
> >> well, so it doesn't seem specific to merge.

This is a 100% reproducable event for me when running svnserve in inetd
mode (started from daemontools' tcpserver).  The issue is the SASL
cleanup functions are called out of order, with sasl_done() being called
before server_dispose().  I believe this happens because APR calls pool
cleanup functions in the same order that they were registered in, and
the global cleanup registration for sasl_done() is called prior to 
the cleanup registration for the server (which makes sense).  The
easiest way I found to resolve this is to create a connection pool even
in the inetd case (which is how the other server cases work in
svnserve).  For Subversion 1.6.9:

app1 subversion-1.6.9 # diff -u main.c.orig subversion/svnserve/main.c
--- main.c.orig 2010-06-21 09:33:20.784733858 -0500
+++ subversion/svnserve/main.c  2010-06-21 09:33:31.154731019 -0500
@@ -599,8 +599,9 @@
           return svn_cmdline_handle_exit_error(err, pool, "svnserve:
");
         }
 
-      conn = svn_ra_svn_create_conn(NULL, in_file, out_file, pool);
-      svn_error_clear(serve(conn, &params, pool));
+      connection_pool = svn_pool_create(pool);
+      conn = svn_ra_svn_create_conn(NULL, in_file, out_file,
connection_pool);
+      svn_error_clear(serve(conn, &params, connection_pool));
       exit(0);
     }
 
app1 subversion-1.6.9 # 

Should I create an official bug in Subversion's bug tracker?


-- 
alec.kl...@oracle.com                   Oracle Middleware
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xEBD1FF14

Attachment: pgpXbF1bW1cdH.pgp
Description: PGP signature

Reply via email to