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

[PATCH] Really don't use DSO unless --enable-dso

From: Eric Gillespie <epg_at_google.com>
Date: Tue, 19 Feb 2008 16:28:11 -0800

1. Install svn 1.X (say 1.3) in /usr/lib (say from your distribution)

2. Install svn 1.Y (say trunk) in /opt/svnbeta

3. /opt/svnbeta/bin/svnadmin --version
subversion/libsvn_subr/version.c:73: (apr_err=200019)
svnadmin: Version mismatch in 'svn_delta': found 1.6.0-dev, expected 1.4.4
subversion/libsvn_subr/version.c:73: (apr_err=200019)
svnadmin: Version mismatch in 'svn_subr': found 1.6.0-dev, expected 1.4.4

What happened? I didn't build with bdb, but Ubuntu did. So I
have libsvn_fs_base in /usr/lib. When svnadmin --version tries
to list all backends it knows about, my trunk fs-loader.c calls
apr_dso_load libsvn_fs_base-1.so.0 without an absolute path, so
my linker searched my RPATH, found no fs_base, and then searched
the system search path (naturally including /usr/lib) and found
fs_base. Of course, when it tries to load that fs_base, it
freaks out because its dependent libraries are too new. Hmph.

Now, we actually have at least three problems here:

1. I did not use --enable-dso, so svn should not try to load
   DSOs. I have included a patch to fix this.

2. If svn loads a too-old ra or fs module, it should unload it
   and move on, not blow up. This may be trivial, impossible, or
   somewhere between; I have no idea. This one is obviated by
   the next one, I think.

3. We shouldn't be passing a relative path to apr_dso_load.
   Sure, Linux searches various paths when you do that, but other
   systems do not. This does not work on Mac OS X, for example.
   I started working on a patch to fix that a few years ago, but
   lost interest (Mac sucks :) and moved on. This is how httpd
   uses it, too.

[[[
Don't try to load DSOs unless configured with --enable-dso.

* configure.ac
  Define SVN_USE_DSO for svn_private_config.h if --enable-dso.

* subversion/libsvn_fs/fs-loader.c
  (load_module): Only try DSOs if SVN_USE_DSO is defined.

* subversion/libsvn_ra/ra_loader.c
  (load_ra_module): Only try DSOs if SVN_USE_DSO is defined.
]]]

Index: configure.ac
===================================================================
--- configure.ac (revision 29243)
+++ configure.ac (working copy)
@@ -601,6 +601,8 @@
       if test "$enable_shared" = "no"; then
         AC_MSG_ERROR([--enable-dso conflicts with --disable-shared])
       fi
+ AC_DEFINE(SVN_USE_DSO, 1,
+ [Defined if svn should try to load DSOs])
     fi
 ])
 
Index: subversion/libsvn_fs/fs-loader.c
===================================================================
--- subversion/libsvn_fs/fs-loader.c (revision 29243)
+++ subversion/libsvn_fs/fs-loader.c (working copy)
@@ -80,7 +80,7 @@
 {
   *initfunc = NULL;
 
-#if APR_HAS_DSO
+#if defined(SVN_USE_DSO) && APR_HAS_DSO
   {
     apr_dso_handle_t *dso;
     apr_dso_handle_sym_t symbol;
Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 29243)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -148,7 +148,7 @@
   if (compat_func)
     *compat_func = NULL;
 
-#if APR_HAS_DSO
+#if defined(SVN_USE_DSO) && APR_HAS_DSO
   {
     apr_dso_handle_t *dso;
     apr_dso_handle_sym_t symbol;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-20 01:28:28 CET

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