FFI is not finding libraries on Ubuntu 11.04

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

FFI is not finding libraries on Ubuntu 11.04

Tapple Gao
 
In the 4.4.7 interpreter unix vm, under ubuntu 11.04, I try to run
OpenGL like so:

OpenGL example

It gives an ffi error (Unable to find function address), and strace
reveals the following activity:

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/GL", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/GL", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/lib/GL", O_RDONLY)               = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/GL", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib/GL", O_RDONLY)           = -1 ENOENT (No such file or directory)

The library is actually at /usr/lib/mesa/libGL.so.1. I have no idea
why ffi is apparently looking for a file named GL rather than
libGL.so*

A simpler test is perhaps

X11Display new

which is included as an example in the FFI Unix Examples package, and
calls the external function

X11Display class >> XOpenDisplay: displayName
        "X11Display XOpenDisplay: nil"
        <cdecl: X11Display* 'XOpenDisplay' (char*) module:'X11'>
        ^self externalCallFailed

It also results in a series of calls to bogus files:

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/X11", O_RDONLY)              = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/X11", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("/usr/lib/X11", O_RDONLY)          = 8

The library is actually at /usr/lib/i386-linux-gnu/libX11.so.6 , which
is at least in whatever search path FFI seems to be using. It may have
found the library had it been looking for the correct filename

My ld config files are as follows:

=== /etc/ld.so.conf ===
include /etc/ld.so.conf.d/*.conf

=== /etc/ld.so.conf.d/GL.conf (symlink to /etc/alternatives/gl_conf) ===
/usr/lib/mesa

=== /etc/ld.so.conf.d/i686-linux-gnu.conf ===
# Multiarch support
/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu
/lib/i686-linux-gnu
/usr/lib/i686-linux-gnu

=== /etc/ld.so.conf.d/libasound2.conf ===
/usr/lib/alsa-lib

=== /etc/ld.so.conf.d/libc.conf ===
# libc default configuration
/usr/local/lib

There is no such file /etc/ld.so.nohwcap

I know this was working in ubuntu 10.04, but I erased that system and
reinstalled ubuntu 11.04, so I can't give a working strace example.
For now, I worked around the issue by making a symlink from
/usr/lib/GL to /usr/lib/mesa/libGL.so.6. This allowed me to run Cobalt

For comparison, the same commands give the following strace on cog vm 2378:

OpenGL example (Error: External module not found):

stat64("./bin-cog/i686-pc-linux-gnu", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
stat64("./bin-cog/i686-pc-linux-gnu.so", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("./bin-cog/i686-pc-linux-gnu.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("./bin-cog/i686-pc-linux-gnu.dylib", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu.so", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu.dylib", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/GL", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("./bin-cog/i686-pc-linux-gnu/GL", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/GL.so", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/GL.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/GL.dylib", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/GL.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libGL", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libGL", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libGL.so", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libGL.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libGL.dylib", 0xbf7b7f34) = -1
ENOENT (No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libGL.dylib", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("./GL", 0xbf7b7f34)              = -1 ENOENT (No such file or directory)
open("./GL", O_RDONLY)                  = -1 ENOENT (No such file or directory)
stat64("./GL.so", 0xbf7b7f34)           = -1 ENOENT (No such file or directory)
open("./GL.so", O_RDONLY)               = -1 ENOENT (No such file or directory)
stat64("./GL.dylib", 0xbf7b7f34)        = -1 ENOENT (No such file or directory)
open("./GL.dylib", O_RDONLY)            = -1 ENOENT (No such file or directory)
stat64("./libGL", 0xbf7b7f34)           = -1 ENOENT (No such file or directory)
open("./libGL", O_RDONLY)               = -1 ENOENT (No such file or directory)
stat64("./libGL.so", 0xbf7b7f34)        = -1 ENOENT (No such file or directory)
open("./libGL.so", O_RDONLY)            = -1 ENOENT (No such file or directory)
stat64("./libGL.dylib", 0xbf7b7f34)     = -1 ENOENT (No such file or directory)
open("./libGL.dylib", O_RDONLY)         = -1 ENOENT (No such file or directory)
stat64("GL", 0xbf7b7f34)                = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/GL", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/GL", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/lib/GL", O_RDONLY)               = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/GL", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib/GL", O_RDONLY)           = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("GL.so", 0xbf7b7f34)             = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/GL.so", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/i386-linux-gnu/GL.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/GL.so", O_RDONLY)            = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/GL.so", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/usr/lib/GL.so", O_RDONLY)        = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("GL.dylib", 0xbf7b7f34)          = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/GL.dylib", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/i386-linux-gnu/GL.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/GL.dylib", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/GL.dylib", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/GL.dylib", O_RDONLY)     = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("libGL", 0xbf7b7f34)             = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libGL", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/i386-linux-gnu/libGL", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/libGL", O_RDONLY)            = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libGL", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/usr/lib/libGL", O_RDONLY)        = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("libGL.so", 0xbf7b7f34)          = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libGL.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/i386-linux-gnu/libGL.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/libGL.so", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libGL.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libGL.so", O_RDONLY)     = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("libGL.dylib", 0xbf7b7f34)       = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76a57000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libGL.dylib", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/i386-linux-gnu/libGL.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/libGL.dylib", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libGL.dylib", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/libGL.dylib", O_RDONLY)  = -1 ENOENT (No such file or directory)
munmap(0x76a57000, 61529)               = 0
stat64("/GL", 0xbf7b7f34)               = -1 ENOENT (No such file or directory)
open("/GL", O_RDONLY)                   = -1 ENOENT (No such file or directory)
stat64("/GL.so", 0xbf7b7f34)            = -1 ENOENT (No such file or directory)
open("/GL.so", O_RDONLY)                = -1 ENOENT (No such file or directory)
stat64("/GL.dylib", 0xbf7b7f34)         = -1 ENOENT (No such file or directory)
open("/GL.dylib", O_RDONLY)             = -1 ENOENT (No such file or directory)
stat64("/libGL", 0xbf7b7f34)            = -1 ENOENT (No such file or directory)
open("/libGL", O_RDONLY)                = -1 ENOENT (No such file or directory)
stat64("/libGL.so", 0xbf7b7f34)         = -1 ENOENT (No such file or directory)
open("/libGL.so", O_RDONLY)             = -1 ENOENT (No such file or directory)
stat64("/libGL.dylib", 0xbf7b7f34)      = -1 ENOENT (No such file or directory)
open("/libGL.dylib", O_RDONLY)          = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL.so",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL.so",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL.dylib",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/GL.dylib",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL.so",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL.so",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL.dylib",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/GL/.libs/libGL.dylib",
O_RDONLY) = -1 ENOENT (No such file or directory)

X11Display new (Error: External module not found):

stat64("./bin-cog/i686-pc-linux-gnu", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
stat64("./bin-cog/i686-pc-linux-gnu.so", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("./bin-cog/i686-pc-linux-gnu.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("./bin-cog/i686-pc-linux-gnu.dylib", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu.so", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("lib./bin-cog/i686-pc-linux-gnu.dylib", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("lib./bin-cog/i686-pc-linux-gnu.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/X11", 0xbf7b7f34) = -1 ENOENT (No
such file or directory)
open("./bin-cog/i686-pc-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/X11.so", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/X11.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/X11.dylib", 0xbf7b7f34) = -1
ENOENT (No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/X11.dylib", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libX11", 0xbf7b7f34) = -1 ENOENT
(No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libX11", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libX11.so", 0xbf7b7f34) = -1
ENOENT (No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libX11.so", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("./bin-cog/i686-pc-linux-gnu/libX11.dylib", 0xbf7b7f34) = -1
ENOENT (No such file or directory)
open("./bin-cog/i686-pc-linux-gnu/libX11.dylib", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("./X11", 0xbf7b7f34)             = -1 ENOENT (No such file or directory)
open("./X11", O_RDONLY)                 = -1 ENOENT (No such file or directory)
stat64("./X11.so", 0xbf7b7f34)          = -1 ENOENT (No such file or directory)
open("./X11.so", O_RDONLY)              = -1 ENOENT (No such file or directory)
stat64("./X11.dylib", 0xbf7b7f34)       = -1 ENOENT (No such file or directory)
open("./X11.dylib", O_RDONLY)           = -1 ENOENT (No such file or directory)
stat64("./libX11", 0xbf7b7f34)          = -1 ENOENT (No such file or directory)
open("./libX11", O_RDONLY)              = -1 ENOENT (No such file or directory)
stat64("./libX11.so", 0xbf7b7f34)       = -1 ENOENT (No such file or directory)
open("./libX11.so", O_RDONLY)           = -1 ENOENT (No such file or directory)
stat64("./libX11.dylib", 0xbf7b7f34)    = -1 ENOENT (No such file or directory)
open("./libX11.dylib", O_RDONLY)        = -1 ENOENT (No such file or directory)
stat64("X11", 0xbf7b7f34)               = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/X11", O_RDONLY)              = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/X11", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("/usr/lib/X11", O_RDONLY)          = 9
close(9)                                = 0
munmap(0x76e5f000, 61529)               = 0
stat64("X11.so", 0xbf7b7f34)            = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/X11.so", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/i386-linux-gnu/X11.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/X11.so", O_RDONLY)           = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/X11.so", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/lib/X11.so", O_RDONLY)       = -1 ENOENT (No such file or directory)
munmap(0x76e5f000, 61529)               = 0
stat64("X11.dylib", 0xbf7b7f34)         = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/X11.dylib", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/i386-linux-gnu/X11.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/X11.dylib", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/X11.dylib", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/X11.dylib", O_RDONLY)    = -1 ENOENT (No such file or directory)
munmap(0x76e5f000, 61529)               = 0
stat64("libX11", 0xbf7b7f34)            = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libX11", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/i386-linux-gnu/libX11", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/lib/libX11", O_RDONLY)           = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libX11", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/lib/libX11", O_RDONLY)       = -1 ENOENT (No such file or directory)
munmap(0x76e5f000, 61529)               = 0
stat64("libX11.so", 0xbf7b7f34)         = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libX11.so", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/usr/lib/i386-linux-gnu/libX11.so", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/libX11.so", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libX11.so", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libX11.so", O_RDONLY)    = -1 ENOENT (No such file or directory)
munmap(0x76e5f000, 61529)               = 0
stat64("libX11.dylib", 0xbf7b7f34)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=61529, ...}) = 0
mmap2(NULL, 61529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x76e5f000
close(9)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libX11.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/usr/lib/i386-linux-gnu/libX11.dylib", O_RDONLY) = -1 ENOENT (No
such file or directory)
open("/lib/libX11.dylib", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("/usr/lib/sse2/libX11.dylib", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/lib/libX11.dylib", O_RDONLY) = -1 ENOENT (No such file or directory)
munmap(0x76e5f000, 61529)               = 0
stat64("/X11", 0xbf7b7f34)              = -1 ENOENT (No such file or directory)
open("/X11", O_RDONLY)                  = -1 ENOENT (No such file or directory)
stat64("/X11.so", 0xbf7b7f34)           = -1 ENOENT (No such file or directory)
open("/X11.so", O_RDONLY)               = -1 ENOENT (No such file or directory)
stat64("/X11.dylib", 0xbf7b7f34)        = -1 ENOENT (No such file or directory)
open("/X11.dylib", O_RDONLY)            = -1 ENOENT (No such file or directory)
stat64("/libX11", 0xbf7b7f34)           = -1 ENOENT (No such file or directory)
open("/libX11", O_RDONLY)               = -1 ENOENT (No such file or directory)
stat64("/libX11.so", 0xbf7b7f34)        = -1 ENOENT (No such file or directory)
open("/libX11.so", O_RDONLY)            = -1 ENOENT (No such file or directory)
stat64("/libX11.dylib", 0xbf7b7f34)     = -1 ENOENT (No such file or directory)
open("/libX11.dylib", O_RDONLY)         = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11.so",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11.so",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11.dylib",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/X11.dylib",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11.so",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11.so",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11.dylib",
0xbf7b7f34) = -1 ENOENT (No such file or directory)
open("/home/tapple/celery/cobalt/opencobalt-1.0alpha12-squeak16.dev1/bin-cog/i686-pc-linux-gnu/X11/.libs/libX11.dylib",
O_RDONLY) = -1 ENOENT (No such file or directory)

cog is looking in way more places than the interpreter VM, but still
doesn't seem to be using ld properly. it misses /usr/lib/mesa, and is
looking for lib*.so files rather than lib*.so.x files

Also, as a side note, the text of the error seems to be different on
interpreter (Unable to find function address) vs cog (External module
not found)
Reply | Threaded
Open this post in threaded view
|

Re: FFI is not finding libraries on Ubuntu 11.04

David T. Lewis
 
On Wed, May 25, 2011 at 03:55:25PM -0400, Matthew Fulmer wrote:

>
> X11Display class >> XOpenDisplay: displayName
> "X11Display XOpenDisplay: nil"
> <cdecl: X11Display* 'XOpenDisplay' (char*) module:'X11'>
> ^self externalCallFailed
>
> It also results in a series of calls to bogus files:
>
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such file or
> directory)
> open("/usr/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> open("/lib/X11", O_RDONLY)              = -1 ENOENT (No such file or directory)
> open("/usr/lib/sse2/X11", O_RDONLY)     = -1 ENOENT (No such file or directory)
> open("/usr/lib/X11", O_RDONLY)          = 8
>
> The library is actually at /usr/lib/i386-linux-gnu/libX11.so.6 , which
> is at least in whatever search path FFI seems to be using. It may have
> found the library had it been looking for the correct filename

And if you change the declaration to the following, it works?

  <cdecl: X11Display* 'XOpenDisplay' (char*) module:'libX11.so.6'>

Dave

Reply | Threaded
Open this post in threaded view
|

Re: FFI is not finding libraries on Ubuntu 11.04

Igor Stasenko

On 26 May 2011 04:49, David T. Lewis <[hidden email]> wrote:

>
> On Wed, May 25, 2011 at 03:55:25PM -0400, Matthew Fulmer wrote:
>>
>> X11Display class >> XOpenDisplay: displayName
>>       "X11Display XOpenDisplay: nil"
>>       <cdecl: X11Display* 'XOpenDisplay' (char*) module:'X11'>
>>       ^self externalCallFailed
>>
>> It also results in a series of calls to bogus files:
>>
>> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
>> open("/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such file or
>> directory)
>> open("/usr/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
>> file or directory)
>> open("/lib/X11", O_RDONLY)              = -1 ENOENT (No such file or directory)
>> open("/usr/lib/sse2/X11", O_RDONLY)     = -1 ENOENT (No such file or directory)
>> open("/usr/lib/X11", O_RDONLY)          = 8
>>
>> The library is actually at /usr/lib/i386-linux-gnu/libX11.so.6 , which
>> is at least in whatever search path FFI seems to be using. It may have
>> found the library had it been looking for the correct filename
>
> And if you change the declaration to the following, it works?
>
>  <cdecl: X11Display* 'XOpenDisplay' (char*) module:'libX11.so.6'>
>

yes, but if you change it like that, where the guarantees that it will
work on another unix box?
Apparently a solution to that is to deal with library search at
language side and stop relying on
too clever FFI/VM library lookup mechanism, hardcoded in C, because it
will never satisfy all possible combinations
on all possible platforms.

> Dave
>


--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: FFI is not finding libraries on Ubuntu 11.04

David T. Lewis
 
On Thu, May 26, 2011 at 01:24:09PM +0200, Igor Stasenko wrote:

>
> On 26 May 2011 04:49, David T. Lewis <[hidden email]> wrote:
> >
> > On Wed, May 25, 2011 at 03:55:25PM -0400, Matthew Fulmer wrote:
> >>
> >> X11Display class >> XOpenDisplay: displayName
> >> ?? ?? ?? "X11Display XOpenDisplay: nil"
> >> ?? ?? ?? <cdecl: X11Display* 'XOpenDisplay' (char*) module:'X11'>
> >> ?? ?? ?? ^self externalCallFailed
> >>
> >> It also results in a series of calls to bogus files:
> >>
> >> access("/etc/ld.so.nohwcap", F_OK) ?? ?? ??= -1 ENOENT (No such file or directory)
> >> open("/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such file or
> >> directory)
> >> open("/usr/lib/i386-linux-gnu/X11", O_RDONLY) = -1 ENOENT (No such
> >> file or directory)
> >> open("/lib/X11", O_RDONLY) ?? ?? ?? ?? ?? ?? ??= -1 ENOENT (No such file or directory)
> >> open("/usr/lib/sse2/X11", O_RDONLY) ?? ?? = -1 ENOENT (No such file or directory)
> >> open("/usr/lib/X11", O_RDONLY) ?? ?? ?? ?? ??= 8
> >>
> >> The library is actually at /usr/lib/i386-linux-gnu/libX11.so.6 , which
> >> is at least in whatever search path FFI seems to be using. It may have
> >> found the library had it been looking for the correct filename
> >
> > And if you change the declaration to the following, it works?
> >
> > ??<cdecl: X11Display* 'XOpenDisplay' (char*) module:'libX11.so.6'>
> >
>
> yes, but if you change it like that, where the guarantees that it will
> work on another unix box?

Yes for sure, you would not want to declare it that way. I was
just checking my understanding of the problem. Thanks.

Dave