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

Segfault in libwlroots when creating a winit window (on Mesa 19.3.1) #4834

Closed
Abendstolz opened this issue Dec 23, 2019 · 7 comments · Fixed by swaywm/wlroots#1964
Closed

Comments

@Abendstolz
Copy link

Hello!

You should try to reproduce the issue with the default configuration. If you cannot, please reproduce with a minimal configuration, upload the config to a pastebin service, and link to it below.

  • Stack Trace, if sway crashes:
#0  0x00007f971d97ad1d in  () at /usr/lib/libwlroots.so.3
#1  0x00007f971d22969a in ffi_call_unix64 () at /usr/lib/libffi.so.6
#2  0x00007f971d228fb6 in ffi_call () at /usr/lib/libffi.so.6
#3  0x00007f971d9df82f in  () at /usr/lib/libwayland-server.so.0
#4  0x00007f971d9dc193 in  () at /usr/lib/libwayland-server.so.0
#5  0x00007f971d9dd7f2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#6  0x00007f971d9dc39c in wl_display_run () at /usr/lib/libwayland-server.so.0
#7  0x000055e8a42c4592 in  ()
#8  0x00007f971dfdf153 in __libc_start_main () at /usr/lib/libc.so.6
#9  0x000055e8a42c48be in  ()
  • Prose description

I reported an issue to the cross-plattform window library winit earlier (rust-windowing/winit#1333) which leads to:

Dec 22 19:34:44 manetheren kernel: sway[10122]: segfault at 28 ip 00007f4440e46d1d sp 00007fff084cd8a0 error 4 in libwlroots.so.3.6.1[7f4440e17000+4e000]

(details in the linked winit issue)

I was told to additionally open an issue here as well, which is why I am here.

As said in the other issue, I'll gladly provide any additional assistance I can give, building all of llvm and mesa-git will take some time though, time that I hope to have in a couple of days.

Merry Christmas until then and thanks a lot for all your work on sway :)

@emersion
Copy link
Member

The backtrace you provided doesn't contain debug symbols. This most likely happens because the Sway binary you're using doesn't have debug information bundled.

Can you try again with a manually compiled Sway binary?

@Abendstolz
Copy link
Author

Abendstolz commented Dec 23, 2019

@emersion sure thing (and sorry!)

abendstolz:~# swaymsg -t get_version
sway version 1.2-aa8fe584 (Dec 23 2019, branch 'master')

sway.log: https://gist.github.com/Abendstolz/7130889fd1ad6bfae17a527d1057aefb

(gdb) bt full
#0  0x00007f20aad57d4d in xdg_surface_handle_destroy (client=<optimized out>, resource=0x555ed6dc8210) at ../types/xdg_shell/wlr_xdg_surface.c:281
        surface = 0x0
#1  0x00007f20aa44569a in ffi_call_unix64 () at /usr/lib/libffi.so.6
#2  0x00007f20aa444fb6 in ffi_call () at /usr/lib/libffi.so.6
#3  0x00007f20aadc282f in  () at /usr/lib/libwayland-server.so.0
#4  0x00007f20aadbf193 in  () at /usr/lib/libwayland-server.so.0
#5  0x00007f20aadc07f2 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#6  0x00007f20aadbf39c in wl_display_run () at /usr/lib/libwayland-server.so.0
#7  0x0000555ed493c58c in main (argc=2, argv=0x7ffee6cf18d8) at ../sway/sway/main.c:403
        verbose = 0
        debug = 1
        validate = 0
        allow_unsupported_gpu = 0
        long_options =
            {{name = 0x555ed498647b "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x555ed4989729 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x555ed4986480 "validate", has_arg = 0, flag = 0x0, val = 67}, {name = 0x555ed4986489 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x555ed49863df "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x555ed498557c "verbose", has_arg = 0, flag = 0x0, val = 86}, {name = 0x555ed498648f "get-socketpath", has_arg = 0, flag = 0x0, val = 112}, {name = 0x555ed498649e "unsupported-gpu", has_arg = 0, flag = 0x0, val = 117}, {name = 0x555ed49864ae "my-next-gpu-wont-be-nvidia", has_arg = 0, flag = 0x0, val = 117}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        config_path = 0x0
        usage = 0x555ed49867e0 "Usage: sway [options] [command]\n\n  -h, --help", ' ' <repeats 13 times>, "Show help message and quit.\n  -c, --config <config>  Specify a config file.\n  -C, --validate         Check the validity of the config file, th"...
        c = <optimized out>

Some additional info (also readable in the winit issue): Although sway crashes here, to me this seems to somehow be related to vulkan/mesa, because when I run another example from another project that also uses winit but opengl, the same crash doesn't happen.

@emersion
Copy link
Member

Thanks, can you try swaywm/wlroots#1964?

@Abendstolz
Copy link
Author

Abendstolz commented Dec 26, 2019

@emersion I tried that - checkout your fork, the branch, make sure the fix was in git log and build/install with

meson build
ninja -C build
sudo ninja -C build install

as nothing changed (the exact same error message - after exiting and re-entering sway - even after rebooting - I am not sure it was correctly installed. Probably a layer 8 problem, so me doing something wrong. Once I figure out what I am doing wrong, I'll try again)

@emersion
Copy link
Member

You'll need to compile sway from source too, and tell it to use your wlroots clone. With Meson you can do this in the Sway directory, assuming you wlroots copy is in ../wlroots:

mkdir subprojects && ln -s ../../wlroots subprojects/

Then compile Sway and run it directly (build/sway/sway).

emersion added a commit to emersion/wlroots that referenced this issue Dec 29, 2019
ddevault pushed a commit to swaywm/wlroots that referenced this issue Dec 30, 2019
@Abendstolz
Copy link
Author

Abendstolz commented Jan 2, 2020

@emersion thanks, sadly that version leads to strange artifacts on my main monitor (in non 4k resolution) - basically the fonts are very, very blurry -, while in the current release of sway (and wlroots) in Arch this does not occur.

While I got side-tracked with investigating this phenomenon, I found no time to actually try out the build for my reported issue. Seeing as it was merged and already closed I switched back to the currently available packages of Arch and will hope for the best.

@emersion
Copy link
Member

emersion commented Jan 4, 2020

Please report other bug(s) in separate issues.

filips pushed a commit to filips/wlroots that referenced this issue Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants