FAQ
I've run into problem loading modules on Debian (libc-2.2.2).

I first load module A.so (using the command "from A import *").
Note that library A.so contains the symbol _XXX. But when I
subsequently load module B.so (using the command "from B import *")
I get an ImportError: ./B.so undefined symbol: _XXX. To make
things perfectly clear, the dynamic loader has already seen _XXX
as it was loaded from A.so. So I don't see why the ImportError
occurs.

I've not seen this problem before. The usage outlined above works fine
on Mac OS X and on RedHat versions older than 7.2 (I won't have access to
7.2 for a week or so). A colleague thinks that I might indeed have the
same problem on RedHat 7.2 as he says the dynamic loader is broken in
new linux versions.

Has anyone seen this problem? Can anyone suggest a solution? I've tried
building python from scratch so that I know that I'm using the same
compiler versions
for everything but this didn't help.

Thanks,
Craig

Search Discussions

  • Martin von Loewis at Dec 4, 2001 at 2:28 pm

    Craig E Rasmussen <rasmussn at lanl.gov> writes:

    Has anyone seen this problem?
    The problem is that Python loads shared libraries using RTLD_LOCAL,
    which means that symbols from one extension are not available to
    another. This is by design; otherwise, extensions that have
    overlapping symbol spaces by coincidence would not be possible (*).
    Can anyone suggest a solution?
    Do not use extension modules as shared libraries. If you want to
    exchange information between them, use CObject instances.

    In Python 2.2, you will be able to set the dlopen flags using
    sys.setdlopenflags.

    Regards,
    Martin

    (*) in one reported instance of this problem, some extension was using
    a symbol name "initsocket", which unfortunately came from the socket
    module. This, essentially, has caused the change in Python. Redhat, in
    their 1.5.2 installation, reverted the change that already had been
    made in Python.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 3, '01 at 11:29p
activeDec 4, '01 at 2:28p
posts2
users2
websitepython.org

People

Translate

site design / logo © 2022 Grokbase