GNOME Bugzilla – Bug 596977
Regression : 2.18.1 crashes nautilus
Last modified: 2014-08-30 06:40:13 UTC
gtk+ 2.18.1 is crashing when starting nautilus. This is a regression compared to 2.18.0 : Program received signal SIGSEGV, Segmentation fault. 0xb7b8ca90 in _gdk_x11_window_tmp_reset_bg (window=0x98d6800, recurse=1) at gdkwindow-x11.c:253 253 xpixmap = GDK_DRAWABLE_XID (obj->bg_pixmap);
+ Trace 217988
after investigation, it appears to be triggered if gdkwindow-x11.c is compiled with -fomit-frame-pointer
And it does not crash when replacing GDK_DRAWABLE_XID with GDK_WINDOW_XID
FWIW, I'm seeing the same issue on openSUSE and, hrm, it makes GDM crash too, which is quite a big issue ;-) Confirming that compiling without -fomit-frame-pointer fixes it.
(note that 2.18.0 was also crashing here)
if removing -fomit-frame-pointer helps, it is probably uninitialized memory somewhere. run in valgrind?
Yes I had run valgrind and it indeed reports some uninitialized memory in _gdk_x11_window_tmp_reset_bg, created by a stack allocation, but I had failed to find more
I looked at it again and indeed obj->bg_pixmap is not initialized
Created attachment 144876 [details] [review] Patch fixing the crash
This doesn't make sense to me. If you look at how tmp_unset_bg and tmp_reset_bg are used, we rely on the fact that we can set the bg_pixmap back on the window later on, so we can't clear that field there.
Hmm you are right, it should not be cleared and has many side-effects I'll investigate why it was not initialized in the first place in the specific cases where we have the crash
I investigated a bit more, and bg_pixmap is initialized actually It's its impl field which is not
closing old bugs
Err a patch is available for this bug fix for years: http://svnweb.mageia.org/packages/cauldron/gtk%2B2.0/current/SOURCES/gtk%2B-2.18.1-fixnautiluscrash.patch?revision=389214&view=markup
not going to make such changes in gtk2 at this point