Bug 176154

Summary: [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, clopez
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=787069
Attachments:
Description Flags
Patch
none
Patch clopez: review+

Carlos Garcia Campos
Reported 2017-08-31 02:43:54 PDT
I think this is actually a GTK+ bug (I'll file a bug report), but in Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11 backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime it's easy to workaround by also checking n_keys > 0.
Attachments
Patch (8.92 KB, patch)
2017-08-31 02:47 PDT, Carlos Garcia Campos
no flags
Patch (8.92 KB, patch)
2017-08-31 02:55 PDT, Carlos Garcia Campos
clopez: review+
Carlos Garcia Campos
Comment 1 2017-08-31 02:47:51 PDT
Carlos Garcia Campos
Comment 2 2017-08-31 02:55:24 PDT
Carlos Garcia Campos
Comment 3 2017-08-31 07:07:23 PDT
Note You need to log in before you can comment on or make changes to this bug.