Re: Equivalent of the gtk g_object_ref/unref functions in gtkmm?



Murray Cumming wrote:
On Mon, 2007-03-26 at 16:30 +0200, Jef Driesen wrote:
Jonathon Jongsma wrote:
On 3/26/07, Jef Driesen <jefdriesen hotmail com> wrote:
The application works fine, but closing the main window results in a
segmentation fault (core dump). As far as I can tell (from a gdb
backtrace) the crash is not in my own code, but somewhere inside the
gtk(mm) library.
Could you provide the backtrace?  that might be helpful information.
Sometimes I don't get the segmentation fault, but only a large number of errors. See attachment for both the backtrace and the errors.

If you get glib errors, try debuggin with --g-fatal-warnings, or with a
breakpoing on g_log. Then you'll get a backtrace at the relevant point.

Backtrace attached, although it doesn't seem to provide much more information to me.

valgrind's memcheck is also incredibly helpful. Trust us on this. You
won't regret trying it.

I get lots of errors from valgrind, but I also get them for the trivial program

int main (int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);
    Gtk::Window window;
    kit.run(window);
    return 0;
}

But to be honest I never used valgrind before, so I could be using it wrong.
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb713a770 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb713bef3 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb73de122 in g_logv () from /usr/lib/libglib-2.0.so.0
#4  0xb73de159 in g_log () from /usr/lib/libglib-2.0.so.0
#5  0xb746818c in g_type_check_instance () from /usr/lib/libgobject-2.0.so.0
#6  0xb7465688 in g_signal_handlers_disconnect_matched ()
   from /usr/lib/libgobject-2.0.so.0
#7  0xb78741d1 in IA__gtk_accel_label_set_accel_closure (accel_label=0x18, 
    accel_closure=0x0) at gtkaccellabel.c:454
#8  0xb78743eb in IA__gtk_accel_label_set_accel_widget (accel_label=0x80d1930, 
    accel_widget=0x0) at gtkaccellabel.c:392
#9  0xb78744ca in gtk_accel_label_destroy (object=0x80d1930)
    at gtkaccellabel.c:201
#10 0xb745bb29 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#11 0xb744cfb9 in g_value_set_boxed () from /usr/lib/libgobject-2.0.so.0
#12 0xb744e87d in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#13 0xb745f34f in g_signal_chain_from_overridden ()
   from /usr/lib/libgobject-2.0.so.0
#14 0xb74600b7 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#15 0xb7460279 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#16 0xb79780f1 in gtk_object_dispose (gobject=0x80d1930) at gtkobject.c:418
---Type <return> to continue, or q <return> to quit--- 
#17 0xb7a72d41 in gtk_widget_dispose (object=0x80d1930) at gtkwidget.c:6883
#18 0xb7450e30 in g_object_run_dispose () from /usr/lib/libgobject-2.0.so.0
#19 0xb7977dfe in IA__gtk_object_destroy (object=0x80d1930) at gtkobject.c:403
#20 0xb7a72f25 in IA__gtk_widget_destroy (widget=0x80d1930) at gtkwidget.c:2168
#21 0xb796194a in gtk_menu_item_forall (container=0x8089e08, 
    include_internals=0, callback=0xb7a72ee0 <IA__gtk_widget_destroy>, 
    callback_data=0x0) at gtkmenuitem.c:1478
#22 0xb7934031 in gtk_image_menu_item_forall (container=0x8089e08, 
    include_internals=0, callback=0xb7a72ee0 <IA__gtk_widget_destroy>, 
    callback_data=0x0) at gtkimagemenuitem.c:350
#23 0xb7e149eb in Gtk::Container_Class::forall_vfunc_callback ()
   from /usr/lib/libgtkmm-2.4.so.1
#24 0x08089e08 in ?? ()
#25 0x00000000 in ?? ()


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