After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695254 - Segfault in key_hash_insert_entry() in gtkkeyhash.c when using non-us keyboard layout
Segfault in key_hash_insert_entry() in gtkkeyhash.c when using non-us keyboar...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-05 22:33 UTC by Rune Svendsen
Modified: 2013-03-31 18:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Backtrace (14.38 KB, text/x-log)
2013-03-05 22:33 UTC, Rune Svendsen
Details
baobab console output (4.58 KB, text/x-log)
2013-03-05 23:01 UTC, Rune Svendsen
Details
backtrace from executable build with -O0 (16.19 KB, text/x-log)
2013-03-06 22:47 UTC, Rune Svendsen
Details

Description Rune Svendsen 2013-03-05 22:33:00 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)):

  • #0 gdk_keymap_get_entries_for_keyval
    at gdkkeys.c line 428
  • #1 key_hash_insert_entry
    at gtkkeyhash.c line 65
  • #2 key_hash_get_keycode_hash
    at gtkkeyhash.c line 94

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
Comment 1 Rune Svendsen 2013-03-05 22:54:15 UTC
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.
Comment 2 Rune Svendsen 2013-03-05 23:01:25 UTC
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.
Comment 3 Rune Svendsen 2013-03-05 23:01:51 UTC
Created attachment 238173 [details]
baobab console output
Comment 4 Rune Svendsen 2013-03-06 19:58:38 UTC
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
Comment 5 Rune Svendsen 2013-03-06 22:47:37 UTC
Created attachment 238258 [details]
backtrace from executable build with -O0
Comment 6 Rune Svendsen 2013-03-06 23:04:25 UTC
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.
Comment 7 Rob Bradford 2013-03-28 12:24:02 UTC
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.
Comment 8 Rune Svendsen 2013-03-31 18:09:21 UTC
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.