bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dlopen failure, dlerror message is junk


From: Lassi A. Tuura
Subject: dlopen failure, dlerror message is junk
Date: Tue, 03 Sep 2002 21:05:01 +0200

I am having a strange problem on a RH 7.x derived system with GLIBC
2.2.4; any help to sort this out would be most welcome.

Some of our C++ shared libraries built with GCC 3.2 are failing to load
for reasons I have not been able to understand yet.  The message from
dlerror is often garbled in various different ways; see below (I do not
yet have data on whether the message is always garbled when the load
fails).  valgrind reports tons of error messages in dynamic loader which
may or may not be relevant (output available on request).

As far as I can tell, everything goes fine (files and symbols are found
ok) but the dynamic linker still comes back with an error message.  Of
course it is possible I overlooked an error somewhere.  I can provide
LD_DEBUG output if someone is interested.

This could be caused by a wrong installation of GCC, binutils or some of
the libraries.  Some C++ libraries were built with GCC 3.1 (I know the
ABI changed; but surely that doesn't break the dynamic loader? we will
get properly built libraries soon, at the moment I am just checking that
the basic system works; failing to work due to ABI incompatibility is ok).
I am not yet sure which version of binutils were used to build the various
libraries.  It seems strange the dynamic loader would be this error prone,
so I am suspecting an error somewhere else -- but for the life of mine I
haven't been able to guess where.  I will investigate this further but any
direction would be most welcome.

If it is of any help, similar libraries seem to work when used in our
binaries; only the ones we try to dlopen fail.  The actual libraries that
dlopen fails on depend on commercial software so unfortunately I cannot
provide copies of them.  I have not yet succeeded to distill this to
a smaller test case either -- I am not even sure where to begin.

$ cat foo.cc 
#include <dlfcn.h>
#include <stdio.h>

int main (int, char **argv) {
   void *h = dlopen (argv[1], RTLD_GLOBAL | RTLD_LAZY);
   if (! h) {
      fprintf (stderr, "dlopen(): %s\n", dlerror ());
      return 1;
   }
   dlclose (h);
   return 0;
}
$ /home2/anaphe/gcc-alt-3.2/bin/c++ -ansi -pedantic -W -Wall -pthread 
-D_GNU_SOURCE foo.cc -ldl
$ ./a.out libIgSoReaderAppDriver.so                                             
 
dlopen(): /usr/X11R6/lib/libX11.soØ: shared object not open
zsh: 21571 exit 1     ./a.out libIgSoReaderAppDriver.so
$ ./a.out libIgSoViewerAppDriver.so              
$ ldd ../lib/Linux__2.4/libIgSoReaderAppDriver.so                               
 
        libclasslib.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libclasslib.so 
(0x4000f000)
        libCSL-XML.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libCSL-XML.so 
(0x40085000)
        libIgCommonData.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgCommonData.so 
(0x400f8000)
        libTGSInventorFix.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libTGSInventorFix.so 
(0x4010a000)
        libIg3DModel.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIg3DModel.so 
(0x4010d000)
        libIgPluginManager.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgPluginManager.so 
(0x4011a000)
        libIgObjectBrowser.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgObjectBrowser.so 
(0x40134000)
        libIgQtBrowser.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgQtBrowser.so 
(0x4019a000)
        libqt-mt.so.3 => 
/afs/cern.ch/user/l/lat/dev/qt-shadow/lib/libqt-mt.so.3 (0x401d0000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x40948000)
        libXft.so.1 => /usr/X11R6/lib/libXft.so.1 (0x4094e000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40978000)
        libpng.so.2 => /usr/lib/libpng.so.2 (0x409ac000)
        libz.so.1 => /usr/lib/libz.so.1 (0x409ce000)
        libInventor.so => 
/afs/cern.ch/sw/lhcxx/specific/redhat72/gcc-3.2/OpenInventor/3.1.1/lib/libInventor.so
 (0x409dc000)
        libimage.so => 
/afs/cern.ch/sw/lhcxx/specific/redhat72/gcc-3.2/OpenInventor/3.1.1/lib/libimage.so
 (0x414df000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x414e5000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0x416b9000)
        libglut.so.3 => /usr/lib/libglut.so.3 (0x416cd000)
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x416ff000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x4174b000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4175a000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x41851000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x41859000)
        libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x41867000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4187d000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x41894000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x4189d000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x418b4000)
        libdl.so.2 => /lib/libdl.so.2 (0x418e1000)
        libstdc++.so.5 => /home2/anaphe/gcc-alt-3.2/lib/libstdc++.so.5 
(0x418e5000)
        libm.so.6 => /lib/i686/libm.so.6 (0x4199e000)
        libgcc_s.so.1 => /home2/anaphe/gcc-alt-3.2/lib/libgcc_s.so.1 
(0x419c1000)
        libc.so.6 => /lib/i686/libc.so.6 (0x419ca000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x41b07000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
$ ldd ../lib/Linux__2.4/libIgSoViewerAppDriver.so 
        libclasslib.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libclasslib.so 
(0x40006000)
        libCSL-XML.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libCSL-XML.so 
(0x4007c000)
        libIgPluginManager.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgPluginManager.so 
(0x400ef000)
        libIgObjectBrowser.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgObjectBrowser.so 
(0x40109000)
        libTGSInventorFix.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libTGSInventorFix.so 
(0x40170000)
        libIgG4XDummies.so => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libIgG4XDummies.so 
(0x40172000)
        libSoQt.so.0 => 
/afs/cern.ch/user/l/lat/dev/IGUANA_3_1_1/lib/Linux__2.4/libSoQt.so.0 
(0x40175000)
        libqt-mt.so.3 => 
/afs/cern.ch/user/l/lat/dev/qt-shadow/lib/libqt-mt.so.3 (0x40232000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x409aa000)
        libXft.so.1 => /usr/X11R6/lib/libXft.so.1 (0x409af000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x409da000)
        libpng.so.2 => /usr/lib/libpng.so.2 (0x40a0e000)
        libz.so.1 => /usr/lib/libz.so.1 (0x40a30000)
        libInventor.so => 
/afs/cern.ch/sw/lhcxx/specific/redhat72/gcc-3.2/OpenInventor/3.1.1/lib/libInventor.so
 (0x40a3e000)
        libimage.so => 
/afs/cern.ch/sw/lhcxx/specific/redhat72/gcc-3.2/OpenInventor/3.1.1/lib/libimage.so
 (0x41541000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x41546000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0x4171b000)
        libglut.so.3 => /usr/lib/libglut.so.3 (0x4172f000)
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x41761000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x417ad000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x417bc000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x418b2000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x418bb000)
        libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x418c9000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x418df000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x418f6000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x418ff000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x41915000)
        libdl.so.2 => /lib/libdl.so.2 (0x41943000)
        libstdc++.so.5 => /home2/anaphe/gcc-alt-3.2/lib/libstdc++.so.5 
(0x41947000)
        libm.so.6 => /lib/i686/libm.so.6 (0x41a00000)
        libgcc_s.so.1 => /home2/anaphe/gcc-alt-3.2/lib/libgcc_s.so.1 
(0x41a23000)
        libc.so.6 => /lib/i686/libc.so.6 (0x41a2c000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x41b69000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
$ rpm -qa | grep glibc
glibc-2.2.4-24
glibc-common-2.2.4-24
compat-glibc-6.2-2.1.3.2
glibc-devel-2.2.4-24
$ rpm -qa | grep binutils
binutils-2.11.90.0.8-12
$ /home2/anaphe/gcc-alt-3.2/bin/c++ -v                                          
               
Reading specs from 
/home2/anaphe/gcc-alt-3.2/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc-3.2/configure --prefix /home2/anaphe/gcc-alt-3.2
Thread model: posix
gcc version 3.2

//lat
-- 
I distrust a close-mouthed man.  He generally picks the wrong
time to talk and says the wrong things.  Talking's something
you can't do judiciously, unless you keep in practice.  Now,
sir, we'll talk if you like.  I'll tell you right out, I'm a
man who likes talking to a man who likes to talk.
        --Sidney Greenstreet, "The Maltese Falcon"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]