Closed Bug 1844690 Opened 2 years ago Closed 2 years ago

Wayland crashes without crash report

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1743144
Tracking Status
firefox117 --- affected

People

(Reporter: bugzilla.mozilla.org, Unassigned)

Details

Attachments

(1 file)

Attached file WAYLAND_DEBUG.txt

Bug 1834589 added crash reports for fatal wayland errors but I'm still getting crashes without crash reports trigged by gtk calling _exit()

Firefox 117.0a1 20230720093622
Window Protocol wayland
sway 1.8.1

gdb backtrace when setting a breakpoint on exit_group shows:

Thread 1 (Thread 0x7fde5ec89780 (LWP 1135714) "firefox-bin"):
#0  0x00007fde5e7d8bad in _exit () at /usr/lib/libc.so.6
#1  0x00007fde5ad6b868 in  () at /usr/lib/libgdk-3.so.0
#2  0x00007fde5ad37fb9 in gdk_display_get_event () at /usr/lib/libgdk-3.so.0
#3  0x00007fde5ad72838 in  () at /usr/lib/libgdk-3.so.0
#4  0x00007fde5ac16a31 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#5  0x00007fde5ac73cc9 in  () at /usr/lib/libglib-2.0.so.0
#6  0x00007fde5ac140e2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#7  0x00007fde52325752 in nsThread::ProcessNextEvent(bool, bool*) () at /home/the8472/opt/firefox/libxul.so
#8  0x00007fde52373bf0 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () at /home/the8472/opt/firefox/libxul.so
#9  0x00007fde538f50fe in nsBaseAppShell::Run() () at /home/the8472/opt/firefox/libxul.so
#10 0x00007fde51417025 in nsAppStartup::Run() () at /home/the8472/opt/firefox/libxul.so
#11 0x00007fde53c47495 in XREMain::XRE_mainRun() () at /home/the8472/opt/firefox/libxul.so
#12 0x00007fde514a70cb in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#13 0x00007fde514a7658 in XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#14 0x000056380ada7f58 in main ()

On the tty I'm getting one of the messages during each crash:

  • Gdk-Message: 22:41:28.825: Error 32 (Broken pipe) dispatching to Wayland display.
  • Gdk-Message: 22:43:42.937: Lost connection to Wayland compositor.
  • Gdk-Message: 01:20:29.274: Error reading events from display: Connection reset by peer
  • Gdk-Message: 01:34:44.899: Error flushing display: Broken pipe

I also captured a crash with WAYLAND_DEBUG=1, the log is in the attachments.

Thanks. Could you maybe install debug symbols for gtk3 and get a full backtrace? That'd be super helpful.

#0  __GI__exit (status=status@entry=1) at ../sysdeps/unix/sysv/linux/_exit.c:30
#1  0x00007f4d35d6b8a3 in _gdk_wayland_display_queue_events (display=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:211
#2  0x00007f4d35d37fb9 in gdk_display_get_event (display=0x7f4d3943e200) at ../gtk/gdk/gdkdisplay.c:442
#3  0x00007f4d35d72838 in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:120
#4  0x00007f4d35c16a31 in g_main_dispatch (context=0x7f4d285030e0) at ../glib/glib/gmain.c:3460
#5  g_main_context_dispatch (context=0x7f4d285030e0) at ../glib/glib/gmain.c:4200
#6  0x00007f4d35c73cc9 in g_main_context_iterate.isra.0 (context=context@entry=0x7f4d285030e0, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4276
#7  0x00007f4d35c140e2 in g_main_context_iteration (context=0x7f4d285030e0, may_block=0) at ../glib/glib/gmain.c:4343
#8  0x00007f4d2d325752 in nsThread::ProcessNextEvent(bool, bool*) () at /home/the8472/opt/firefox/libxul.so
#9  0x00007f4d2d373bf0 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () at /home/the8472/opt/firefox/libxul.so
#10 0x00007f4d2e8f50fe in nsBaseAppShell::Run() () at /home/the8472/opt/firefox/libxul.so
#11 0x00007f4d2c417025 in nsAppStartup::Run() () at /home/the8472/opt/firefox/libxul.so
#12 0x00007f4d2ec47495 in XREMain::XRE_mainRun() () at /home/the8472/opt/firefox/libxul.so
#13 0x00007f4d2c4a70cb in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#14 0x00007f4d2c4a7658 in XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#15 0x000056521f9b5f58 in main ()

Thanks - in coredumpctl one can do bt full - is that available for you as well? In any case this is already very helpful.

For the record the crash happens here: https://gitlab.gnome.org/GNOME/gtk/-/blob/c0a09448dad12cad783ee20030c93e288d0a2d2e/gdk/wayland/gdkeventsource.c#L208-212 because of if (source->pfd.revents & (G_IO_ERR | G_IO_HUP)).

Random guess: do you happen to have a very fast mouse, like 1000Hz or so?

do you happen to have a very fast mouse, like 1000Hz or so?

yes

I have encounted some additional GDK error messages and added them to comment 0.

(In reply to Robert Mader [:rmader] from comment #3)

Thanks - in coredumpctl one can do bt full - is that available for you as well? In any case this is already very helpful.

#0  __GI__exit (status=status@entry=1) at ../sysdeps/unix/sysv/linux/_exit.c:27
#1  0x00007fc14c139868 in _gdk_wayland_display_queue_events (display=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:205
        display_wayland = <optimized out>
        source = <optimized out>
        __func__ = "_gdk_wayland_display_queue_events"
#2  _gdk_wayland_display_queue_events (display=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:193
        display_wayland = <optimized out>
        source = <optimized out>
        __func__ = "_gdk_wayland_display_queue_events"
#3  0x00007fc14c105fb9 in gdk_display_get_event (display=0x7fc14f03ff00) at ../gtk/gdk/gdkdisplay.c:442
        __func__ = "gdk_display_get_event"
#4  0x00007fc14c140838 in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../gtk/gdk/wayland/gdkeventsource.c:120
        source = <optimized out>
        display = 0x7fc14f03ff00
        event = <optimized out>
#5  0x00007fc14b70fa31 in g_main_dispatch (context=0x7fc13e103190) at ../glib/glib/gmain.c:3460
        dispatch = 0x7fc14c140820 <gdk_event_source_dispatch>
        prev_source = 0x0
        begin_time_nsec = 673889254779006
        was_in_call = 0
        user_data = 0x0
        callback = 0x0
        cb_funcs = 0x0
        cb_data = 0x0
        need_destroy = <optimized out>
        source = 0x7fc13e112100
        current = 0x7fc13e1073b0
        i = 0
#6  g_main_context_dispatch (context=0x7fc13e103190) at ../glib/glib/gmain.c:4200
#7  0x00007fc14b76ccc9 in g_main_context_iterate.isra.0 (context=context@entry=0x7fc13e103190, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4276
        max_priority = 1
        timeout = 0
        some_ready = 1
        nfds = 5
        allocated_nfds = <optimized out>
        fds = <optimized out>
        begin_time_nsec = 673889254414300
#8  0x00007fc14b70d0e2 in g_main_context_iteration (context=0x7fc13e103190, may_block=0) at ../glib/glib/gmain.c:4343
        retval = <optimized out>
#9  0x00007fc142f25752 in nsThread::ProcessNextEvent(bool, bool*) () at /home/the8472/opt/firefox/libxul.so
#10 0x00007fc142f73bf0 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () at /home/the8472/opt/firefox/libxul.so
#11 0x00007fc1444f50fe in nsBaseAppShell::Run() () at /home/the8472/opt/firefox/libxul.so
#12 0x00007fc142017025 in nsAppStartup::Run() () at /home/the8472/opt/firefox/libxul.so
#13 0x00007fc144847495 in XREMain::XRE_mainRun() () at /home/the8472/opt/firefox/libxul.so
#14 0x00007fc1420a70cb in XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#15 0x00007fc1420a7658 in XRE_main(int, char**, mozilla::BootstrapConfig const&) () at /home/the8472/opt/firefox/libxul.so
#16 0x00005652c3d91f58 in main ()

(In reply to The 8472 from comment #5)

do you happen to have a very fast mouse, like 1000Hz or so?

yes

Ah right, makes sense. Then this is a duplicate of bug 1743144 which is caused by a fundamental Wayland issue, see bug 1743144 comment 34. Wayland compositor can prevent this to some degree - Gnome/Mutter does so - and clients can avoid it by never freezing (e.g. reading the Wayland socket on a dedicated thread, which unfortunately is hard with our architecture) but over all we're still waiting for a solution.

I'd ping wlroots devs to implement something similar to https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2122 in the meantime.

Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1743144
Resolution: --- → DUPLICATE

Well, I filed this issue more about that the crashes still going unreported, not the fact that it crashes.

I'd ping wlroots devs to implement something similar to https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2122 in the meantime.

That has already been done in https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3585
Their response was... not favorable.

Sorry, but no, we don't workaround bugs in wlroots.

Ah, good to know, thanks.

Well, I filed this issue more about that the crashes still going unreported, not the fact that it crashes.

I see - let's still track it in the other bug, I changed the title accordingly.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: