[Wayland] Frequent crashes under gdk_wayland_window_ref_cairo_surface when spawning the inspector on a different window
Categories
(Core :: Widget: Gtk, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox72 | --- | unaffected |
firefox73 | --- | fixed |
firefox74 | --- | fixed |
People
(Reporter: emilio, Assigned: stransky)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Crash Data
Attachments
(1 file)
Bug 1607088 [Wayland] Request mShell window repaint instead of direct commit to wl_surface, r?heftig
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Reporter | ||
Comment 1•5 years ago
|
||
This is with WebRender, fwiw.
Reporter | ||
Comment 2•5 years ago
|
||
This is the assert: assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count));
, so either we're reffing the surface too late, or too early. May be a gdk bug...
Comment 3•5 years ago
|
||
I've been seeing a different cairo assert, not related to the inspector or webrender, just sometimes when launching. Only after recent updates.
(firefox:14792): Gdk-WARNING **: 20:28:20.829: (gdkwindow-wayland.c:810):buffer_release_callback: runtime check failed: (impl->staging_cairo_surface != cairo_surface)
Assertion failed: (status == cr->status), function _cairo_create_in_error, file cairo.c, line 412.
Reporter | ||
Comment 4•5 years ago
|
||
I managed to catch this one under rr, so tentatively taking.
Reporter | ||
Comment 5•5 years ago
|
||
(rr) p/x surface->ref_count.ref_count
$4 = 0xe5e5e5e5
Yeah that's not good.
Reporter | ||
Comment 6•5 years ago
|
||
This is failing: https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gdk/wayland/gdkwindow-wayland.c#L810
And we're freeing a surface too early, I think.
Comment 7•5 years ago
|
||
I think this might be a regression caused by the wl_surface_commit
added by bug 1606776, perhaps in combination with the wl_surface_commit
added by bug 1542808, which possibly runs on another thread. GTK and Wayland are not thread-safe.
Updated•5 years ago
|
Comment 8•5 years ago
|
||
I see asserts from the line Emilio pointed out (but with the crash signature from bug 1607033) doing various things, like trying to dock the inspector, opening the page info dialog, or opening an external link.
Reporter | ||
Comment 9•5 years ago
|
||
(In reply to Jan Alexander Steffens [:heftig] from comment #7)
I think this might be a regression caused by the
wl_surface_commit
added by bug 1606776, perhaps in combination with thewl_surface_commit
added by bug 1542808, which possibly runs on another thread. GTK and Wayland are not thread-safe.
I do think it's because of that bug, but I don't think it's a threading issue. At least I don't see anything relevant going on off the main thread. What I see is that we're hitting this after that wl_surface_commit
runs, which confuses gtk.
So I think that commit
added by bug 1606776 is just messing up with the gdk state (at least when gdkwindow's state is in pending_buffer_attached
state), making wayland send a wl_release_buffer
that gdk thinks it is due to its own commit but it's not.
Now what the right thing to do is, I don't know. It may be that we just need to addref the cairo surface so that gdk releases it on their buffer_release_callback
, or it may be a deeper problem...
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
We need to force Gtk to re-commit GdkWindow wl_surface to compositor. We may use frame begin/end or request frame clock repaint, whatever it takes. I'll look at it.
Assignee | ||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
bugherder |
Comment 14•5 years ago
|
||
Please nominate this for Beta approval if necessary.
Assignee | ||
Comment 17•5 years ago
|
||
Comment on attachment 9118971 [details]
Bug 1607088 [Wayland] Request mShell window repaint instead of direct commit to wl_surface, r?heftig
Beta/Release Uplift Approval Request
- User impact if declined: Crashes on Wayland backend caused by commit to wl_surface owned by Gtk.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: Bug 1606751
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Linux/Wayland only.
- String changes made/needed: none
Updated•5 years ago
|
Comment 18•5 years ago
|
||
Comment on attachment 9118971 [details]
Bug 1607088 [Wayland] Request mShell window repaint instead of direct commit to wl_surface, r?heftig
Wayland crash fix. Approved for 73.0b3.
Comment 19•5 years ago
|
||
bugherder uplift |
Description
•