You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arkadiusz Miskiewicz <mi...@pld.ORG.PL> on 2002/07/27 19:17:01 UTC

ra_load and wrong loads

Hi,

I have problem with subversion. I'm using r2749, configured
using options:

%configure \
        --enable-dso \
        --with-neon=%{_prefix} \
        --with-apr=%{_bindir}/apr-config \
        --with-apr-util=%{_bindir}/apu-config \
        --with-apxs=%{_sbindir}/apxs \
        --with-berkeley-db=%{_includedir}/db4:%{_libdir}

neon-devel-0.21.3-1
apache-devel-2.0.39-0.2
apr-devel-2.0.39-0.2
db4-devel-4.0.14-2
gcc-3.1.1-1 (prerelease)

and
[misiek@arm subversion]$ svn up

svn_error: #21091 : <Bad URL passed to RA layer>
  Unrecognized URL scheme: http://svn.collab.net/repos/svn/trunk

Libs are there with ,,-1'' suffix but svn tries to load versions
without that suffix anyway.

Also it tries to load libsvn_ra_dav.so instead of libsvn_ra_dav.so.0.
This (so vs so.0) doesn't matter when you are installing everything
but at PLD we have subversion-libs.rpm with lib*.so.*.*.*
and subversion-devel.rpm with lib*.so only.

In such case current svn won't work. Now the question is - are the 
libsvn_ra_*.so meant to be libraries or modules? For me they are modules
and IMO should be placed in other location than libs - for example in
/usr/lib/subversion/${VERSION}/libsvn_ra_*.so (with or without SONAME
versioning). Most of programs are doing in this way - separating
dynamic modules from libraries.

[misiek@arm subversion]$ strace -e open svn up 2>&1 | grep libsvn
open("/usr/lib/i686/mmx/libsvn_client-1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libsvn_client-1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/libsvn_client-1.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_client-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_wc-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_ra-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_delta-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_subr-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/mmx/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/mmx/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)

[misiek@arm misiek]$ ls -l /usr/lib/libsvn*.so
lrwxr-xr-x    1 root     root           22 lip 27 20:59 /usr/lib/libsvn_auth-1.so -> libsvn_auth-1.so.0.0.0
lrwxr-xr-x    1 root     root           24 lip 27 20:59 /usr/lib/libsvn_client-1.so -> libsvn_client-1.so.0.0.0
lrwxr-xr-x    1 root     root           23 lip 27 20:59 /usr/lib/libsvn_delta-1.so -> libsvn_delta-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_fs-1.so -> libsvn_fs-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_ra-1.so -> libsvn_ra-1.so.0.0.0
lrwxr-xr-x    1 root     root           24 lip 27 20:59 /usr/lib/libsvn_ra_dav-1.so -> libsvn_ra_dav-1.so.0.0.0
lrwxr-xr-x    1 root     root           26 lip 27 20:59 /usr/lib/libsvn_ra_local-1.so -> libsvn_ra_local-1.so.0.0.0
lrwxr-xr-x    1 root     root           23 lip 27 20:59 /usr/lib/libsvn_repos-1.so -> libsvn_repos-1.so.0.0.0
lrwxr-xr-x    1 root     root           22 lip 27 20:59 /usr/lib/libsvn_subr-1.so -> libsvn_subr-1.so.0.0.0
lrwxr-xr-x    1 root     root           25 lip 27 20:59 /usr/lib/libsvn_swig_py-1.so -> libsvn_swig_py-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_wc-1.so -> libsvn_wc-1.so.0.0.0
[misiek@arm misiek]$ ls -l /usr/lib/libsvn*.so.0
lrwxr-xr-x    1 root     root           22 lip 27 20:59 /usr/lib/libsvn_auth-1.so.0 -> libsvn_auth-1.so.0.0.0
lrwxr-xr-x    1 root     root           24 lip 27 20:59 /usr/lib/libsvn_client-1.so.0 -> libsvn_client-1.so.0.0.0
lrwxr-xr-x    1 root     root           23 lip 27 20:59 /usr/lib/libsvn_delta-1.so.0 -> libsvn_delta-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_fs-1.so.0 -> libsvn_fs-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_ra-1.so.0 -> libsvn_ra-1.so.0.0.0
lrwxr-xr-x    1 root     root           24 lip 27 20:59 /usr/lib/libsvn_ra_dav-1.so.0 -> libsvn_ra_dav-1.so.0.0.0
lrwxr-xr-x    1 root     root           26 lip 27 20:59 /usr/lib/libsvn_ra_local-1.so.0 -> libsvn_ra_local-1.so.0.0.0
lrwxr-xr-x    1 root     root           23 lip 27 20:59 /usr/lib/libsvn_repos-1.so.0 -> libsvn_repos-1.so.0.0.0
lrwxr-xr-x    1 root     root           22 lip 27 20:59 /usr/lib/libsvn_subr-1.so.0 -> libsvn_subr-1.so.0.0.0
lrwxr-xr-x    1 root     root           25 lip 27 20:59 /usr/lib/libsvn_swig_py-1.so.0 -> libsvn_swig_py-1.so.0.0.0
lrwxr-xr-x    1 root     root           20 lip 27 20:59 /usr/lib/libsvn_wc-1.so.0 -> libsvn_wc-1.so.0.0.0
[misiek@arm misiek]$ ls -l /usr/lib/libsvn*.so.0.0.0
-rwxr-xr-x    1 root     root         3712 lip 27 20:58 /usr/lib/libsvn_auth-1.so.0.0.0
-rwxr-xr-x    1 root     root        71692 lip 27 20:58 /usr/lib/libsvn_client-1.so.0.0.0
-rwxr-xr-x    1 root     root        49824 lip 27 20:58 /usr/lib/libsvn_delta-1.so.0.0.0
-rwxr-xr-x    1 root     root       113024 lip 27 20:58 /usr/lib/libsvn_fs-1.so.0.0.0
-rwxr-xr-x    1 root     root         5792 lip 27 20:58 /usr/lib/libsvn_ra-1.so.0.0.0
-rwxr-xr-x    1 root     root        57188 lip 27 20:58 /usr/lib/libsvn_ra_dav-1.so.0.0.0
-rwxr-xr-x    1 root     root        19208 lip 27 20:58 /usr/lib/libsvn_ra_local-1.so.0.0.0
-rwxr-xr-x    1 root     root        49828 lip 27 20:58 /usr/lib/libsvn_repos-1.so.0.0.0
-rwxr-xr-x    1 root     root        92460 lip 27 20:58 /usr/lib/libsvn_subr-1.so.0.0.0
-rwxr-xr-x    1 root     root         9756 lip 27 20:58 /usr/lib/libsvn_swig_py-1.so.0.0.0
-rwxr-xr-x    1 root     root       116936 lip 27 20:58 /usr/lib/libsvn_wc-1.so.0.0.0

-- 
Arkadiusz Miśkiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Philip Martin <ph...@codematters.co.uk>.
Arkadiusz Miskiewicz <mi...@pld.ORG.PL> writes:

> Philip Martin <ph...@codematters.co.uk> writes:
> 
> > > No idea why dlopen("libxyz.so", ...) opens libxyz-1.so on compilato system :-\

[snip]

> > These show that the libraries are opened as part of normal shared
> > library opening when the program starts.
> On my systems these are dlopen()ed modules:
> 
> [misiek@arm misiek]$ ldd /usr/bin/svn | grep ra
>         libsvn_ra-1.so.0 => /usr/lib/libsvn_ra-1.so.0 (0x00156000)
> 
> Compile with --enable-dso and you will see the problem.

Tries it... yes, it's broken.

> 
> Someone asked already about moving ,,version'' from build.conf
> to configure + passing it to load_ra_module but there was no reply.

Care to make a patch?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH]: move all dlopen()ed modules to subdirectory

Posted by Arkadiusz Miskiewicz <mi...@pld.ORG.PL>.
This patch does that:

    * Makefile.in: Introduce fs_dso_libdir, base_dso_libdir,
      LD_DSOFLAGS and LINK_DSO for DSO handling. Define
      SVN_LIBDIR=$(libdir) for subversion/libsvn_ra/ra_load.c.

    * build.conf (libsvn_ra_dav, libsvn_ra_local): Change install
      variable to new values (base-lib -> base-dso-lib,
      fs-lib -> fs-dso-lib) as they need to be handled in special
      way when DSO is enabled.

    * configure.in: New DSO INSTALL_ and BUILD_ targets. DSO modules
      are installed in $(libdir)/subversion. Modules are compiled
      with versioning disabled.

    * subversion/libsvn_ra/ra_loader.c: Load DSO from
      $(libdir)/subversion directory.

So when --enable-dso is specified non-versioned (well, versioned
in file name by using version from build.conf) dso modules are
installed in separate directory like this:

[misiek@arm misiek]$ ls -l ~/s-test/lib/subversion/
razem 212
-rw-r--r--    1 misiek   users       77226 sie  2 21:29 libsvn_ra_dav-1.a
-rwxr-xr-x    1 misiek   users        1031 sie  2 21:29 libsvn_ra_dav-1.la
-rwxr-xr-x    1 misiek   users       76646 sie  2 21:29 libsvn_ra_dav-1.so
-rw-r--r--    1 misiek   users       22746 sie  2 21:29 libsvn_ra_local-1.a
-rwxr-xr-x    1 misiek   users        1180 sie  2 21:29 libsvn_ra_local-1.la
-rwxr-xr-x    1 misiek   users       28606 sie  2 21:29 libsvn_ra_local-1.so

Intention for this patch was:
- cleanup (don't mix libraries and dso modules)
- remove versioning from modules (it's not needed and even not desired)
- allow to make dso handling really dynamic (see below)

> > Since the ra_loader code only looks for specific modules anyway,
> > I'm not sure what the rationale is for having them dynamically
> > loaded.  There isn't a way to register your provider with the
> > ra functions without a recompile anyway.
> Load all *.so from $(libdir}/subversion/ ?
And now ra_load.c can be just changed to load all *.so modules
from $(libdir)/subversion. No need to recompile svn to use third
party modules.

No idea how this change affect windows builds.

diff -urN subversion.org/Makefile.in subversion/Makefile.in
--- subversion.org/Makefile.in	Fri Aug  2 14:34:55 2002
+++ subversion/Makefile.in	Fri Aug  2 21:28:16 2002
@@ -22,9 +22,11 @@
 exec_prefix = @exec_prefix@
 libdir = @libdir@
 base_libdir = @libdir@
-fs_libdir= @libdir@
+base_dso_libdir = @SVN_BASE_DSO_LIBDIR@
+fs_libdir = @libdir@
+fs_dso_libdir = @SVN_FS_DSO_LIBDIR@
 bindir = @bindir@
-fs_bindir=@bindir@
+fs_bindir = @bindir@
 includedir = @includedir@
 mandir = @mandir@
 srcdir = @srcdir@
@@ -59,8 +61,9 @@
 
 # the EXTRA_ exist so that extra flags can be passed at 'make' time
 CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS)
-CPPFLAGS = @CPPFLAGS@ $(EXTRA_CPPFLAGS)
+CPPFLAGS = -DSVN_LIBDIR=\"$(libdir)\" @CPPFLAGS@ $(EXTRA_CPPFLAGS)
 LDFLAGS = @LDFLAGS@ $(EXTRA_LDFLAGS)
+LD_DSOFLAGS = @SVN_LD_DSOFLAGS@ $(EXTRA_LD_DSOFLAGS)
 
 COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES)
 LT_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
@@ -71,12 +74,15 @@
 COMPILE_SWIG_PY = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) -DSWIGPYTHON $(CFLAGS) $(SWIG_PY_INCLUDES) $(INCLUDES) -o $@ -c $<
 
 LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(LDFLAGS) -rpath $(libdir)
+LINK_DSO = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(LDFLAGS) -rpath $(fs_dso_libdir) $(LD_DSOFLAGS)
 LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR)
 
 INSTALL = @INSTALL@
 INSTALL_LIB = $(LIBTOOL) --mode=install $(INSTALL)
 INSTALL_BASE_LIB = $(INSTALL_LIB)
+INSTALL_BASE_DSO_LIB = $(INSTALL_LIB)
 INSTALL_FS_LIB = $(INSTALL_LIB)
+INSTALL_FS_DSO_LIB = $(INSTALL_LIB)
 INSTALL_BIN = $(LIBTOOL) --mode=install $(INSTALL)
 INSTALL_FS_BIN = $(INSTALL_BIN)
 INSTALL_INCLUDE = $(INSTALL) -m 644
diff -urN subversion.org/build.conf subversion/build.conf
--- subversion.org/build.conf	Fri Aug  2 14:34:55 2002
+++ subversion/build.conf	Fri Aug  2 20:06:13 2002
@@ -142,7 +142,7 @@
 [libsvn_ra_dav]
 type = lib
 path = subversion/libsvn_ra_dav
-install = base-lib
+install = base-dso-lib
 libs = libsvn_subr $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(NEON_LIBS)
 custom = ra-module
 
@@ -150,7 +150,7 @@
 [libsvn_ra_local]
 type = lib
 path = subversion/libsvn_ra_local
-install = fs-lib
+install = fs-dso-lib
 libs = libsvn_repos libsvn_fs libsvn_delta libsvn_subr $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS)
 custom = ra-module
 
diff -urN subversion.org/configure.in subversion/configure.in
--- subversion.org/configure.in	Fri Aug  2 14:34:55 2002
+++ subversion/configure.in	Fri Aug  2 21:26:38 2002
@@ -139,12 +139,12 @@
 
 # Only add *_APACHE_RULE if we also have db, since mod_dav_svn depends on it.
 INSTALL_STATIC_RULES="install-bin install-docs"
-INSTALL_RULES="install-base-lib install-lib install-include install-static"
-BUILD_RULES="base-lib lib bin test"
+INSTALL_RULES="install-base-lib install-base-dso-lib install-lib install-include install-static"
+BUILD_RULES="base-lib base-dso-lib lib bin test"
 if test "$svn_lib_berkeley_db" = "yes"; then
-  BUILD_RULES="base-lib fs-lib lib bin fs-bin $BUILD_APACHE_RULE test fs-test"
+  BUILD_RULES="base-lib fs-lib fs-dso-lib lib bin fs-bin $BUILD_APACHE_RULE test fs-test"
   INSTALL_STATIC_RULES="install-bin install-fs-bin install-docs"
-  INSTALL_RULES="install-base-lib install-fs-lib install-lib install-include install-static $INSTALL_APACHE_RULE"
+  INSTALL_RULES="install-base-lib install-base-dso-lib install-fs-lib install-fs-dso-lib install-lib install-include install-static $INSTALL_APACHE_RULE"
   FS_TEST_DEPS="\$(FS_TEST_DEPS)"
   FS_TEST_PROGRAMS="\$(FS_TEST_PROGRAMS)"
 fi
@@ -334,16 +334,25 @@
 AC_SUBST(INSTALL_INFO)
 
 dnl decide whether we want to link against the RA libraries
+SVN_FS_DSO_LIBDIR="\$(fs_libdir)"
+SVN_BASE_DSO_LIBDIR="\$(base_libdir)"
+SVN_LD_DSOFLAGS=""
 AC_ARG_ENABLE(dso,
 [  --enable-dso              Turn on DSO loading of RA libraries],
 [
     if test "$enableval" = "yes"; then
       enable_dso=yes
+      SVN_FS_DSO_LIBDIR="\$(fs_libdir)/subversion"
+      SVN_BASE_DSO_LIBDIR="\$(base_libdir)/subversion"
+      SVN_LD_DSOFLAGS="-module -avoid-version"
       if test "$enable_shared" = "no"; then
         AC_MSG_ERROR([--enable-dso conflicts with --disable-shared])
       fi
     fi
 ])
+AC_SUBST(SVN_FS_DSO_LIBDIR)
+AC_SUBST(SVN_BASE_DSO_LIBDIR)
+AC_SUBST(SVN_LD_DSOFLAGS)
 
 if test "$enable_shared" = "no" -o "$enable_dso" != "yes"; then
   AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_DAV, 1,
diff -urN subversion.org/subversion/libsvn_ra/ra_loader.c subversion/subversion/libsvn_ra/ra_loader.c
--- subversion.org/subversion/libsvn_ra/ra_loader.c	Fri Aug  2 14:35:26 2002
+++ subversion/subversion/libsvn_ra/ra_loader.c	Fri Aug  2 21:20:39 2002
@@ -89,7 +89,7 @@
     apr_status_t status;
 
     /* ### fix the .so part */
-    libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
+    libname = apr_psprintf (pool, SVN_LIBDIR "/subversion/libsvn_ra_%s-1.so", ra_name);
     funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
 
     /* find/load the specified library */

ps. -1 is hardcoded here because this patch only moves modules
from libdir to libdir/subversion/. Now what needs to be done is
change ra_load to load all so modules.
-- 
Arkadiusz Miśkiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Arkadiusz Miskiewicz <mi...@pld.ORG.PL>.
Justin Erenkrantz <je...@apache.org> writes:

> > Compile with --enable-dso and you will see the problem.
> 
> The code in load_ra_module is completely bogus.  
> 
>     /* ### fix the .so part */
>     libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
>     funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
> 
> .so isn't guaranteed.  Darwin uses .dylib.  There are many other
> variants, too.
> 
> If you really want to make this work with .so, you would have to
> link the ra_* libraries with the "-module" flag and override
> the default name to be libsvn_ra_*.so.
> 
> This is the strategy that httpd-2.0 uses for its DSO modules.  You
> would also place them in a separate directory than lib/ (ie
> modules/).
So what (IMO) should be done is when --enable-dso is specified:

- move dso modules to
  $(libdir}/subversion/${SVN_VER_MAJOR}.${SVN_VER_MINOR}.${SVN_VER_MICRO}
  and then move SVN_VER_XYZ to configure.in

  or

  move version from build.conf to configure.in, pass it to
  load_ra_module() and place all dso modules - libxyz-${version}.so
  - in $(libdir}/subversion/ (I prefer this)

- use -module

- rename modules to xyz.so or libxyz.so

- remove versioning (-avoid-version) to get libxyz.so instead
  of libxyz.so.0.0.0

Something else? +1 for that?
  
> Since the ra_loader code only looks for specific modules anyway,
> I'm not sure what the rationale is for having them dynamically
> loaded.  There isn't a way to register your provider with the
> ra functions without a recompile anyway.
Load all *.so from $(libdir}/subversion/ ?

> So, I'd rather see all of this code thrown out.  -- justin

-- 
Arkadiusz Miśkiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] [KLUDGE] fix ra_loader

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Scott Lamb <sl...@slamb.org> writes:
> I don't know how to do that. Is there any chance of this patch being
> applied, that just hardcodes the version? I know it's not ideal - it
> will break when the version changes. But it's broken now and this would
> at least fix it for a while.

Hmmm.  Well, your patch has revealed a deeper problem, I think:

I was going to propose that the Right Fix here is not that hard: just
use SVN_VER_MAJOR from svn_version.h, and "%d" it into the string.
Simple, right?

But, SVN_VER_MAJOR is 0 currently.  So I asked myself, how come the
libraries are getting installed under "libsvn_foo-1" right now, when
the whole point of the libsvn_foo numbers was supposedly to match the
major version number?

I found some clues in rev 2200:

It turns out that we're not getting the library version number from
svn_version.h, instead we're getting it from build.conf:

   [options]
   # for use in (include) paths and library construction
   version = 1

Greg Stein, is there some reason we're not parsing this out of
svn_version.h?  If it's supposed to match the major version, then we
should just get it from SVN_VER_MAJOR.

The fact that it was initialized to 1 instead of 0 makes me wonder
about my assertion that it's supposed to match the major version
number... But then again, I can't think of anything *else* it would be
tied to.  The major version seems the obvious choice.

So Scott: first we need to get the above settled, then we can apply a
no-doubt-trivial Right Fix to ra_loader.c.

-Karl

> Fix --enable-dso
> 
> * subversion/libsvn_ra/ra_loader.c:
>   Include hardcoded version 1 in library to load.
> 
> Index: subversion/libsvn_ra/ra_loader.c
> ===================================================================
> --- subversion/libsvn_ra/ra_loader.c
> +++ subversion/libsvn_ra/ra_loader.c	Thu Aug  1 11:57:41 2002
> @@ -89,7 +89,9 @@
>      apr_status_t status;
>  
>      /* ### fix the .so part */
> -    libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
> +    /* ### fix the build system to make version accessible from the source
> +       on Unix and Windows */
> +    libname = apr_psprintf (pool, "libsvn_ra_%s-1.so", ra_name);
>      funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
>  
>      /* find/load the specified library */
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] [KLUDGE] fix ra_loader

Posted by Scott Lamb <sl...@slamb.org>.
On Wed, Jul 31, 2002 at 10:04:55PM +0200, Branko ??ibej wrote:
> Scott Lamb wrote:
> >I've got a patch to the specfile to do this, but before I can use it, I
> >need ra_loader to work right. I'll try moving version to configure.in so
> >it can be used both in build-outputs.mk and in ra_loader.c
> 
> ... and not at all on Windows, which doesn't use configure.in. We need a 
> fix that can (be made to) work on all platforms.

I don't know how to do that. Is there any chance of this patch being
applied, that just hardcodes the version? I know it's not ideal - it
will break when the version changes. But it's broken now and this would
at least fix it for a while.

(Speaking of Windows, I think the thing never worked there - the other
### comment points out ".so" is assumed. I guess Apache never had this
problem because the name of the module was specified by the user in the
httpd.conf file.)

-- 
Scott Lamb



Fix --enable-dso

* subversion/libsvn_ra/ra_loader.c:
  Include hardcoded version 1 in library to load.

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c
+++ subversion/libsvn_ra/ra_loader.c	Thu Aug  1 11:57:41 2002
@@ -89,7 +89,9 @@
     apr_status_t status;
 
     /* ### fix the .so part */
-    libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
+    /* ### fix the build system to make version accessible from the source
+       on Unix and Windows */
+    libname = apr_psprintf (pool, "libsvn_ra_%s-1.so", ra_name);
     funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
 
     /* find/load the specified library */

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Branko Čibej <br...@xbc.nu>.
Scott Lamb wrote:

>On Wed, Jul 31, 2002 at 11:25:21AM -0700, Justin Erenkrantz wrote:
>  
>
>>Since the ra_loader code only looks for specific modules anyway,
>>I'm not sure what the rationale is for having them dynamically
>>loaded.  There isn't a way to register your provider with the
>>ra functions without a recompile anyway.
>>    
>>
>
>I'd like to enable it for the RPMs. It'd mean that, without recompiling,
>you could eliminate the dependency on Neon for remote-only builds or on
>Berkeley DB for local-only builds.
>
>I've got a patch to the specfile to do this, but before I can use it, I
>need ra_loader to work right. I'll try moving version to configure.in so
>it can be used both in build-outputs.mk and in ra_loader.c
>

... and not at all on Windows, which doesn't use configure.in. We need a 
fix that can (be made to) work on all platforms.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Scott Lamb <sl...@slamb.org>.
On Wed, Jul 31, 2002 at 11:25:21AM -0700, Justin Erenkrantz wrote:
> Since the ra_loader code only looks for specific modules anyway,
> I'm not sure what the rationale is for having them dynamically
> loaded.  There isn't a way to register your provider with the
> ra functions without a recompile anyway.

I'd like to enable it for the RPMs. It'd mean that, without recompiling,
you could eliminate the dependency on Neon for remote-only builds or on
Berkeley DB for local-only builds.

I've got a patch to the specfile to do this, but before I can use it, I
need ra_loader to work right. I'll try moving version to configure.in so
it can be used both in build-outputs.mk and in ra_loader.c

-- 
Scott Lamb

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Justin Erenkrantz <je...@apache.org>.
On Wed, Jul 31, 2002 at 08:11:12PM +0200, Arkadiusz Miskiewicz wrote:
> On my systems these are dlopen()ed modules:
> 
> [misiek@arm misiek]$ ldd /usr/bin/svn | grep ra
>         libsvn_ra-1.so.0 => /usr/lib/libsvn_ra-1.so.0 (0x00156000)
> 
> Compile with --enable-dso and you will see the problem.

The code in load_ra_module is completely bogus.  

    /* ### fix the .so part */
    libname = apr_psprintf (pool, "libsvn_ra_%s.so", ra_name);
    funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);

.so isn't guaranteed.  Darwin uses .dylib.  There are many other
variants, too.

If you really want to make this work with .so, you would have to
link the ra_* libraries with the "-module" flag and override
the default name to be libsvn_ra_*.so.

This is the strategy that httpd-2.0 uses for its DSO modules.  You
would also place them in a separate directory than lib/ (ie
modules/).

Since the ra_loader code only looks for specific modules anyway,
I'm not sure what the rationale is for having them dynamically
loaded.  There isn't a way to register your provider with the
ra functions without a recompile anyway.

So, I'd rather see all of this code thrown out.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Arkadiusz Miskiewicz <mi...@pld.ORG.PL>.
Philip Martin <ph...@codematters.co.uk> writes:

> > No idea why dlopen("libxyz.so", ...) opens libxyz-1.so on compilato system :-\
> 
> On my Linux system
> 
> $ ldd /usr/local/subversion/bin/svn | grep _ra
>         libsvn_ra-1.so.0 => /usr/local/subversion/lib/libsvn_ra-1.so.0 (0x40050000)
>         libsvn_ra_local-1.so.0 => /usr/local/subversion/lib/libsvn_ra_local-1.so.0 (0x40053000)
>         libsvn_ra_dav-1.so.0 => /usr/local/subversion/lib/libsvn_ra_dav-1.so.0 (0x4009e000)
> 
> $ LD_DEBUG=libs svn st ../svn/README 2>&1 | grep ra_local
> 31593:  find library=libsvn_ra_local-1.so.0; searching
> 31593:    trying file=/usr/local/subversion/lib/libsvn_ra_local-1.so.0
> 31593:  calling init: /usr/local/subversion/lib/libsvn_ra_local-1.so.0
> 31593:  calling fini: /usr/local/subversion/lib/libsvn_ra_local-1.so.0
> 
> These show that the libraries are opened as part of normal shared
> library opening when the program starts.
On my systems these are dlopen()ed modules:

[misiek@arm misiek]$ ldd /usr/bin/svn | grep ra
        libsvn_ra-1.so.0 => /usr/lib/libsvn_ra-1.so.0 (0x00156000)

Compile with --enable-dso and you will see the problem.

Someone asked already about moving ,,version'' from build.conf
to configure + passing it to load_ra_module but there was no reply.

> Philip Martin

-- 
Arkadiusz Miśkiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Philip Martin <ph...@codematters.co.uk>.
Arkadiusz Miskiewicz <mi...@pld.ORG.PL> writes:

> Arkadiusz Miskiewicz <mi...@pld.ORG.PL> writes:
> 
> > [misiek@arm subversion]$ svn up
> > 
> > svn_error: #21091 : <Bad URL passed to RA layer>
> >   Unrecognized URL scheme: http://svn.collab.net/repos/svn/trunk
> > 
> > Libs are there with ,,-1'' suffix but svn tries to load versions
> > without that suffix anyway.
> 
> I have no idea how this can work for you guys. compilato on #svn
> showed me strace from his svn and it was opening the right one
> module (with -1 suffix).
> 
[snip]
> No idea why dlopen("libxyz.so", ...) opens libxyz-1.so on compilato system :-\

On my Linux system

$ ldd /usr/local/subversion/bin/svn | grep _ra
        libsvn_ra-1.so.0 => /usr/local/subversion/lib/libsvn_ra-1.so.0 (0x40050000)
        libsvn_ra_local-1.so.0 => /usr/local/subversion/lib/libsvn_ra_local-1.so.0 (0x40053000)
        libsvn_ra_dav-1.so.0 => /usr/local/subversion/lib/libsvn_ra_dav-1.so.0 (0x4009e000)

$ LD_DEBUG=libs svn st ../svn/README 2>&1 | grep ra_local
31593:  find library=libsvn_ra_local-1.so.0; searching
31593:    trying file=/usr/local/subversion/lib/libsvn_ra_local-1.so.0
31593:  calling init: /usr/local/subversion/lib/libsvn_ra_local-1.so.0
31593:  calling fini: /usr/local/subversion/lib/libsvn_ra_local-1.so.0

These show that the libraries are opened as part of normal shared
library opening when the program starts.


-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ra_load and wrong loads

Posted by Arkadiusz Miskiewicz <mi...@pld.ORG.PL>.
Arkadiusz Miskiewicz <mi...@pld.ORG.PL> writes:

> [misiek@arm subversion]$ svn up
> 
> svn_error: #21091 : <Bad URL passed to RA layer>
>   Unrecognized URL scheme: http://svn.collab.net/repos/svn/trunk
> 
> Libs are there with ,,-1'' suffix but svn tries to load versions
> without that suffix anyway.

I have no idea how this can work for you guys. compilato on #svn
showed me strace from his svn and it was opening the right one
module (with -1 suffix).

I thought that something changed in current apr cvs, downloaded
it and:

[misiek@arm apr]$ diff -u dso/unix/dso.c~ dso/unix/dso.c
--- dso/unix/dso.c~     Wed Jul 31 18:37:36 2002
+++ dso/unix/dso.c      Wed Jul 31 18:34:03 2002
@@ -166,6 +166,7 @@
         flags |= RTLD_MEMBER;
     }
 #endif
+    printf("calling dlopen(\"%s\", %d)\n", path, flags);
     os_handle = dlopen(path, flags);
 #endif    
 #endif /* DSO_USE_x */

[misiek@arm subversion]$ svn up
calling dlopen("libsvn_ra_dav.so", 258)
calling dlopen("libsvn_ra_local.so", 258)

svn_error: #21094 : <Bad URL passed to RA layer>
  Unrecognized URL scheme: http://svn.collab.net/repos/svn/trunk
[misiek@arm subversion]$ strace -e open svn up 2>&1 | grep libsvn_ra
open("/usr/lib/libsvn_ra-1.so.0", O_RDONLY) = 3
open("/usr/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/users/misiek/s-test/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/mmx/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/i686/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/mmx/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_dav.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/users/misiek/s-test/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsvn_ra_local.so", O_RDONLY) = -1 ENOENT (No such file or directory)
calling dlopen("libsvn_ra_dav.so", 258)
calling dlopen("libsvn_ra_local.so", 258)

Files are there but with -1 prefix.

> [misiek@arm misiek]$ ls -l /usr/lib/libsvn*.so
[...]
> [...] /usr/lib/libsvn_ra_dav-1.so -> libsvn_ra_dav-1.so.0.0.0
> [...] /usr/lib/libsvn_ra_local-1.so -> libsvn_ra_local-1.so.0.0.0
[...]

> [misiek@arm misiek]$ ls -l /usr/lib/libsvn*.so.0.0.0
[...]
> -rwxr-xr-x    1 root     root        57188 lip 27 20:58 /usr/lib/libsvn_ra_dav-1.so.0.0.0
> -rwxr-xr-x    1 root     root        19208 lip 27 20:58 /usr/lib/libsvn_ra_local-1.so.0.0.0
[...]

No idea why dlopen("libxyz.so", ...) opens libxyz-1.so on compilato system :-\

-- 
Arkadiusz Miśkiewicz   IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl   AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org