GNOME Bugzilla – Bug 695254
Segfault in key_hash_insert_entry() in gtkkeyhash.c when using non-us keyboard layout
Last modified: 2013-03-31 18:09:21 UTC
Created attachment 238168 [details] Backtrace When running baobab using the Wayland GDK backend (gtk+ git), I get these errors in the terminal: (baobab:12603): Gdk-CRITICAL **: gdk_keymap_get_entries_for_keyval: assertion `GDK_IS_KEYMAP (keymap)' failed They repeat several times, and when I try to move the window using the MOD+mouse click and drag, a segfault happens with relation to the above error (it happens as soon as I press the MOD button (ie. the Super/Windows button on my keyboard)):
+ Trace 231597
I'm attaching the full backtrace to this bug report. Visually, there's not much to see, everything looks like it should: http://i.imgur.com/7MFTmPb.jpg
Upon further testing, I can see that this only happens when both the X11 and Wayland backend are enabled simultaneously. Passing --disable-x11-backend to configure makes this problem disappear.
Although when I disable the x11 backend, I *mostly* avoid segfaults, the "`GDK_IS_KEYMAP (keymap)' failed" messages are still printed to the console. I'm attaching the output of baobab.
Created attachment 238173 [details] baobab console output
The segfault only happens when I use a non-us keyboard layout. If I add the following to ~/.config/weston.ini [keyboard] keymap_layout=dk I get the segfault. Also, upon further testing, the bug *is* still present with the X11 backend disabled. It looks like the entry->keys pointer in key_hash_insert_entry is NULL. (gdb) print entry->keys $2 = (GdkKeymapKey *) 0x0
Created attachment 238258 [details] backtrace from executable build with -O0
I just found the following in the "Known issues" section of http://wayland.freedesktop.org/gtk.html "The keyboard is hardcoded (US pc105) for the keycode mapping. This can be resolved when there is a mechanism in Wayland communicating preferred keyboard map." So this is probably the reason I'm seeing this bug. Although I'd still say it's a bug, since a segfault is occurring.
Hi Rune, i've tried quite hard to reproduce this bug, including setting my keyboard to Danish. Can you see if it's still a problem for you with the current master. Lots of changes have gone into GTK+ right now.
Hi Rob, I just tested it with GTK master and it works perfectly now! With CSDs and everything :). This is great! I'm closing this bug.