[Paraview] dlopen question

Mattijs Janssens m.janssens at opencfd.co.uk
Thu Oct 2 17:29:11 EDT 2008


On Thursday 02 October 2008 16:56, clinton at elemtech.com wrote:
> On Linux, did you not link libAdditional with libmain?  I assume you doing
> that on the OSX already, or you'd probably get link errors.

libAdditional knows about libMain, libMain does not know about libAdditional.

paraview seems to do a dlopen of the reader module (which is linked to 
libMain). libMain then does a dlopen of libAdditional. This works on OSX but 
not on Linux.

An application (that is linked to libMain) does not have problems - libMain 
correctly dlopens libAdditional. It is only the extra dlopen step that 
creates problems.

>
> Then you shouldn't have order issues with dlopen on Linux and things should
> just work.
>
> Clint
>
> On Thursday 02 October 2008 2:13:16 am Mattijs Janssens wrote:
> > I tried changing the flags on that. Currently is local scope:
> >
> > 	dlopen(libname, RTLD_LAZY);
> >
> > Anyone of
> >
> > 	return dlopen(libname, RTLD_LAZY|RTLD_GLOBAL);
> > 	return dlopen(libname, RTLD_LAZY|RTLD_DEEPBIND);
> >
> > makes the paraview crash on start-up! (even without loading any
> > user-defined reader).
> >
> > Guess a testprogram is needed. Bit strange that there is no problem on
> > OSX - seems to use the same code.
> >
> > On Monday 29 September 2008 15:38, Takuya OSHIMA wrote:
> > > Hi Mattijs,
> > >
> > > If I'm not wrong it's in
> > > ParaView3/VTK/Utilities/kwsys/DynamicLoader.cxx.
> > >
> > > Takuya OSHIMA, Ph.D.
> > > Faculty of Engineering, Niigata University
> > > 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
> > >
> > > From: Mattijs Janssens <m.janssens at opencfd.co.uk>
> > > Subject: Re: [Paraview] dlopen question
> > > Date: Mon, 29 Sep 2008 10:41:18 +0100
> > >
> > > > Thanks Takuya,
> > > >
> > > > the thing I picked up from that discussion is to use RTLD_GLOBAL. Do
> > > > you know which routine is doing the dlopen inside Paraview - would
> > > > like to trace what is happening.
> > > >
> > > > Regards,
> > > >
> > > > Mattijs
> > > >
> > > > On Wednesday 24 September 2008 04:36, Takuya OSHIMA wrote:
> > > > > Hi Mattijs,
> > > > >
> > > > > Not sure if this helps, but interestingly a VisIt guy had a very
> > > > > similar problem around a week ago. You can follow the discussion by
> > > > > searching for "help with dlopen" in
> > > > > https://email.ornl.gov/pipermail/visit-developers/2008-September/th
> > > > >re ad .htm l .
> > > > >
> > > > > The caveat is that he says RTLD_LAZY|RTLD_GLOBAL solved the problem
> > > > > while apparently not in this case...
> > > > >
> > > > > Takuya OSHIMA, Ph.D.
> > > > > Faculty of Engineering, Niigata University
> > > > > 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
> > > > >
> > > > >
> > > > > From: Mattijs Janssens <m.janssens at opencfd.co.uk>
> > > > > Subject: [Paraview] dlopen question
> > > > > Date: Mon, 22 Sep 2008 10:22:49 +0100
> > > > >
> > > > > > In our code we use dlopen with RTLD_LAZY|RTLD_GLOBAL to
> > > > > > optionally load additional libraries.
> > > > > >
> > > > > > We noticed that this gives problems in the paraview reader. The
> > > > > > same code which happily loads when running from the command line
> > > > > > now gives undefined symbols when used through the reader.
> > > > > >
> > > > > > E.g. the additional library libAdditional uses a symbol aaa from
> > > > > > library libmain which is already a dependency of my application.
> > > > > > (so 'ldd application' shows up libmain). My application does a
> > > > > > dlopen of libAdditional and it all works fine.
> > > > > >
> > > > > > Now when invoked in a reader (the reader itself I assume is
> > > > > > loaded using dlopen into Paraview?) the dlopen of libAdditional
> > > > > > complains about unresolved symbol aaa. Funnily enough it works if
> > > > > > we first do a dlopen of libmain and then of libAdditional.
> > > > > >
> > > > > > Is this related to the flags passed into dlopen? To complicate
> > > > > > the matter, from what we heard, the problem does not appear on
> > > > > > OSX.
> > > > > >
> > > > > > Regards,
> > > > > >
> > > > > > Mattijs
> > > >
> > > > _______________________________________________
> > > > ParaView mailing list
> > > > ParaView at paraview.org
> > > > http://www.paraview.org/mailman/listinfo/paraview
> > >
> > > _______________________________________________
> > > ParaView mailing list
> > > ParaView at paraview.org
> > > http://www.paraview.org/mailman/listinfo/paraview
> >
> > _______________________________________________
> > ParaView mailing list
> > ParaView at paraview.org
> > http://www.paraview.org/mailman/listinfo/paraview

-- 

Mattijs Janssens

OpenCFD Ltd.
9 Albert Road,
Caversham,
Reading RG4 7AN.
Tel: +44 (0)118 9471030
Email: M.Janssens at OpenCFD.co.uk
URL: http://www.OpenCFD.co.uk


More information about the ParaView mailing list