MantisBT - ParaView
View Issue Details
0011893ParaViewBugpublic2011-02-24 07:552011-05-17 20:43
Mattijs 
David Partyka 
normalmajoralways
closedno change required 
x86_64linuxubuntu10.04.1 64
Development 
 
0011893: reader modules cannot use dlopen themselves
My reader module uses dlopen to load in some additional functionality. Because in DynamicLoader the dlopen does not export all symbols of the loaded reader this fails.

To resolve I've added an RTLD_GLOBAL to the dlopen call:

in TK/Utilities/kwsys/DynamicLoader.cxx, in DynamicLoader::OpenLibrary

change to:

  return dlopen(libname, RTLD_LAZY|RTLD_GLOBAL);

Mattijs
No tags attached.
Issue History
2011-02-24 07:55MattijsNew Issue
2011-03-18 12:59David PartykaAssigned To => David Partyka
2011-03-18 12:59David PartykaStatusbacklog => tabled
2011-03-18 13:33MattijsNote Added: 0025809
2011-03-23 11:35MattijsNote Added: 0025885
2011-03-29 11:00Brad KingNote Added: 0025954
2011-03-29 11:08MattijsNote Added: 0025955
2011-05-09 11:31David PartykaNote Added: 0026468
2011-05-09 11:31David PartykaStatustabled => @80@
2011-05-09 11:31David PartykaResolutionopen => no change required
2011-05-17 20:43Alan ScottNote Added: 0026530
2011-05-17 20:43Alan ScottStatus@80@ => closed

Notes
(0025809)
Mattijs   
2011-03-18 13:33   
With RTLD_GLOBAL I do get an error when I exit paraview (after loading our reader):

Inconsistency detected by ld.so: dl-close.c: 731: _dl_close: Assertion `map->l_init_called' failed!
Does paraview dlclose the loaded libraries?

B.t.w. if you need me to do some tests please let me know.

Mattijs
(0025885)
Mattijs   
2011-03-23 11:35   
I don't get this error in Paraview-3.8.0, I do get it with Paraview-3.10 or last weeks' git version.
(0025954)
Brad King   
2011-03-29 11:00   
It's been RTLD_LOCAL (by default due to lack of RTLD_GLOBAL) since the dynamic loader was written in 1999. Plugins from different vendors may conflict with one another's symbols. That's why each plugin is isolated. The proposed case is a plugin to a plugin which has never been supported.
(0025955)
Mattijs   
2011-03-29 11:08   
Makes sense. I can work around the RTLD_GLOBAL problem by making sure my own reader module is linked against enough libraries.

I still have the problem that since 3.10 or so even with RTLD_LOCAL I get above error upon exit from paraview. Any reason why this doesn't happen with 3.8? Did anything (relevant) change?

Thanks,

Mattijs
(0026468)
David Partyka   
2011-05-09 11:31   
See Comments.
(0026530)
Alan Scott   
2011-05-17 20:43   
agree. no change required.