GNOME Bugzilla – Bug 754979
gnome-shell-3.16.3 segfault on start
Last modified: 2015-09-25 17:31:58 UTC
This is a big problem on some of the machines I handle as, for some reason, gnome-shell crashes as soon as it starts and, then, gnome 3.16 is unusable on them (while 3.14 had no problem at all). This is reported downstream at: https://bugs.gentoo.org/show_bug.cgi?id=560330 And other similar reports look to be: https://bugzilla.redhat.com/show_bug.cgi?id=1154329 https://bugzilla.redhat.com/show_bug.cgi?id=1259052 The backtrace is: [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/usr/bin/gnome-shell'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 235440
Thread 1 (Thread 0x7f3df1e99980 (LWP 817))
Other collected backtrace: [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/usr/bin/gnome-shell'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 235441
Thread 1 (Thread 0x7ff0ba810980 (LWP 31770))
[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/usr/bin/gnome-shell'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 235442
Thread 1 (Thread 0x7f14db982980 (LWP 24439))
Created attachment 311275 [details] [review] workaround patch for mutter Pacho saw the following in the logs: > sep 14 10:53:25 optiplex760 gnome-session[31409]: xkbcommon: ERROR: > xkb_x11_keymap_new_from_device: illegal device ID: -1 Which explains the direct cause of the crash: xkb_x11_keymap_new_from_device() returns NULL, so meta_backend_get_keymap() will return NULL, and attempting to use a NULL keymap in most xkb_* function leads to a segfault. The mysteries are (1) why would xkb_x11_get_core_keyboard_device_id() return -1; and (2) what any of this has to do with mozjs or gnome-shell proper (Pacho states that he can prevent the segfault by recompiling mozjs with -fno-stack-protector in CFLAGS). In any case, the attached patch for mutter should in theory at least prevent the immediate cause of the segfault.
(In reply to Alexandre Rostovtsev from comment #3) [...] > (2) what any of this has to do with mozjs or gnome-shell proper (Pacho > states that he can prevent the segfault by recompiling mozjs with > -fno-stack-protector in CFLAGS). > It's the other order: - spidermonkey-24.2.0 compiled with -fno-stack-protector -> crash happens - spidermonkey-24.2.0 compiled with stack-protector -> gnome-shell works ok > In any case, the attached patch for mutter should in theory at least prevent > the immediate cause of the segfault. Sadly with the patch it still segfaults :(
Created attachment 311768 [details] [review] backend-x11: Fallback to a default keymap if getting it from X fails This shouldn't fail but apparently sometimes it does and in that case having a possibly wrong idea of the keymap is still better than crashing.
Review of attachment 311275 [details] [review]: Thanks for the diagnostic but I'd rather use a dummy keymap than doing this and possibly hitting issues further down the line because something isn't properly initialized.
Attachment 311768 [details] pushed as 9abc071 - backend-x11: Fallback to a default keymap if getting it from X fails