RESOLVED FIXED Bug 163011
[GTK] UIProcess crashes when using Japanese IM
https://bugs.webkit.org/show_bug.cgi?id=163011
Summary [GTK] UIProcess crashes when using Japanese IM
Tomas Popela
Reported 2016-10-06 06:49:11 PDT
When writing any content with Japanese IM activated (ie. in the inspector's console, or in the contenteditable element), the UIProcess crashes.
Attachments
Proposed patch (5.15 KB, patch)
2016-10-06 06:57 PDT, Tomas Popela
no flags
Fix review comments (6.33 KB, patch)
2016-10-07 03:57 PDT, Tomas Popela
no flags
Fix crash (6.33 KB, patch)
2016-10-09 22:40 PDT, Tomas Popela
no flags
Tomas Popela
Comment 1 2016-10-06 06:57:49 PDT
Created attachment 290822 [details] Proposed patch
WebKit Commit Bot
Comment 2 2016-10-06 06:59:21 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Michael Catanzaro
Comment 3 2016-10-06 07:29:39 PDT
Comment on attachment 290822 [details] Proposed patch (Leaving cq+ for Carlos)
Carlos Garcia Campos
Comment 4 2016-10-06 08:24:22 PDT
Comment on attachment 290822 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=290822&action=review > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:709 > + // We need to copy the event as otherwise it could be destroyed before we > + // reach the lambda body. This could be a single line. > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:710 > + GdkEvent* event = gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent)); GUniquePtr<GdkEvent> event(gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent))); > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:711 > + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) { [priv, event = WTFMove(event)] With this, the lambda takes the ownership and you don't need to call gdk_event_free(). Maybe it's better to call this keyEvent and then you don't have to rename all other cases. > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:733 > + // We need to copy the event as otherwise it could be destroyed before we > + // reach the lambda body. > + GdkEvent* event = gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent)); > + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) { Ditto.
Tomas Popela
Comment 5 2016-10-06 08:30:42 PDT
Thank you Carlos for the feedback! (In reply to comment #4) > Maybe it's better to call this keyEvent and then you don't > have to rename all other cases. I would rename it as we don't want to have a GdkEventKey event and GdkEvent keyEvent..
Tomas Popela
Comment 6 2016-10-07 03:57:24 PDT
Created attachment 290920 [details] Fix review comments
WebKit Commit Bot
Comment 7 2016-10-07 05:06:52 PDT
Comment on attachment 290920 [details] Fix review comments Clearing flags on attachment: 290920 Committed r206909: <http://trac.webkit.org/changeset/206909>
WebKit Commit Bot
Comment 8 2016-10-07 05:06:56 PDT
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 9 2016-10-07 09:39:09 PDT
Re-opened since this is blocked by bug 163116
Carlos Garcia Campos
Comment 10 2016-10-07 09:43:31 PDT
Comment on attachment 290920 [details] Fix review comments View in context: https://bugs.webkit.org/attachment.cgi?id=290920&action=review > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:710 > + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event = WTFMove(event)](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) { You can use event->key here, because even has already been moved to the lambda, use keyEvent instead. > Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:730 > + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event = WTFMove(event)](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) { Ditto.
Tomas Popela
Comment 11 2016-10-09 22:40:35 PDT
Created attachment 291063 [details] Fix crash Fix the crash that was found by Carlos (thank you).
WebKit Commit Bot
Comment 12 2016-10-10 00:15:10 PDT
Comment on attachment 291063 [details] Fix crash Clearing flags on attachment: 291063 Committed r206985: <http://trac.webkit.org/changeset/206985>
WebKit Commit Bot
Comment 13 2016-10-10 00:15:15 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.