GNOME Bugzilla – Bug 735389
client crashes if it gets an invalid keymap from the compositor
Last modified: 2014-08-26 11:05:15 UTC
If the client is given a keymap string which produces compile errors, xkb_keymap_new_from_string() returns NULL and the xkb_state creation crashes when given a NULL keymap. I'm attaching a patch that, in these situations, issue a warning and keep the previous keymap/state around, since having instances of those is indispensable for keyboard events, even if not fully correct.
Created attachment 284408 [details] [review] wayland: Protect against invalid keymaps gotten from the compositor If the compositor sends a keymap that fails on "compilation", xkb_keymap_new_from_string() returns NULL, which makes xkb_state_new() crash when assuming there is a keymap. In these cases, gdk must remain with a xkb_state to handle modifiers/keys properly, so warn about the invalid keymap string, and keep the previous keymap (currently initialized to "us")
Do you have an example for a keymap string that fails during complication ?
Created attachment 284446 [details] keymap string Might be something in my setup... I just have xkbcomp on /usr/bin, not sure if there's been changes around. I also only see this running mutter --wayland nested. this anyway deserves further investigation.
Created attachment 284447 [details] stderr during on xkb_keymap_new_from_string()
Review of attachment 284408 [details] [review]: looks ok as a defensive measure
Attachment 284408 [details] pushed as 8f2d8df - wayland: Protect against invalid keymaps gotten from the compositor