Python cdll.LoadLibrary() Segfault

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


I am trying to use ctypes in python to load some external libs, and
python segfaults when I try to load 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/")
<CDLL '/usr/compat/linux/lib/', handle 28516400 at 284178ec>
>>> cdll.LoadLibrary("/usr/compat/linux/lib/")
Segmentation fault (core dumped)

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  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