我有以下核心轉儲:
pth_signal.pthread_kill(??, ??) at 0xd0124734
pth_signal._p_raise(??) at 0xd01241a4
raise.raise(??) at 0xd038acd0
abort.abort() at 0xd03eeb78
_ZN10__cxxabiv111__terminateEPFvvE(handler = ??), line 47 in "eh_terminate.cc"
_ZSt9terminatev(), line 57 in "eh_terminate.cc"
__cxa_throw(obj = ??, tinfo = ??, dest = ??), line 77 in "eh_throw.cc"
unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"
unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"
unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"
_Znwm(sz = 4048060128), line 54 in "new_op.cc"
_Znam(sz = ??), line 36 in "new_opv.cc"
_ZN7PROFILEC1ERK6STRING(this = @0x2fe74398, iniFilename = @0x21973300), line 99 in "profile.cpp"
_ZN2IE17AppendToBDataListEP10BASKETDATA(this = @0x2130eb38, bd = 0x2fe7f000), line 2451 in "ie.cpp"
_ZN5DIEGO14HandleResponseEP10BASKETDATAPv(this = 0x2130eb38, bd = 0x2fe7f000, args = 0x2fe71d78), line 513 in "diegoclass.cpp"
_ZThn68_N5DIEGO14HandleResponseEP10BASKETDATAPv(0x2130eb7c, 0x2fe7f000, 0x2fe71d78), line 21 in "diegoclass.h"
_ZN8KOBJBASE8dispatchEiP10BASKETDATAPv(this = 0x2130eb7c, fcnidx = 12, bd = 0x2fe7f000, args = 0x2fe71d78), line 67 in "kobjbase.cpp"
_ZN6KERNEL8DispatchEPcS0_iP10BASKETDATAPvR4LISTI8KOBJBASEE(this = @0x2fe71d38, module = "diego", method = "HandleResponse", fcn_idx = 12, bd = 0x2fe7f000, args = 0x2fe71d78, thread_objects = @0xf156dd58), line 1118 in "skernel.cpp"
unnamed block in _ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"
unnamed block in _ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"
_ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"
unnamed block in _ZN6KERNEL22ProcessEnqueuedBasketsEP6BASKET(this = @0x2fe71d38, b = @0x2fe7ef68), line 1162 in "skernel.cpp"
如何使用核心轉儲來修復我遇到的崩潰?
答案1
首先,透過 運行該輸出c++filt
,它將 C++ 符號分解為人類可讀的、原始碼可交叉引用的輸出。
從那裡您可以看到 PROFILE 建構函數已被調用new[]
,這導致引發異常,而沒有處理程序(調用 std::terminate),這導致程式中止,產生核心轉儲。
您可以將呼叫包裝new[]
在一個try...catch
區塊中以查看異常是什麼。我記不清new[]
在什麼情況下會引發哪些異常,但new
失敗的原因之一是堆損壞,通常是由於覆蓋分配或 double 的邊界delete
。
valgrind
您可以使用(免費)或purify
(商業,假設它仍然存在 - 我上次使用它是在 15 年前)之類的程式來診斷這些記憶體錯誤。valgrind
這將會是一個好的開始,它會告訴你你對上述表格的記憶錯誤。
您可以更深入地使用核心轉儲gdb
來檢查程式崩潰時的記憶體映像,但這裡沒有人可以真正幫助您 - 您需要知道程式碼的結構以及預期的記憶體佈局與此有關。