Question about compiled moduls and dlopen
caeshmer at yahoo.com
caeshmer at yahoo.com
Thu Jul 19 15:48:59 EDT 2001
I'm running Red Hat Linux 7.0, and I installed the RPMs for Python 2.1
from python.org. I downloaded pygtk from Ximian
(pygtk-0.6.8-ximian.1) which uses python 1.5.2 as shipped by Red Hat,
and patched it to compile with /usr/bin/python2, put stuff in the
python2.1 directory, etc. So I have both versions of python
installed, and two compilations of pygtk. Everything works fine
except gdkpixbuf, which is a compiled module. This is my test
program:
import gdkpixbuf
p = gdkpixbuf.new_from_file("/tmp/spicy.gif")
print p
Under python 1.5.2, it works fine, just loads the file, displays
<GdkPixbuf object at 80cf920>, and exits. But when I run it under
python 2.1, I get this error:
python2: error while loading shared libraries:
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-gif.so: undefined symbol:
g_malloc0
What seems to be happening is that the libgdk_pixbuf library (which
the module calls into) loads .so modules of its own to handle
different kinds of image files. I've used ldd on these
/usr/lib/gdk-pixbuf/loaders/libpixbufloader-????.so files, and it
shows that they aren't linked with libglib, even though they make
calls like g_malloc. Any program that links directly with
libgdk_pixbuf would generally have to link with libglib, and I'm
assuming dlopen() could resolve g_malloc that way, but I don't know
what happens when you link a python module with libgdk_pixbuf.
I'm assuming something changed in python from version 1.5.2 to 2.1
that caused this problem, I just don't know what. I noticed that
there are new functions sys.getdlopenflags() and sys.setdlopenflags()
in 2.2, and I'm wondering if they might help solve this problem
somehow. Did the flags used to open a compiled module change between
1.5.2 and 2.1?
This is a problem that will have to be addressed at some point, and I
figure we may as well discuss it before 2.2 is finally released.
More information about the Python-list
mailing list