Closed Bug 1178799 Opened 9 years ago Closed 9 years ago

TEST-UNEXPECTED-FAIL | editor/libeditor/tests/browserscope/test_richtext2.html | application terminated with exit code 11

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: acomminos, Assigned: acomminos)

References

Details

Attachments

(1 file, 3 obsolete files)

This intermittent crash occurs fairly frequently on the test infrastructure for GTK3 on linux32- it appears to be caused by upstream GTK bug 719314 (https://bugzilla.gnome.org/show_bug.cgi?id=719314).

Some debugging has revealed that this is caused by affected GTK versions making a selection request from a null requestor (window). Perhaps it would make sense to disable this test for GTK3.
The crash is caused by another X window calling XConvertSelection (sending a SelectionRequest) while nsClipboard is waiting for the clipboard to be updated with its modified X11 event loop (see RetrievalContext::Wait). If the client requesting input dies before the waiting finishes, the queued up SelectionRequest event will have requestor == NULL- triggering GTK bug 719314 (https://bugzilla.gnome.org/show_bug.cgi?id=719314).

This can be reproduced locally by running editor/libeditor/tests/browserscope/test_richtext2.html at the same time as an `xsel -b` loop.

There are two solutions I can think of:

1) Filter X11 SelectionRequest events with an unreachable window using a GDK event filter.
2) Handle SelectionRequest events in our custom X event loop.
Here's an example of the filter approach. I think that this is preferable as it can catch SelectionRequest events with null requestors even outside of the custom clipboard event loop. Thanks!

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=41caac039337
Attachment #8629500 - Attachment is obsolete: true
Attachment #8631634 - Flags: review?(karlt)
Comment on attachment 8631634 [details] [diff] [review]
Filter X11 SelectionRequest events with an invalid requestor on GTK3.

>+// A custom event filter to workaround attempting to dereference a null
>+// selection requestor in GTK3 versions before 3.10. See bug 1178799.

https://bugzilla.gnome.org/show_bug.cgi?id=719314 implies the bug existed with
3.10.5.

>+#if (MOZ_WIDGET_GTK == 3) && defined(MOZ_X11)
>+    gdk_window_add_filter(nullptr, selection_request_filter, nullptr);
>+#endif

Please add a runtime check for the appropriate version and only add the filter
when running against the version with the bug.  That protects against any
future protocols that may use a null requestor for some reason, and makes
things a little more efficient than finding the window properties twice.

No need to make the remove conditional.  The remove will be a no-op if it
hasn't been added.

r+ with those addressed, thank you.
Attachment #8631634 - Flags: review?(karlt) → review+
Updated, thanks. Appears that the earliest unaffected GTK version was 3.11.3.
Attachment #8631634 - Attachment is obsolete: true
Attachment #8632824 - Flags: review+
Updated to re-add MOZ_X11 and MOZ_WIDGET_GTK == 3 check.
Attachment #8632824 - Attachment is obsolete: true
Attachment #8632825 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1bb9ee25eb2c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: