GNOME Bugzilla – Bug 787422
Crashes trying to set keyboard map when logging into Wayland session
Last modified: 2018-08-08 06:07:22 UTC
Fedora 26 and Wayland here. gnome-shell kept crashing while trying to log in. A few failed attempts, reboots and dnf update later it managed to get in. I have: gnome-shell-3.24.3-1.fc26.x86_64 mutter-3.24.4-1.fc26.x86_64 gjs-1.48.6-2.fc26.x86_64 libxkbcommon-0.7.1-3.fc26.x86_64 I have a British keyboard so my default layout is English (UK). I also have the Bengali (probhat (m17n)) input source configured, if that matters. Looks like clutter_evdev_set_keyboard_map is being called with a NULL keymap. Backtrace: Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 237939
Thread 10 (Thread 0x7f9329b91700 (LWP 1742))
Thread 8 (Thread 0x7f932a392700 (LWP 1741))
Thread 5 (Thread 0x7f932ab93700 (LWP 1739))
Thread 1 (Thread 0x7f939f047ac0 (LWP 1482))
(In reply to Debarshi Ray from comment #0) > Looks like clutter_evdev_set_keyboard_map is being called with a NULL keymap. And that's because xkb_keymap_new_from_names is returning a NULL keymap. The backtrace shows values of the local variables.
Created attachment 359379 [details] [review] clutter/evdev: Handle NULL keymap Callers may (intentionally or unintentionally) pass in a NULL keymap, handle this case gracefully instead of crashing.
Created attachment 359380 [details] [review] backend-native: Handle keymap lookup failure xkb_keymap_new_from_names() may return NULL - handle this case by leaving the keymap unset instead of crashing.
Only compile-tested, but should take care of the crash. Although I have honestly no idea what happens with no keymap set ...
I have no clue why xkb_keymap_new_from_names is returning NULL. I have applied them locally against my system's copy of mutter. Let's see what happens.
There will be error messages in the journal from libxkbcommon with where it failed. The other bugs that are the same as this has had seemingly valid input, and I have not yet grasped why libxkbcomon fails to load the keymap. We should probably handle this returning NULL, but add a g_warning() when it happens, and probably leave the layout to what it was before, so that at least keyboard input works at all. I suspect get_keymap() returning NULL will cause issues elsewhere.
libxkbcommon failed again with a NULL keymap and led to a slightly different crash: Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 237952
Thread 14 (Thread 0x7fe25bbc6700 (LWP 1708))
Thread 1 (Thread 0x7fe2cb4bdac0 (LWP 1487))
My journal says: org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: Couldn't find file "rules/evdev" in include paths org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: 1 include paths searched: org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: /usr/share/X11/xkb org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: 1 include paths could not be added: org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: /home/rishi/.xkb org.gnome.Shell.desktop[1487]: xkbcommon: ERROR: Couldn't look up rules 'evdev', model 'pc105+inet', layout 'gb,us', variant ',', options ''
Also happens on Fedora 27 with: gnome-shell-3.26.1-1.fc27.x86_64 mutter-3.26.1-2.fc27.x86_64 gjs-1.50.1-1.fc27.x86_64 libxkbcommon-0.7.1-5.fc27.x86_64 This is a different laptop with the default layout being English (US). I also have the Bengali (probhat (m17n)) input source and a Czech layout configured. Same backtrace, but slightly different journal entries due to having different layouts: org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: Couldn't find file "rules/evdev" in include paths org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: 1 include paths searched: org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: /usr/share/X11/xkb org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: 1 include paths could not be added: org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: /home/rishi/.xkb org.gnome.Shell.desktop[1682]: xkbcommon: ERROR: Couldn't look up rules 'evdev', model 'pc105+inet', layout 'us,cz,us', variant ',,', options ''
(In reply to Debarshi Ray from comment #0) > Fedora 26 and Wayland here. gnome-shell kept crashing while trying to log > in. A few failed attempts, reboots and dnf update later it managed to get in. > The same backtrace is also a crasher on GNOME 3.24 and 3.22. Redhat Bugzilla has more details: https://bugzilla.redhat.com/show_bug.cgi?id=1398142 https://bugzilla.redhat.com/show_bug.cgi?id=1398128 https://bugzilla.redhat.com/show_bug.cgi?id=1441490 https://bugzilla.redhat.com/show_bug.cgi?id=1507656 (only the last one is on GNOME 3.26). And one of these has a reference to https://bugzilla.gnome.org/show_bug.cgi?id=782688 , which seems to be a duplicate.
Also happens on Fedora 28 with: gnome-shell-3.28.3-1.fc28.x86_64 mutter-3.28.3-3.fc28.x86_64 gjs-1.52.3-1.fc28.x86_64 libxkbcommon-0.8.0-5.fc28.x86_64 (gdb) thread apply all bt
+ Trace 238674
Thread 16 (Thread 0x7f13b886f700 (LWP 1680))
Thread 15 (Thread 0x7f138530e700 (LWP 2035))
Thread 12 (Thread 0x7f1395822700 (LWP 1979))
Thread 1 (Thread 0x7f13dd890240 (LWP 1668))
*** This bug has been marked as a duplicate of bug 782688 ***