symbol not found involving dynlink/dlopen/embedding Python

Christopher Armstrong radeex at gmail.com
Sun Dec 19 04:55:20 EST 2004


With the following situation, Numarray can't find Python's symbols.

problematic-Python::
  Main dlopens Two
  Two dynlinks Python
  Python dlopens Numarray
  Numarray dynlinks Python

I have another pure-C example that tries to mirror this, with::

minimal-C::
  Main dlopen Two
  Two dynlink Middle
  Middle dlopen Three
  Three dynlink Middle

and it works fine.

AFAICT, I'm using the same dlopen flags that Python is.

The minimal reproduction code is very small, but broken into several
files (to emulate the different parts). It's browsable at
http://twistedmatrix.com/users/radix/dynlink-problem , and
downloadable at
http://twistedmatrix.com/users/radix/dynlink-problem/dynlink-problem.tar.gz

After doing some googling, I've found several people that look like
they have similar problems. I even found one workaround involving
LD_PRELOAD. if you LD_PRELOAD=python2.3.so ./main, then the symbols
are found.

Does anyone have any idea on how I can solve this? I'd like to not
hack CPython, and not have tie the build to a single machine.



-- 
  Twisted   |  Christopher Armstrong: International Man of Twistery
   Radix    |    -- http://radix.twistedmatrix.com
            |  Release Manager, Twisted Project
  \\\V///   |    -- http://twistedmatrix.com
   |o O|    |  Founding Member, Hobart Hacking Society
w----v----w-+    -- http://hackingsociety.org/chapters/hash



More information about the Python-list mailing list