You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael Haubenwallner <mi...@salomon.at> on 2007/09/13 16:23:23 UTC
[Fwd: problem with dynamically loaded plugins]
Hi,
as I did not get any response on users list, and it's a possible bug,
forwarding this to dev list now...
/haubi/
-------- Forwarded Message --------
From: Michael Haubenwallner <mi...@salomon.at>
To: users@subversion.tigris.org
Subject: problem with dynamically loaded plugins
Date: Wed, 11 Jul 2007 12:57:23 +0200
Hi,
I've a problem with svn in a maybe somewhat uncommon use case.
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
What I think of here is some configure-switch to
* completely disable dynamically loading plugins
and/or
* reduce the plugin-search-path to the same prefix svn is
installed into.
Additionally, why not just ignore wrong-versioned plugins instead of
aborting on them ?
Currently I avoid plugin loading by compiling apr with "--disable-dso",
but this works only because noone else depends on my apr (specifically
apr-dso) yet.
Another minor confusion is that my svn-1.4.2 "expects" 1.4.4 while it
"finds" 1.4.2. This IMO can be fixed by simply exchanging the arguments
where that message is created: function check_ra_version() in
http://svn.collab.net/repos/svn/trunk/subversion/libsvn_ra/ra_loader.c
Thoughts ?
Thanks!
/haubi/
--
Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
Sitz der Gesellschaft: Friesach bei Graz
UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [Fwd: problem with dynamically loaded plugins]
Posted by Michael Haubenwallner <mi...@salomon.at>.
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
Re: [Fwd: problem with dynamically loaded plugins]
Posted by Eric Gillespie <ep...@pretzelnet.org>.
Marc Haisenko <ha...@comdasys.com> writes:
> So your problem seems to be the dynamic loader... 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/*
>
> 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.
>
> The workaround is to replace the binaries in /opt/svn/bin/* with wrapper
> scripts like this:
The real fix is for Subversion not to rely on the linker's search
path and instead specify the path directly to the plugin, the way
httpd does it. We'd also be able to get DSO working on Mac if we
did that.
--
Eric Gillespie <*> epg@pretzelnet.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [Fwd: problem with dynamically loaded plugins]
Posted by Marc Haisenko <ha...@comdasys.com>.
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
So your problem seems to be the dynamic loader... 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/*
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.
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---
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.
Hope that helps,
Marc
--
Marc Haisenko
Comdasys AG
Rüdesheimer Straße 7
D-80686 München
Tel: +49 (0)89 - 548 433 321
e-mail: haisenko@comdasys.com
http://www.comdasys.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org