After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755432 - gtkapplication: segfault when destroying window
gtkapplication: segfault when destroying window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.18.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-09-22 18:07 UTC by Lionel Landwerlin
Modified: 2015-09-23 22:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk: gtkapplication: fix segfault (2.25 KB, patch)
2015-09-22 18:07 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2015-09-22 18:07:21 UTC
Just spotted a segfault when destroying a GtkWindow after calling
g_application_quit() :

Process terminating with default action of signal 11 (SIGSEGV)
 Access not within mapped region at address 0x0
 at 0x5158770: gtk_application_impl_window_removed (gtkapplicationimpl.c:97)
 by 0x5155AEF: gtk_application_window_removed (gtkapplication.c:723)
 by 0xAA5DD32: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:2102)
 by 0xAA5B083: _g_closure_invoke_va (gclosure.c:864)
 by 0xAA75260: g_signal_emit_valist (gsignal.c:3272)
 by 0xAA758B1: g_signal_emit (gsignal.c:3419)
 by 0x53D7580: gtk_window_release_application (gtkwindow.c:3447)
 by 0x53E4BCB: gtk_window_destroy (gtkwindow.c:5690)
Comment 1 Lionel Landwerlin 2015-09-22 18:07:26 UTC
Created attachment 311896 [details] [review]
gtk: gtkapplication: fix segfault

When destroying a window associated with a GtkApplication after calling
g_application_quit() you might get the following segfault :

Process terminating with default action of signal 11 (SIGSEGV)
 Access not within mapped region at address 0x0
   at 0x5158770: gtk_application_impl_window_removed (gtkapplicationimpl.c:97)
   by 0x5155AEF: gtk_application_window_removed (gtkapplication.c:723)
   by 0xAA5DD32: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:2102)
   by 0xAA5B083: _g_closure_invoke_va (gclosure.c:864)
   by 0xAA75260: g_signal_emit_valist (gsignal.c:3272)
   by 0xAA758B1: g_signal_emit (gsignal.c:3419)
   by 0x53D7580: gtk_window_release_application (gtkwindow.c:3447)
   by 0x53E4BCB: gtk_window_destroy (gtkwindow.c:5690)

This patch stops listening to window events once the GtkApplication is
shutdown.
Comment 2 Matthias Clasen 2015-09-23 18:38:28 UTC
Pushed a different fix