Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after running mpv #8325

Open
matheusmoreira opened this issue Sep 2, 2024 · 6 comments
Open

Crash after running mpv #8325

matheusmoreira opened this issue Sep 2, 2024 · 6 comments
Labels
bug Not working as intended

Comments

@matheusmoreira
Copy link

Please fill out the following:

  • Sway Version:

    $ swaymsg -t get_version
    sway version 1.9
    
  • Configuration File:

  • Stack Trace:

    • $ gdb /usr/bin/sway sway.core
      ...
      Core was generated by `sway'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000074a4b0a500a0 in wl_event_loop_dispatch (loop=0x5fbee443c0d0,
          timeout=<optimized out>, timeout@entry=-1) at ../wayland-1.23.0/src/event-loop.c:1105
      1105				source->interface->dispatch(source, &ep[i]);
      
    • bt full
    • The source variable appears to be corrupt
      • Dereferencing interface triggered the segmentation violation
      • source->fd == 1701013878 which is insane
      • It is part of a linked list which hints at issues such as this
  • Description:

    • Have Arch Linux installed
    • Boot
    • Log in via Linux terminal
    • sway
    • Use computer
    • Run mpv an indeterminate, seemingly random number of times
    • sway eventually crashes, sending me back to Linux terminal
    • No other application seems to cause this

I will try to reproduce the issue with full debugging log and using a default configuration later tonight by running:

sway --config /dev/null --debug 2> ~/sway.log

Will update this issue with the details if successful.

@matheusmoreira matheusmoreira added the bug Not working as intended label Sep 2, 2024
@matheusmoreira
Copy link
Author

matheusmoreira commented Sep 3, 2024

Reproduced with default settings.

sway --config /etc/sway/config --debug 2> /run/user/1000/sway.debug.log

Downloaded lots of random videos and started opening all of them with mpv until it crashed.

sway.debug.log

$ tail -n9 /run/user/1000/sway.debug.log
00:09:33.449 [INFO] [wlr] [xwayland/server.c:108] Starting Xwayland on :1
(EE) could not connect to wayland server
 err: 00:09:31.819 wayland.c:1490: failed to read events from the Wayland socket[ERROR] [swaybar/bar.c:466] Wayland display poll error: Broken pipe

 err: wayland.c:2069: failed to roundtrip Wayland display: Broken pipe
 err: wayland.c:2069: failed to roundtrip Wayland display: Broken pipe
 err: wayland.c:2069: failed to roundtrip Wayland display: Broken pipe
warn: terminal.c:1928: slave exited with signal 1 (Hangup)
 err: wayland.c:2034: failed to flush wayland socket: Broken pipe

@matheusmoreira
Copy link
Author

Since the segmentation violation occurs inside wayland code, I have also created an issue on the wayland library issue tracker.

@Nefsen402
Copy link
Member

This looks like a memory corruption issue. These things are notoriously hard to track down but there are steps you can take to make it easier. Please try running sway using an address sanitizer. This will validate that all memory accesses sway attempts are valid and so it doesn't corrupt itself along with any chance of debugging it.

@matheusmoreira
Copy link
Author

@Nefsen402 OK. I've just finished building sway and wlroots from git with address and undefined behavior sanitizers enabled. Should be able to fully test and follow up with the results either tomorrow or this weekend.

@matheusmoreira
Copy link
Author

matheusmoreira commented Sep 7, 2024

I was not able to reproduce the problem while running a sway compiled with address and undefined behavior sanitizers enabled.

export ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1

build/sway/sway \
    --debug 2> /run/user/1000/sway.debug.log

Spent quite a bit of time trying to trigger it but no crash.

@Nefsen402
Copy link
Member

The crash maybe fixed on sway master and exclusive to version 1.9. I would recommend you keep running a snapshot of git that you are happy with until a real release happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

2 participants