Closed Bug 1703526 Opened 3 years ago Closed 3 years ago

[Wayland] Deadlock in mozilla::WaylandVsyncSource::WaylandDisplay::Shutdown()

Categories

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

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

There's a deadlock at mozilla::WaylandVsyncSource::WaylandDisplay::Shutdown()

#0 0x00007f6b53dceea0 in __lll_lock_wait () at /lib64/libpthread.so.0
#1 0x00007f6b53dc78f5 in pthread_mutex_lock () at /lib64/libpthread.so.0
#2 0x0000557a1a9f9e1b in mozilla::detail::MutexImpl::mutexLock() (this=0x7f6afeaa0a60) at /raid/src2/mozglue/misc/Mutex_posix.cpp:96
#3 mozilla::detail::MutexImpl::lock() (this=0x7f6afeaa0a60) at /raid/src2/mozglue/misc/Mutex_posix.cpp:118
#4 0x00007f6b4da71344 in mozilla::OffTheBooksMutex::Lock() (this=0x7f6afeaa0a60) at /raid/src2/objdir-opt/dist/include/mozilla/Mutex.h:63
#5 mozilla::detail::BaseAutoLock<mozilla::Mutex&>::BaseAutoLock(mozilla::Mutex&) (this=<optimized out>, aLock=...) at /raid/src2/objdir-opt/dist/include/mozilla/Mutex.h:158
#6 mozilla::WaylandVsyncSource::WaylandDisplay::Refresh() (this=0x7f6afeaa09e0) at /raid/src2/widget/gtk/WaylandVsyncSource.cpp:59
#7 0x00007f6b4daa5281 in std::function<void ()>::operator()() const (this=0x7f6b144cad40) at /usr/lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/bits/std_function.h:622
#8 moz_container_wayland_frame_callback_handler(void*, wl_callback*, unsigned int) (data=<optimized out>, callback=<optimized out>, time=<optimized out>)
at /raid/src2/widget/gtk/MozContainerWayland.cpp:208
#9 0x00007f6b51591b10 in ffi_call_unix64 () at /lib64/libffi.so.6
#10 0x00007f6b515910a3 in ffi_call () at /lib64/libffi.so.6
#11 0x00007f6b51efdbaf in wl_closure_invoke (closure=0x7f6b0e338f20, flags=1, target=0x7f6b0e412600, opcode=0, data=0x7f6b0f0c4460) at src/connection.c:1018
#12 0x00007f6b51efaae0 in dispatch_event (display=0x7f6b5361c6d0, queue=0x7f6b5361c7a0) at src/wayland-client.c:1445
#13 0x00007f6b51efadd6 in dispatch_queue (display=0x7f6b5361c6d0, queue=0x7f6b5361c7a0) at src/wayland-client.c:1591
#14 0x00007f6b51efb0c2 in wl_display_dispatch_queue_pending (display=0x7f6b5361c6d0, queue=0x7f6b5361c7a0) at src/wayland-client.c:1833
#15 0x00007f6b51efb087 in wl_display_dispatch_queue (display=0x7f6b5361c6d0, queue=0x7f6b5361c7a0) at src/wayland-client.c:1809
#16 0x00007f6b51efa490 in wl_display_roundtrip_queue (display=0x7f6b5361c6d0, queue=0x7f6b5361c7a0) at src/wayland-client.c:1251
#17 0x00007f6b51efa4fd in wl_display_roundtrip (display=0x7f6b5361c6d0) at src/wayland-client.c:1280
#18 0x00007f6b4da71aba in mozilla::WaylandVsyncSource::WaylandDisplay::Shutdown() (this=0x7f6afeaa09e0) at /raid/src2/widget/gtk/WaylandVsyncSource.cpp:209
#19 0x00007f6b4da72333 in nsWindow::Destroy() (this=0x7f6b1420b800) at /raid/src2/widget/gtk/nsWindow.cpp:753

This is caused by wl_display_roundtrip() at WaylandVsyncSource::WaylandDisplay::Shutdown() which leads to get another lock at WaylandVsyncSource::WaylandDisplay::Refresh().

Robert, do we really need the wl_display_roundtrip() here? If so we have to release the lock before we call it although I don't think we need it.

Flags: needinfo?(robert.mader)

Hm, this was added in https://phabricator.services.mozilla.com/D77047 - it was maybe needed at the time, however in https://phabricator.services.mozilla.com/D95515 I added a fix that should properly make the VsyncSource shut down. So I think it should not be needed any more.

Flags: needinfo?(robert.mader)
Assignee: nobody → stransky
Status: NEW → ASSIGNED
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/38cc24053183
[Wayland] Don't call wl_display_roundtrip() from WaylandVsyncSource::WaylandDisplay::Shutdown(), r=rmader
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: