PDA

View Full Version : KDevelop + QT + GDB = Application received SIGTRAP



GodOfWar
28th April 2008, 22:13
Hi there!
I migrated from Kubuntu to Arch Linux a few days ago and I got back to work on some of my projects.
I'm programming an application which uses QT 4.3.3 with KDevelop and it runs
just fine but when I try to debug it I always get an error message saying
"Program received signal SIGTRAP" and after that the debugger (gdb) stops responding
without giving any further error messages. I don't think it's an application source problem
since on KUbuntu I could debug everything without any problem.

I noticed that if I start gdb from the command line to do the same operations
the program flows without problems but if I use kdevelop or kdbg I got the errors.
Why doesn't gdb work in Kdevelop? Do I have to configure something?
Thx for your help

PS. The program in built in debug mode.

PS2. Here is the error taken from the gdb window in kdevelop
Program received signal SIGTRAP, Trace/breakpoint trap.
0xb7f67d81 in malloc () from /lib/ld-linux.so.2
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (malloc) will be abandoned.

GodOfWar
28th April 2008, 22:25
In the attachment there is the complete gdb output as seen in Kdevelop and here is the backtrace after the error


#0 0xb7fd32de in __i686.get_pc_thunk.bx () from /lib/ld-linux.so.2
#1 0xb7fd1d89 in malloc () from /lib/ld-linux.so.2
#2 <function called from gdb>
#3 0xb7fd1d81 in malloc () from /lib/ld-linux.so.2
#4 <function called from gdb>
#5 0xb7fd1d81 in malloc () from /lib/ld-linux.so.2
#6 <function called from gdb>
#7 0xb7fd1d81 in malloc () from /lib/ld-linux.so.2
#8 <function called from gdb>
#9 CFDInventario::AvviaRicerca (this=0x816eaa0) at CFDInventario.cpp:132
#10 0x08096f27 in CFDInventario::qt_metacall (this=0x816eaa0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xbfb6846c) at moc_CFDInventario.cpp:71
#11 0xb73a6616 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#12 0xb73a6950 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#13 0xb7cc8891 in QAbstractButton::clicked () from /usr/lib/libQtGui.so.4
#14 0xb7a7af59 in ?? () from /usr/lib/libQtGui.so.4
#15 0xb7a7ccd0 in ?? () from /usr/lib/libQtGui.so.4
#16 0xb7a7cf2b in QAbstractButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#17 0xb77cd58c in QWidget::event () from /usr/lib/libQtGui.so.4
#18 0xb7a7bbbf in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#19 0xb7b15092 in QPushButton::event () from /usr/lib/libQtGui.so.4
#20 0xb77829ed in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#21 0xb7785644 in QApplication::notify () from /usr/lib/libQtGui.so.4
#22 0xb739380b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#23 0xb77e1ec2 in QETWidget::translateMouseEvent () from /usr/lib/libQtGui.so.4
#24 0xb77e155a in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#25 0xb7805eb4 in ?? () from /usr/lib/libQtGui.so.4
#26 0xb71e0f88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#27 0xb71e44eb in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#28 0xb71e4668 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#29 0xb73b8762 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#30 0xb7805ce5 in ?? () from /usr/lib/libQtGui.so.4
#31 0xb7392bf2 in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#32 0xb7392cfa in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#33 0xb7b8903a in QDialog::exec () from /usr/lib/libQtGui.so.4
#34 0x0804fb90 in CFDListWindow::NuovoPersonaggio (this=0xbfb6a1e0) at CFDListWindow.cpp:55
#35 0x08096bbd in CFDListWindow::qt_metacall (this=0xbfb6a1e0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfb695dc) at moc_CFDListWindow.cpp:64
#36 0xb73a6616 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#37 0xb73a6950 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#38 0xb7cc8891 in QAbstractButton::clicked () from /usr/lib/libQtGui.so.4
#39 0xb7a7af59 in ?? () from /usr/lib/libQtGui.so.4
#40 0xb7a7ccd0 in ?? () from /usr/lib/libQtGui.so.4
#41 0xb7a7cf2b in QAbstractButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#42 0xb77cd58c in QWidget::event () from /usr/lib/libQtGui.so.4
#43 0xb7a7bbbf in QAbstractButton::event () from /usr/lib/libQtGui.so.4
#44 0xb7b15092 in QPushButton::event () from /usr/lib/libQtGui.so.4
#45 0xb77829ed in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#46 0xb7785644 in QApplication::notify () from /usr/lib/libQtGui.so.4
#47 0xb739380b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#48 0xb77e1ec2 in QETWidget::translateMouseEvent () from /usr/lib/libQtGui.so.4
#49 0xb77e155a in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#50 0xb7805eb4 in ?? () from /usr/lib/libQtGui.so.4
#51 0xb71e0f88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#52 0xb71e44eb in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#53 0xb71e4668 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#54 0xb73b8762 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#55 0xb7805ce5 in ?? () from /usr/lib/libQtGui.so.4
#56 0xb7392bf2 in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#57 0xb7392cfa in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#58 0xb73951fd in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#59 0xb7781f67 in QApplication::exec () from /usr/lib/libQtGui.so.4
#60 0x0804f318 in main (argc=1, argv=0xbfb6a2f4) at main.cpp:41

wysota
28th April 2008, 23:52
SIGTRAP is not an error. It's a signal used by debuggers - they can't work without it. Your KDevelop or GDB must be misconfigured. GDB is telling you what you should do - "set unwindonsignal on", you probably need to set it in GDB's settings file.

GodOfWar
29th April 2008, 07:11
SIGTRAP is not an error. It's a signal used by debuggers - they can't work without it. Your KDevelop or GDB must be misconfigured. GDB is telling you what you should do - "set unwindonsignal on", you probably need to set it in GDB's settings file.

I already tried to "set unwindonsignal on" but after a few steps the program crashes. I also tried to install the latest GDB from source but no luck even this way.
I read it could be a kernel issue. This evening I'll try to install the latest vanilla kernel and see what happens. However, how can I completely reset Kdevelop configuration? What files should I delete?

And, I don't know if the problems are related, but if I try to compile a simple hello world application written in C++ Kdevelop hangs on "linking using libtool" and after that the CPU and memory loads explode and the whole system almost crashes. Any additional information from this behavior?

wysota
29th April 2008, 08:56
I already tried to "set unwindonsignal on" but after a few steps the program crashes.

Which program? KDevelop, GDB or your application?

GodOfWar
29th April 2008, 13:05
Which program? KDevelop, GDB or your application?

I've been imprecise.
After a few steps over, the variables of the application assumes impossible values (in a just declared QString I found the error message "Application received the SIGTRAP signal"!!) and of course after a few operations my application doesn't behave as expected (I use that QString as a search string for a DB). I'm compiling the new kernel now.

wysota
29th April 2008, 15:33
What does the kernel have to do with it? Maybe your application's stack simply got messed up...

GodOfWar
29th April 2008, 19:59
SOLVED.

It seems that Arch Linux default kernel (I think it is 2.6.24-ARCH) is bugged or something because I just installed the new vanilla kernel 2.6.25 and everything works as expected.
Thx for your help guys.