0
我有一個長時間運行的程序,在9小時後出現(可能是間歇性)分段錯誤,我擁有的是一個堆棧跟蹤。我想找到發生分段故障的源代碼行。從堆棧跟蹤中找到共享庫中的源代碼行
segfault發生在使用ctypes從Python中調用的C++模塊(使用OpenMP)中。 C++模塊在linux上用調試符號編譯。 Python程序本身在OpenMPI下運行,這使得調試更具挑戰性,而且我沒有核心轉儲。
堆棧跟蹤的頂部如下。我有興趣找到我所能得到的關於源代碼行_ZN13BackbonePairs13compute_valueE11ComputeMode+0x5e1
的任何信息。這顯然是我的BackbonePairs :: compute_value函數,但該函數沒有線程啓動,所以我不確定堆棧跟蹤中的libpthread。
[midway2-0015:35095] *** Process received signal ***
[midway2-0015:35095] Signal: Segmentation fault (11)
[midway2-0015:35095] Signal code: Invalid permissions (2)
[midway2-0015:35095] Failing at address: 0x7fd7633c6000
[midway2-0015:35095] [ 0] /lib64/libpthread.so.0(+0xf100)[0x7fdb86986100]
[midway2-0015:35095] [ 1] /home/jumper/upside/py/../obj/libupside.so(_ZN13BackbonePairs13compute_valueE11ComputeMode+0x5e1)[0x7fdb7328c571]
[midway2-0015:35095] [ 2] /home/jumper/upside/py/../obj/libupside.so(_ZN11DerivEngine7computeE11ComputeMode+0x4c9)[0x7fdb73277a59]
[midway2-0015:35095] [ 3] /home/jumper/upside/py/../obj/libupside.so(evaluate_energy+0x65)[0x7fdb73202ba5]
[midway2-0015:35095] [ 4] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/python2.7/lib-dynload/_ctypes.so(ffi_call_unix64+0x4c)[0x7fdb5280e15a]
[midway2-0015:35095] [ 5] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/python2.7/lib-dynload/_ctypes.so(ffi_call+0x153)[0x7fdb5280cd33]
[midway2-0015:35095] [ 6] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/python2.7/lib-dynload/_ctypes.so(_ctypes_callproc+0x277)[0x7fdb528042b7]
[midway2-0015:35095] [ 7] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/python2.7/lib-dynload/_ctypes.so(+0x9b52)[0x7fdb527fab52]
[midway2-0015:35095] [ 8] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fdb86be79a3]
[midway2-0015:35095] [ 9] /software/python_ucs4-2.7.13-el7-x86_64+gcc-6.2/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x55ed)[0x7fdb86c9df7d]
感謝您的信息。如果有其他人絆倒在這,disas/m不贊成disas/s,這在存在大量內聯的情況下效果更好。 –