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

Re: [Fwd: problem with dynamically loaded plugins]

From: Michael Haubenwallner <michael.haubenwallner_at_salomon.at>
Date: 2007-09-13 21:09:07 CEST

On Thu, 2007-09-13 at 18:44 +0200, Marc Haisenko wrote:
> On Thursday 13 September 2007 18:23, Michael Haubenwallner wrote:
> > I'm compiling svn (currently 1.4.2) with reduced capabilities (only
> > 'svn' and 'file' plugins, no need for 'dav') to have less dependencies
> > myself, because on the target machine I cannot assume a preinstalled svn
> > nor do I have root access.
> > Also, as I have svn embedded into some package-building mechanism,
> > always installing complete svn on the target machine manually is too
> > much work.
> >
> > But now, when this target machine has a different svn version (say
> > 1.4.4) installed in /usr/bin (libs in /usr/lib) or somewhere else where
> > the dynamic-loader finds shared libs, when using my own "svn --version"
> > I get this error:
> >
> > svn: Mismatched RA version for 'dav': found 1.4.2, expected 1.4.4

The minor one:
My 1.4.2 version is "finding" 1.4.2, but "expecting" 1.4.4 ?

>
> So your problem seems to be the dynamic loader...

No, my problem is somewhat more sophisticated:

> I'm assuming the following
> layout for the explanation:
>
> 1.4.4: /usr/bin/*
> /usr/lib/*
>
> 1.4.2: /opt/svn/bin/*
> /opt/svn/lib/*
>

For the layout, you're right.

> Problem is, the dynamic link loader will search only he knows about for the
> SubVersion libraries: and that's /usr/lib in this case. So it will load the
> one from that directory. See /etc/ld.so.conf.

Thing is, /opt/svn/lib _is_ searched correctly _before_ /usr/lib (I have
used -rpath for linking), but it does intentionally _not_ contain the
'dav' module.
So they are found in /usr/lib, which are the wrong version.

>
> The workaround is to replace the binaries in /opt/svn/bin/* with wrapper
> scripts like this:
>
> ---snip---
> #!/bin/sh
>
> LD_LIBRARY_PATH=/opt/svn/lib
> export LD_LIBRARY_PATH
> "$0.orig" "$@"
> ---snip---

Specifying LD_LIBRARY_PATH will not help here, as /usr/lib is searched
anyway after LD_LIBRARY_PATH. It is _not_ specified in /etc/ld.so.conf.

>
> Rename the original /opt/svn/bin/svn* commands to /opt/svn/bin/svn*.orig, put
> the script (or symlink to it) in their place and it should load the correct
> libraries. If that doesn't work you could use the LD_PRELOAD sledgehammer,
> but LD_LIBRARY_PATH should work just fine. Instead of "/opt/svn/lib" you
> could also write (this time INCLUDING the quotation marks to make it work
> with paths which include spaces) "`dirname "$0"`/../lib" to make it
> relocatable.

What I want to suggest simply is to ignore wrong versioned plugins, not
to abort on them.

Also, being able to explicitly disable searching for modules at
subversion's configure line is an option in parallel (is it possible
that I have seen this in more recent versions already?).

Thanks!
/haubi/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 13 21:05:43 2007

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.