GNOME Bugzilla – Bug 477454
libgtk crashed in gtk_notebook_button_release
Last modified: 2014-12-22 16:26:07 UTC
Steps to reproduce: This bug can be reproduced using aMule on an up-to-date Gutsy box. 1. Open aMule 2. Connect to any server you like 3. Press Search button, insert a string and press Start 4. Close the search tab that will open as fast as possible Stack trace:
+ Trace 163301
Other information: GDB output: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1233463616 (LWP 6035)] 0xb6d92050 in gtk_notebook_button_release (widget=0x8837228, event=0x88c2810) at /build/buildd/gtk+2.0-2.11.6/gtk/gtknotebook.c:2808 2808 if (!priv->during_detach && (gdb) list 2803 2804 notebook = GTK_NOTEBOOK (widget); 2805 priv = GTK_NOTEBOOK_GET_PRIVATE (notebook); 2806 page = notebook->cur_page; 2807 2808 if (!priv->during_detach && 2809 page->reorderable && 2810 event->button == priv->pressed_button) 2811 gtk_notebook_stop_reorder (notebook); 2812 (gdb) Additional informations can be found here: https://launchpad.net/bugs/84306
Created attachment 98098 [details] [review] Check pointers before deferencing them Attached patch fixes this issue for me.
priv cannot be NULL, but it makes sense to check page.
This seems indeed related to priv being NULL, it seems so looking at gdb output.
Created attachment 125166 [details] [review] Don't crash in button release event handler when the notebook is empty I think this is a bug in GTK, given that we check cur_page != NULL in motion_event. For more details see http://www.amule.org/amule/index.php?topic=16254.0 Dear Mr. Classen, could you apply this patch. This will fix a big number of crashes in aMule. If you think this is a wxWidget issue tell so and close this report, we however think this is a GTK+ issue based on the motion_event code. Thanks
This crash has also occured for the gtk client of Freeciv: http://bugs.freeciv.org/Ticket/Display.html?id=40743 I made a workaround that appears to avoid the crash (it eats the button release event when the notebook has no pages), but I would agree with the previous posters that just adding a simple NULL pointer check for notebook-> cur_page in gtk_notebook_button_release() would be a much simpler solution.