[openib-general] Re: [PATH] problem dlopen libibverbs.so
Gleb Natapov
glebn at voltaire.com
Wed Jul 20 08:27:36 PDT 2005
On Wed, Jul 20, 2005 at 06:23:49PM +0300, Michael S. Tsirkin wrote:
> Quoting r. Gleb Natapov <glebn at voltaire.com>:
> > Subject: Re: [PATH] problem dlopen libibverbs.so
> >
> > On Wed, Jul 20, 2005 at 05:57:28PM +0300, Michael S. Tsirkin wrote:
> > > Quoting r. Gleb Natapov <glebn at voltaire.com>:
> > > > Subject: Re: [PATH] problem dlopen libibverbs.so
> > > >
> > > > On Wed, Jul 20, 2005 at 05:24:22PM +0300, Michael S. Tsirkin wrote:
> > > > > Quoting r. Gleb Natapov <glebn at voltaire.com>:
> > > > > > It appears that libmthca relies on back linking to find symbols from
> > > > > > libibverbs but back linking doesn't work in the later case.
> > > > > >
> > > > > > I linked libmthca with libibverbs and this solved the problem.
> > > > >
> > > > > I wander, however, what happends if you load libibverbs from path
> > > > > a, and mthca is linked with libibverbs from path b?
> > > > > Any idea?
> > > >
> > > > If two libibverbs are different it can fail or even crash I think.
> > > > This is the same as if libibverb tries to load libmthca compiled from
> > > > different svn revision.
> > >
> > > May be a problem then: it might be quite hard to debug such crashes.
> >
> > Like any other problem caused by mismatched libraries.
>
> Right, but I think we dont want another dependency if it can work
> without it.
Agreed.
>
> > > What about passing RTLD_GLOBAL to dlopen, instead?
> >
> > The strange thing is it doesn't work, but it should according to man
> > page.
>
> Better debug it then.
>
It seems that RTLD_GLOBAL doesn't work as expected because libibverbs
calls ldopen from constructor and it is to early for RTLD_GLOBAL to take
effect. If I ldopen mthca.so after dlopen ("libibverbs.so", RTLD_NOW | RTLD_GLOBAL)
returns it actually succeeds. But alas it it to late.
--
Gleb.
More information about the general
mailing list