Closed Bug 1847336 Opened 11 months ago Closed 9 months ago

[Wayland] Firefox crashes immediately without warning when a browser tab is moved

Categories

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

Firefox 116
defect

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: wdanny33, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Steps to reproduce:

  1. Open firefox and move browser to secondary monitor
  2. Click mouse on tab and move.

Actual results:

Firefox immediately closes without warning.

Expected results:

The tab should have moved or snapped back in place

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: wayland
Flags: needinfo?(stransky)
Priority: -- → P3
Summary: Firefox crashes immediately without warning when a browser tab is moved → [Wayland] Firefox crashes immediately without warning when a browser tab is moved

The error message is produced by other gnome apps too but I can reproduce it with 300% scaled monitor attached while Firefox window is moving between desktops or maximized/minimized.

[Parent 25444: Renderer]: D/Widget [7fd9b9280800]: Get NS_NATIVE_EGL_WINDOW mGdkWindow 7fd9b665a300 returned eglWindow 7fd9a117f880
[Parent 25444: Renderer]: D/Widget [7fd9b9280800]: GtkCompositorWidget::GetEGLNativeWindow [7fd9b9280800] window 7fd9a117f880
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]: configure event 0,0 -> 1920 x 1136 direct mGdkWindow scale 2 (scaled size 3840 x 2272)
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]:   scale factor changed to 2,return early
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]: OnScaleChanged 3, 3.000000 -> 2, 0.000000
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]: nsWindow::PauseCompositorFlickering()
[Parent 25444: Renderer]: D/Widget [7fd9b9280800]: nsWindow::SetEGLNativeWindowSize() 5760 x 3297 scale 2 (unscaled 2880 x 1648)
[Parent 25444: Renderer]: D/Widget moz_container_wayland_egl_window_set_size [7fd9b9280800] 5760 x 3296 scale 2 (unscaled 2880 x 1648)
[Parent 25444: Renderer]: D/Widget moz_container_wayland_surface_set_scale_locked scale 2
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]: nsWindow::DispatchResized() size [3840, 2198]
[Parent 25444: Main Thread]: D/Widget [7fd9b9280800]: GtkCompositorWidget::NotifyClientSizeChanged() to 3840 x 2198
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: Wayland protocol error: wl_surface@57: error 2: Buffer size (5760x3297) must be an integer multiple of the buffer_scale (2).
 (t=3.70029) [GFX1-]: Wayland protocol error: wl_surface@57: error 2: Buffer size (5760x3297) must be an integer multiple of the buffer_scale (2).

Looks like there's still race between EGL window size and scale settings as we run them in different threads.

Flags: needinfo?(stransky)
See Also: → 1832760
Flags: needinfo?(stransky)
Flags: needinfo?(stransky)

If screen scale doesn't match requested EGLWindow size, doesn't adjust requested EGLWindow size but rather fail and report it back.
We can't update EGLWindow size imediatelly as EGL surface buffers are already created and wl_egl_window_resize() is effective for next rendering cycle,
so recent rendering will use old and incompatible screen size.

Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Propagate return code from nsWindow::SetEGLNativeWindowSize() to WebRender/OGL compositors.
It allows to skip rendering in case of incompatible recent EGL buffer size.

Depends on D187889

If SetEGLNativeWindowSize() returns false window size put to SetEGLNativeWindowSize() doesn't match screen scale and
will lead to Wayland protocol error. Skip this frame rendering and wait for new window size provided by layout.

Depends on D187890

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/9410a8346cf0
[Linux] Don't adjust EGLWindow size for recent scale by MozContainer r=emilio
https://hg.mozilla.org/integration/autoland/rev/3e047948f304
[Linux] Propagate SetEGLNativeWindowSize() to WebRender/OGL compositor r=emilio
https://hg.mozilla.org/integration/autoland/rev/995537a41db9
[Linux] Skip frame rendering if we don't have EGL window to paint into r=sotaro
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: