I am trying to compile and use a shared C library as a python module and I am observing that depending on the DYLD_LIBRARY_PATH
my code works or it crashes with a cryptic error message.
Jul 24 02:44:44 master
$ DYLD_LIBRARY_PATH=/opt/local/lib python -c 'import opengm'
OKAY
Jul 24 02:45:41 master
$ DYLD_LIBRARY_PATH= python -c 'import opengm'
python(86214,0x7fff70ccdcc0) malloc: *** error for object 0x7fff70177500: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap
I have tried to manually inspect which libraries are common between /usr/lib
and /usr/local/lib
and /opt/local/lib
but I have not been able to find the cause of the crash. One way to figure out the cause of the problem will be to figure out which dylib
files do the two processes use? I was not able to figure this using opensnoop
or dtruss
but maybe I was using those tools wrong.
How can I figure out the cause of this crash?