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

[PATCH] Re: svnserve via xinetd segfaults

From: Alec Kloss <alec.kloss_at_oracle.com>
Date: 21 Jun 2010 10:02:25 -0500

On 2010-04-18 14:42, Aaron Turner wrote:
> On Sun, Apr 18, 2010 at 11:58 AM, Kevin Grover <kevin_at_kevingrover.net> wrote:
> > On Sat, Apr 17, 2010 at 10:12 PM, Aaron Turner <synfinatic_at_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.Kloss_at_oracle.com			Oracle Middleware
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xEBD1FF14

  • application/pgp-signature attachment: stored
Received on 2010-06-21 17:03:04 CEST

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.