Closed Bug 1662425 Opened 2 years ago Closed 2 years ago

[Wayland] Crash nsWaylandDisplay::DispatchEventQueue()

Categories

(Core :: Widget: Gtk, defect, P2)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(1 file)

We can crash at nsWaylandDisplay::DispatchEventQueue() when mDisplay/mEventQueue is already released. I happens when nsWaylandDisplay::DispatchEventQueue() is performed after nsWaylandDisplay release.

We need to keep nsWaylandDisplay around until any active loop->PostTask(NewRunnableFunction(...)) is pending.

  • Create nsWaylandDisplay as a ref-counted struct to avoid potential delete when a display is used.
  • Don't use Mutex to access all display array operations. Use only write mutex when the array is modified / released.
  • Store all wayland displays in nsTArray instead of fixed plain C array.
  • Release all displays before we close Gtk display to make sure we quit before Gtk connections are closed.
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/00a41c5183d7
[Wayland] Create nsWaylandDisplay as ref counted, r=jhorak

Related to https://bugzilla.mozilla.org/show_bug.cgi?id=1505307#c1 so we need to clear the array.

Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
Flags: needinfo?(stransky)
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/46b402033322
[Wayland] Create nsWaylandDisplay as ref counted, r=jhorak
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Regressions: 1672993
You need to log in before you can comment on or make changes to this bug.