libtool
[Top][All Lists]
Advanced

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

Re: "error while loading shared libraries: foo.so.0: cannot open shared


From: Laurence Darby
Subject: Re: "error while loading shared libraries: foo.so.0: cannot open shared object file: No such file or directory"
Date: Mon, 17 Dec 2007 00:23:03 +0000

Bob Friesenhahn wrote:

> 
> Your email seems to contain a lot of details, but upon closer 
> inspection the details are not of the right type.  For example, you 
> have not even identified the operating system you are using.
> 


Sorry, it's i686-pc-linux-gnu, Slackware 12.0 (mostly).

 $ uname -a
Linux home 2.6.22.12 #3 PREEMPT Fri Dec 14 17:46:02 GMT 2007 i686
GNU/Linux

 $ autoconf --version
autoconf (GNU Autoconf) 2.61

 $ automake --version
automake (GNU automake) 1.10

 $ libtool --version
ltmain.sh (GNU libtool) 1.5.24 (1.1220.2.455 2007/06/24 02:13:29)

 $ gcc --version
gcc (GCC) 4.1.2

 $ ls -l /lib/libc.so.6 
... /lib/libc.so.6 -> libc-2.5.so

However I don't think those versions matter, as I've seen this problem
for years.

> 
> Sometimes linker failures while installing shared librares are
> because the shared libraries were installed in the wrong order, and
> re-linking using the final installed locations was required.  For
> example, perhaps library B depends on library A, but library B is
> being installed before library A.  Automake does not handle this 
> automatically.
> 

I thought it did, but this isn't a linking problem (as in /usr/bin/ld).
The problem is loading a program at start up time (when loading dynamic
linked libraries).

It's only when a package builds its own libs which it dynamic links to
runtime, which isn't that rare.

Alright, for reproducibility, here is a small example, 
inotify-tools-3.12.tar.gz.  
Firstly please run

 # locate libinotifytools.so | xargs rm

so there is zero chance of hiding the error with stale libraries hiding
somewhere on the system.

 $ wget http://downloads.sourceforge.net/inotify-tools/inotify-tools-3.12.tar.gz
 $ tar zxf inotify-tools-3.12.tar.gz
 $ cd inotify-tools-3.12/
 $ ./configure && make && sudo make install
[see attachment for full details]
 $ rehash (if SHELL=/bin/tcsh)
 $ inotifywait 
inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot 
open shared object file: No such file or directory

 $ strace -f -s 3000 inotifywait
execve("/usr/local/bin/inotifywait", ["inotifywait"], [/* 43 vars */]) = 0
brk(0)                                  = 0x804e000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7f82000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=132796, ...}) = 0
mmap2(NULL, 132796, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f61000
close(3)                                = 0
open("/lib/tls/i686/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such 
file or directory)
stat64("/lib/tls/i686/sse2", 0xbff6fd78) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/lib/tls/i686", 0xbff6fd78)     = -1 ENOENT (No such file or directory)
open("/lib/tls/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/lib/tls/sse2", 0xbff6fd78)     = -1 ENOENT (No such file or directory)
open("/lib/tls/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat64("/lib/tls", 0xbff6fd78)          = -1 ENOENT (No such file or directory)
open("/lib/i686/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/lib/i686/sse2", 0xbff6fd78)    = -1 ENOENT (No such file or directory)
open("/lib/i686/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat64("/lib/i686", 0xbff6fd78)         = -1 ENOENT (No such file or directory)
open("/lib/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat64("/lib/sse2", 0xbff6fd78)         = -1 ENOENT (No such file or directory)
open("/lib/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat64("/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/tls/i686/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No 
such file or directory)
stat64("/usr/lib/tls/i686/sse2", 0xbff6fd78) = -1 ENOENT (No such file or 
directory)
open("/usr/lib/tls/i686/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such 
file or directory)
stat64("/usr/lib/tls/i686", 0xbff6fd78) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such 
file or directory)
stat64("/usr/lib/tls/sse2", 0xbff6fd78) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/usr/lib/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/i686/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such 
file or directory)
stat64("/usr/lib/i686/sse2", 0xbff6fd78) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/usr/lib/i686", 0xbff6fd78)     = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file 
or directory)
stat64("/usr/lib/sse2", 0xbff6fd78)     = -1 ENOENT (No such file or directory)
open("/usr/lib/libinotifytools.so.0", O_RDONLY) = -1 ENOENT (No such file or 
directory)
stat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=90112, ...}) = 0
writev(2, [{"inotifywait", 11}, {": ", 2}, {"error while loading shared 
libraries", 36}, {": ", 2}, {"libinotifytools.so.0", 20}, {": ", 2}, {"cannot 
open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, 
{"\n", 1}], 10inotifywait: error while loading shared libraries: 
libinotifytools.so.0: cannot open shared object file: No such file or directory
) = 131
exit_group(127)                         = ?
Process 12930 detached

 $ sudo ldconfig (or any of the other things I said in the first mail)

 $ inotifywait 
No files specified to watch!

I want to just repeat my first email here, but you could just reread it.

Thanks,
Laurence

Attachment: buildlog.bz2
Description: Binary data


reply via email to

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