SIGABRT due double free



Hi, I'll try to explain my problem as clear as possible:

I'm developing a gtk/gnome application with two threads. An schema of
the application is this:

void thread_func(){
blah
blah
...
}

main(){
blah
blah
...

pthread_create(thread_func);
...
...

gtk_main();
}

thread_func is updating data periodically with a sleep pause.
At this point, I suppose the other thread is catching events normally
(in fact, tabs of the notebook changes without problems). Well, at
short time from run app, I get:

*** glibc detected *** double free or corruption (!prev): 0x00000000006115a0 ***
Program received signal SIGABRT, Aborted.

or

*** glibc detected *** realloc(): invalid size: 0x00000000006122e0 ***
Program received signal SIGABRT, Aborted.

The curious thing is that I _have not_ any free, realloc or malloc in
my code, only those that gtk/glib functions like g_file_get_contents
can perform.

In fact, debugging with gdb and typing a bt after crash, I get:
#0  0x0000002a97ebb4dd in raise () from /lib64/tls/libc.so.6
#1  0x0000002a97ebcc8e in abort () from /lib64/tls/libc.so.6
#2  0x0000002a97eefb41 in __libc_message () from /lib64/tls/libc.so.6
#3  0x0000002a97ef546f in _int_free () from /lib64/tls/libc.so.6
#4  0x0000002a97ef5a06 in free () from /lib64/tls/libc.so.6
#5  0x0000002a9715540f in gdk_region_union ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#6  0x0000002a9715ac19 in gdk_window_invalidate_maybe_recurse ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#7  0x0000002a9715aebc in gdk_window_invalidate_rect ()
   from /usr/lib64/libgdk-x11-2.0.so.0
#8  0x0000002a96e4ecf5 in gtk_notebook_new ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#9  0x0000002a96e50fb8 in gtk_notebook_get_tab_label ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#10 0x0000002a96e5177d in gtk_notebook_get_tab_label ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#11 0x0000002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#12 0x0000002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#13 0x0000002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#14 0x0000002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#15 0x0000002a96f2af07 in gtk_widget_size_allocate ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#16 0x0000002a96f208a5 in gtk_vbox_new () from /usr/lib64/libgtk-x11-2.0.so.0
#17 0x0000002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#18 0x0000002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#19 0x0000002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#20 0x0000002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#21 0x0000002a96f2af07 in gtk_widget_size_allocate ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#22 0x0000002a96f353b9 in gtk_window_reshow_with_initial_size ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#23 0x0000002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#24 0x0000002a979d9b30 in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#25 0x0000002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#26 0x0000002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#27 0x0000002a96f2af07 in gtk_widget_size_allocate ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib64/libgtk-x11-2.0.so.0
#28 0x0000002a96f371d8 in gtk_window_get_position ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#29 0x0000002a979c4faa in g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#30 0x0000002a979d9ebc in g_signal_has_handler_pending ()
   from /usr/lib64/libgobject-2.0.so.0
#31 0x0000002a979dbcd6 in g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#32 0x0000002a979dc023 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#33 0x0000002a96dc4403 in gtk_container_check_resize ()
   from /usr/lib64/libgtk-x11-2.0.so.0
#34 0x0000002a97d2a606 in g_main_context_dispatch ()
   from /usr/lib64/libglib-2.0.so.0
#35 0x0000002a97d2c21e in g_main_context_acquire ()
   from /usr/lib64/libglib-2.0.so.0
#36 0x0000002a97d2c58a in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#37 0x0000002a96e39471 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#38 0x0000000000406209 in main (argc=1, argv=0x7fbffff798) at main.c:121

am I doing something wrong? I don't know what to do.
I have:

glib2-2.4.7-1
glibc-2.3.4-2
gtk2-2.4.13-14
gtk-engines-0.12-5

Any ideas?

PS: I'm so, so sorry for this terrible long mail.



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