【发布时间】:2016-11-27 17:16:15
【问题描述】:
我正在尝试编译和使用共享 C 库作为 python 模块,我观察到取决于DYLD_LIBRARY_PATH,我的代码可以正常工作,或者它会崩溃并显示一条神秘的错误消息。
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
我已尝试手动检查 /usr/lib 和 /usr/local/lib 和 /opt/local/lib 之间共有哪些库,但我无法找到崩溃的原因。找出问题原因的一种方法是找出两个进程使用哪些dylib 文件?我无法使用opensnoop 或dtruss 来解决这个问题,但也许我用错了这些工具。
如何找出导致此崩溃的原因?
【问题讨论】:
-
我投票决定将此问题作为离题结束,因为它已被交叉发布在更适合的 Stack Exchange 网站上。以后,请仅在单个 Stack Exchange 站点上发布您的问题。有关详细信息,请参阅here。 (apple.stackexchange.com/questions/247227/…)。
-
这个问题对我来说似乎完全是主题(假设你想调试你的编译配置)。但是它是 stackoverflow.com/questions/2184775/… 的副本
标签: macos shared-libraries osx-snow-leopard dylib dyld