Re: Crash in Gtk:Main::run (callback/signal problem)



Dunge wrote:
Hi!

We are creating an application using GTKMM. We are using a lot of
Gtk::Button and Gtk::DrawingArea controls and connecting expose_event() and
button_press_event() on them using standard gtkmm code. Application works
fine and react as wanted. Unfortunately, we noticed some random crash a
while ago, and since release is near I was assigned to fix them. I don't
know exactly what cause the crash, but if I click on every button randomly
the fastest I can for 2-3 minutes, it always crash with the same problem.

Here is the callstack:
#0  0xb7fc8410 in __kernel_vsyscall ()
#1  0xb71c2085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb71c3a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb746311a in g_logv () from /usr/lib/libglib-2.0.so.0
#4  0xb7463159 in g_log () from /usr/lib/libglib-2.0.so.0
#5  0xb7b56416 in Glib::exception_handlers_invoke () from
/usr/lib/libglibmm-2.4.so.1
#6  0xb7ea5cdb in Gtk::Widget_Class::button_press_event_callback () from
/usr/lib/libgtkmm-2.4.so.1
#7  0xb78f18d4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#8  0xb74f3069 in ?? () from /usr/lib/libgobject-2.0.so.0
#9  0xb74f4749 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#10 0xb750910a in ?? () from /usr/lib/libgobject-2.0.so.0
#11 0xb750a937 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#12 0xb750af59 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#13 0xb7a10667 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#14 0xb78eab21 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#15 0xb78ebe92 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#16 0xb7644a9a in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#17 0xb7459cf6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0xb745d0b3 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0xb745d497 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#20 0xb78ec264 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#21 0xb7e26307 in Gtk::Main::run_impl () from /usr/lib/libgtkmm-2.4.so.1
#22 0xb7e2716a in Gtk::Main::run () from /usr/lib/libgtkmm-2.4.so.1
#23 0x08054a42 in main (argc=1, argv=0xbfc8f634) at main.cpp:113

As you can see, debug break in Gtk::Main::run(). Judging from the stack at
#6, it have something to do with
Gtk::Widget_Class::button_press_event_callback. Since every callback we have
works fine, I wonder what it could be. Is there a problem is we manage to
click 2 buttons with callback in the same gtk iteration? Can this be some
gtk multi-thread problem? We only use one for the UI.

Something in your button press event handler appears to be throwing an exception. It is not allowed to throw exceptions in signal handlers because the stack cannot be un-wound through C code. You need to make sure that you handle all exceptions thrown in signal handlers or your application will abort. Try putting a breakpoint on a thrown exception (in gdb: "catch throw") if you don't know what is throwing the exception.

--
jonner


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]