Python cdll.LoadLibrary() Segfault

Jeff Aigner jaigner at setnine.com
Wed Aug 25 16:52:10 UTC 2010


Hello,

I am trying to use ctypes in python to load some external libs, and
python segfaults when I try to load libc.so.6. This error occurs with
both python 2.5.5 and python 2.6.5. Here's what happens:

jeffdev# python
Python 2.5.5 (r255:77872, Aug 25 2010, 12:17:48)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> cdll.LoadLibrary("/usr/compat/linux/lib/ld-linux.so.2")
<CDLL '/usr/compat/linux/lib/ld-linux.so.2', handle 28516400 at 284178ec>
>>> cdll.LoadLibrary("/usr/compat/linux/lib/libc.so.6")
Segmentation fault (core dumped)
jeffdev#

Also note that I have to give the full path to the libraries, even when
I try to set the environment variable $LD_LIBRARY_PATH

Some more info:

FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008
root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

Any idea as to what is happening here, or what I can do to try and get
around this issue?

Jeff Aigner



More information about the freebsd-questions mailing list