danvd / wlroots-eglstreams

A modular Wayland compositor library with EGLStreams support
MIT License
105 stars 11 forks source link

SIGABRT in Xwayland #18

Closed dbrgn closed 2 years ago

dbrgn commented 3 years ago

I have occasional crashes in Xwayland. There were also multiple occasions where the entire UI and input handling froze and I had to restart the computer. Since this doesn't happen under X, I assume it's also related to wlroots-eglstreams.

2021-05-19-131219_1853x302_scrot

Here are the last 3 stack traces:

I think this is the relevant part:

                Stack trace of thread 26613:
                #0  0x00007f44610e3d22 raise (libc.so.6 + 0x3cd22)
                #1  0x00007f44610cd862 abort (libc.so.6 + 0x26862)
                #2  0x00005561d3e16fdb n/a (Xwayland + 0x15dfdb)
                #3  0x00005561d3e20c3d n/a (Xwayland + 0x167c3d)
                #4  0x00005561d3ce99bd n/a (Xwayland + 0x309bd)
                #5  0x00007f446162afda n/a (libwayland-client.so.0 + 0xafda)
                #6  0x00007f44616261f8 n/a (libwayland-client.so.0 + 0x61f8)
                #7  0x00007f4460fa9acd n/a (libffi.so.7 + 0x6acd)
                #8  0x00007f4460fa903a n/a (libffi.so.7 + 0x603a)
                #9  0x00007f4461629fe4 n/a (libwayland-client.so.0 + 0x9fe4)
                #10 0x00007f4461626563 n/a (libwayland-client.so.0 + 0x6563)
                #11 0x00007f4461627c7f wl_display_dispatch_queue_pending (libwayland-client.so.0 + 0x7c7f)
                #12 0x00005561d3ceff9d n/a (Xwayland + 0x36f9d)
                #13 0x00005561d3e16831 n/a (Xwayland + 0x15d831)
                #14 0x00005561d3d55df0 n/a (Xwayland + 0x9cdf0)
                #15 0x00005561d3ce7cc4 n/a (Xwayland + 0x2ecc4)
                #16 0x00007f44610ceb25 __libc_start_main (libc.so.6 + 0x27b25)
                #17 0x00005561d3ce900e n/a (Xwayland + 0x3000e)

Plus there are a few other threads that are currently blocked in recv. Could this be a race condition?

As with #17, if it helps, I can recompile wayland with debug symbols and try to capture a symbolized stack trace.

danvd commented 3 years ago

Hi @dbrgn. I also have such crashes in Xwayland. They're rather rare, but annoying. Happens when Xwayland hangs for some reason and wlroots tries to restart it but fails. Instead of rebooting you can switch to another tty and kill sway.

If you have some time for testing, compile both libwayland-client and Xwayland with debug symbols.

dbrgn commented 3 years ago

Here's a stack trace with debug symbols:

           PID: 218134 (Xwayland)
        Signal: 6 (ABRT)
     Timestamp: Wed 2021-05-19 23:12:05 CEST (15min ago)
  Command Line: Xwayland :1 -rootless -terminate -core -listenfd 39 -listenfd 41 -wm 74
    Executable: /usr/bin/Xwayland
     Disk Size: 6.1M
       Message: Process 218134 (Xwayland) of user 1000 dumped core.

                Stack trace of thread 218134:
                #0  0x00007f34a494dd22 raise (libc.so.6 + 0x3cd22)
                #1  0x00007f34a4937862 abort (libc.so.6 + 0x26862)
                #2  0x0000557b45e632ed OsAbort (Xwayland + 0x15e2ed)
                #3  0x0000557b45e636cd FatalError (Xwayland + 0x15e6cd)
                #4  0x0000557b45d357f1 xwl_log_handler (Xwayland + 0x307f1)
                #5  0x00007f34a4e9518e wl_log (libwayland-client.so.0 + 0xb18e)
                #6  0x00007f34a4e9020c display_handle_error (libwayland-client.so.0 + 0x620c)
                #7  0x00007f34a4811acd n/a (libffi.so.7 + 0x6acd)
                #8  0x00007f34a481103a n/a (libffi.so.7 + 0x603a)
                #9  0x00007f34a4e94113 wl_closure_invoke (libwayland-client.so.0 + 0xa113)
                #10 0x00007f34a4e90583 dispatch_event (libwayland-client.so.0 + 0x6583)
                #11 0x00007f34a4e91ccf dispatch_queue (libwayland-client.so.0 + 0x7ccf)
                #12 0x0000557b45d3bf1d xwl_read_events (Xwayland + 0x36f1d)
                #13 0x0000557b45e62cd1 ospoll_wait (Xwayland + 0x15dcd1)
                #14 0x0000557b45da1a50 Dispatch (Xwayland + 0x9ca50)
                #15 0x0000557b45d3365a main (Xwayland + 0x2e65a)
                #16 0x00007f34a4938b25 __libc_start_main (libc.so.6 + 0x27b25)
                #17 0x0000557b45d34dfe _start (Xwayland + 0x2fdfe)

                Stack trace of thread 224706:
                #0  0x00007f34a4a10a3c recv (libc.so.6 + 0xffa3c)
                #1  0x00007f34a3d63d53 n/a (libEGL_nvidia.so.0 + 0x78d53)
                #2  0x00007f34a3d64b1d n/a (libEGL_nvidia.so.0 + 0x79b1d)
                #3  0x00007f34a3d59c7d n/a (libEGL_nvidia.so.0 + 0x6ec7d)
                #4  0x00007f34a3da70ce n/a (libEGL_nvidia.so.0 + 0xbc0ce)
                #5  0x00007f34a47f3259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007f34a4a0f5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 225480:
                #0  0x00007f34a4a10a3c recv (libc.so.6 + 0xffa3c)
                #1  0x00007f34a3d63d53 n/a (libEGL_nvidia.so.0 + 0x78d53)
                #2  0x00007f34a3d646c1 n/a (libEGL_nvidia.so.0 + 0x796c1)
                #3  0x00007f34a3d59851 n/a (libEGL_nvidia.so.0 + 0x6e851)
                #4  0x00007f34a3da70ce n/a (libEGL_nvidia.so.0 + 0xbc0ce)
                #5  0x00007f34a47f3259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007f34a4a0f5e3 __clone (libc.so.6 + 0xfe5e3)

                Stack trace of thread 225477:
                #0  0x00007f34a4a10a3c recv (libc.so.6 + 0xffa3c)
                #1  0x00007f34a3d63d53 n/a (libEGL_nvidia.so.0 + 0x78d53)
                #2  0x00007f34a3d64b1d n/a (libEGL_nvidia.so.0 + 0x79b1d)
                #3  0x00007f34a3d59c7d n/a (libEGL_nvidia.so.0 + 0x6ec7d)
                #4  0x00007f34a3da70ce n/a (libEGL_nvidia.so.0 + 0xbc0ce)
                #5  0x00007f34a47f3259 start_thread (libpthread.so.0 + 0x9259)
                #6  0x00007f34a4a0f5e3 __clone (libc.so.6 + 0xfe5e3)
danvd commented 3 years ago

This is a quite popular crash dump: https://bugzilla.redhat.com/show_bug.cgi?id=1757137 (googled xwl_log_handler) Possible cause is that xwayland receives some error code forcing it to crash. Interesting. Will check whether wlroots sending something nasty.

danvd commented 3 years ago

Not related to this issue. Looking at xwayland code I found this commit: https://gitlab.freedesktop.org/xorg/xserver/-/commit/7515c23a416825f0db51f9b445279b12d5918ebf

It's description may be related to #14 (old terminal contents) and according to commit message could be solved with calling eglStreamFlushNV. Will give this approach a try)

danvd commented 3 years ago

Hi @dbrgn, Please check if X apps stability issues are still here with current code?

danvd commented 2 years ago

Closing this. Reopen if issue is still here.

dbrgn commented 2 years ago

@danvd sorry, I missed your reply. Last time I tested (probably around October) there were still occasional issues. However, I then decided that I don't want to wait any longer for the prices to come down (probably not any time soon) and bought an overpriced AMD graphics card.