2015-12-04 202 views
0

我正在看一個崩潰的程序,導致無用的(或似乎是)核心轉儲。我沒有編寫程序,但我試圖找出可能的原因。QThread轉儲核心

第一個奇怪的是,核心轉儲是在QThread之後命名的,而不是我的可執行文件本身。

然後回溯內,沒有暗示在節目本身的行號:

$ gdb acqui ../../appli/core.QThread.31667.1448795278 
[Thread debugging using libthread_db enabled] 
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 
Core was generated by `./acqui'. 
Program terminated with signal SIGABRT, Aborted. 
#0 0x00007fcf4a1ce107 in __GI_raise ([email protected]=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. 
(gdb) bt 
#0 0x00007fcf4a1ce107 in __GI_raise ([email protected]=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 
#1 0x00007fcf4a1cf4e8 in __GI_abort() at abort.c:89 
#2 0x00007fcf4aab9b3d in __gnu_cxx::__verbose_terminate_handler()() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
#3 0x00007fcf4aab7bb6 in ??() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
#4 0x00007fcf4aab7c01 in std::terminate()() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
#5 0x00007fcf4aab7e69 in __cxa_rethrow() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
#6 0x00007fcf4b8707db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#7 0x00007fcf4b764e99 in QThread::exec()() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#8 0x00007fcf4b76770f in ??() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#9 0x00007fcf4ad6c0a4 in start_thread (arg=0x7fcf0b7fe700) at pthread_create.c:309 
#10 0x00007fcf4a27f04d in clone() at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 
(gdb) info threads 
    Id Target Id   Frame 
    16 Thread 0x7fcf297fa700 (LWP 31676) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    15 Thread 0x7fcf28ff9700 (LWP 60474) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    14 Thread 0x7fcf08ff9700 (LWP 60516) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    13 Thread 0x7fcf0bfff700 (LWP 60513) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    12 Thread 0x7fcf3932c700 (LWP 60494) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    11 Thread 0x7fcf29ffb700 (LWP 60444) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    10 Thread 0x7fcf39b2d700 (LWP 31668) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    9 Thread 0x7fcf2affd700 (LWP 31673) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    8 Thread 0x7fcf2bfff700 (LWP 31671) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    7 Thread 0x7fcf38b2b700 (LWP 60432) syscall() at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 
    6 Thread 0x7fcf2a7fc700 (LWP 31674) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    5 Thread 0x7fcf4d4f9780 (LWP 31667) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    4 Thread 0x7fcf097fa700 (LWP 60430) [email protected]@GLIBC_2.3.2() 
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238 
    3 Thread 0x7fcf09ffb700 (LWP 31682) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
    2 Thread 0x7fcf0affd700 (LWP 31680) 0x00007fcf4a27650d in poll() at ../sysdeps/unix/syscall-template.S:81 
* 1 Thread 0x7fcf0b7fe700 (LWP 31679) 0x00007fcf4a1ce107 in __GI_raise ([email protected]=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 

我在茫然,從哪裏開始。這是使用QThread的問題嗎?還有別的嗎?我怎樣才能啓用更多(或更好的)調試信息?程序本身是用-g -ggdb編譯的。

+0

它是客戶端代碼。程序有一個運行事件回調的線程,看起來在線程中執行的一個插槽導致了一個不可恢復的錯誤(SIGABRT)。如果我有代碼,我會尋找調用'moveToThread'的對象,我會檢查它標記爲插槽的方法。 – UmNyobe

+0

'catch throw'(拋出異常時中斷)可能對你有幫助。 –

回答

0

這一部分:

#4 0x00007fcf4aab7c01 in std::terminate()() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
#5 0x00007fcf4aab7e69 in __cxa_rethrow() from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 

...意味着有問題的代碼重新拋出異常,但它也不例外處理程序。所以,運行時調用std::terminate

這是一個編程錯誤,但究竟該怎麼做取決於你的庫和程序 - 也許不會再扔,也許安裝一個最外面的異常處理程序和日誌信息等