-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Sway crashes when external monitor is connected #4717
Sway crashes when external monitor is connected #4717
Comments
Please provide a stack trace. You can do so by running |
|
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? |
Sure. I just used the definition of the package I keep around and was in a hurry. I hope this is more useful: coredumpctl gdb
PID: 3533 (sway)
UID: 1337 (john)
GID: 100 (users)
Signal: 11 (SEGV)
Timestamp: Sun 2019-11-10 22:51:37 CET (1min 11s ago)
Command Line: ./build/sway/sway
Executable: /home/john/Development/sway/build/sway/sway
Control Group: /user.slice/user-1337.slice/session-7.scope
Unit: session-7.scope
Slice: user-1337.slice
Session: 7
Owner UID: 1337 (john)
Boot ID: 3e65e....removed
Machine ID: dce42....removed
Hostname: europa
Storage: /var/lib/systemd/coredump/core.sway.1337.3e65e75fabc841e6a6c8bc1784b4f0b6.3533.1573422697000000000000.lz4
Message: Process 3533 (sway) of user 1337 dumped core.
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/john/Development/sway/build/sway/sway...
[New LWP 3533]
[New LWP 3535]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/qn76sklvyalzw9ilnxz6sh0020gl2qn6-glibc-2.27/lib/libthread_db.so.1".
Core was generated by `./build/sway/sway'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f4895557af0 in gbm_bo_get_user_data () from /nix/store/qyn94687djrgrvpb413wly2v4iya06p2-mesa-19.2.1/lib/libgbm.so.1
[Current thread is 1 (Thread 0x7f4891e7a640 (LWP 3533))]
(gdb) bt full
#0 0x00007f4895557af0 in gbm_bo_get_user_data () from /nix/store/qyn94687djrgrvpb413wly2v4iya06p2-mesa-19.2.1/lib/libgbm.so.1
No symbol table info available.
#1 0x00007f4895d0d15f in get_fb_for_bo () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#2 0x00007f4895d0803f in drm_connector_pageflip_renderer () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#3 0x00007f4895d0815b in drm_connector_init_renderer () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#4 0x00007f4895d097cc in drm_connector_set_mode () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#5 0x000000000042e4d3 in apply_output_config (oc=oc@entry=0xd3e0f0, output=output@entry=0xd3ddf0) at ../sway/config/output.c:276
mode = <optimized out>
wlr_output = 0xd03dc0
modeset_success = <optimized out>
output_box = <optimized out>
#6 0x000000000044e380 in output_enable (output=output@entry=0xd3ddf0, oc=0xd3e0f0) at ../sway/tree/output.c:118
__PRETTY_FUNCTION__ = "output_enable"
wlr_output = 0xd03dc0
len = 4
ws = <optimized out>
#7 0x000000000041d11a in handle_new_output (listener=0x46fe00 <server+64>, data=0xd03dc0) at ../sway/desktop/output.c:811
server = 0x46fdc0 <server>
wlr_output = 0xd03dc0
output = 0xd3ddf0
oc = <optimized out>
#8 0x00007f4895d48c0c in wlr_signal_emit_safe () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#9 0x00007f4895d48c0c in wlr_signal_emit_safe () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#10 0x00007f4895d0acfb in scan_drm_connectors () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#11 0x00007f4895d07641 in backend_start () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#12 0x00007f4895d114c5 in multi_backend_start () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#13 0x000000000041963a in server_start (server=server@entry=0x46fdc0 <server>) at ../sway/server.c:194
No locals.
#14 0x000000000040e54a in main (argc=<optimized out>, argv=0x7ffd3b33bdf8) at ../sway/main.c:388
verbose = 0
debug = 0
validate = 0
allow_unsupported_gpu = 0
long_options = {{name = 0x45444b "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x457375 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x454450 "validate", has_arg = 0, flag = 0x0, val = 67}, {
name = 0x454459 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x4543af "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x4534b9 "verbose", has_arg = 0, flag = 0x0, val = 86}, {
name = 0x45445f "get-socketpath", has_arg = 0, flag = 0x0, val = 112}, {name = 0x45446e "unsupported-gpu", has_arg = 0, flag = 0x0, val = 117}, {name = 0x45447e "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 = 0x4547b0 "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>
(gdb) quit |
I have the same problem. Sometimes sway crashes immediately after connecting and sometimes when I try to change screen resolution.
|
yet another trace, but looks slightly different... (This might be a resume crash, but it only happens when connected to external monitors while resuming) |
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
@emersion I'm the original reporter. I just updated both wlroots and sway to latest git. Unfortunately I'm still crashing every time here so while several bugs were fixed, the one I'm experiencing wasn't fixed by the pull request in wlroots. |
Please provide a new backtrace. |
Above log and backtrace from build of |
And again, sway only crashes when the external display is connected. |
It's very likely that you're still building with an outdated wlroots. Please double-check that there's no outdated wlroots in e.g. |
@johnae I had to reboot after updating wlroots and sway for the problem to disappear. |
@emersion @MatthiasCoppens - since I'm on NixOS it's virtually guaranteed not to be an outdated wlroots (there is no /usr/local at all). I update sway and wlroots in lock step at all times. In the special build I made for generating the backtrace and log I just did a clone of wlroots and sway, then I modded the pc-file in wlroots a bit so that I could build sway using that wlroots. This isn't the way I normally build sway and wlroots but I just wanted to ensure we got a meaningful backtrace. I still crash the same way when using sway/wlroots from my own package definitions. |
Thanks for your suggestions anyway. Can I provide something more than this? And is the backtrace helpful at all? Just want to give as much info on this as I can. |
Here's what ldd says for this build of sway:
Eg.
And the wlroots referenced there is the clone and build I did of wlroots which is commit swaywm/wlroots@6ca8208 |
Attaching a new log and backtrace from when I connect to the monitor at work which isn't a HIDPI-display. The only thing that seems a bit different is that sway actually manages to very briefly display something before it crashes. Seems to take a bit longer to crash basically. |
Seems like |
Issue resurfaced. |
Just want to, again, mention that reverting this commit f576bcd allows me to run sway/wlroots from HEAD again. |
@RedSoxFan that doesn't fix it. This was reopened because it is still crashing after that fix as you can see from the conversation. |
Uh sorry. I guess when I updated my fork it auto closed it again.. Which is stupid... |
I upgraded my distro from Fedora 30 to 31 and I cannot get sway to crash anymore. I don't know if it is related but it's strange nonetheless. |
@Emantor This should already be handled by https://github.com/swaywm/wlroots/blob/master/types/wlr_output.c#L408 |
@Emantor After applying the patch on top of HEAD of sway, I'm not able to compile sway:
|
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
Please give swaywm/wlroots#1951 a try |
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
@ascent12 hmm, guess this was automatically closed again by your pull or seomthing? Can we reopen? Was about to test the wlroots pull. |
Or maybe this can stay closed. @emersion seems that the fix in wlroots solved my issue. Writing this in sway connected to my external monitor with the fix in wlroots applied. No crash. Thanks! |
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
When surf->gbm was previously set, we destroy it without setting it to NULL. Later on, we only create the GBM surface if surf->gbm is NULL. This result in a use-after-free when we start using surf->gbm. Closes: swaywm#1868 Closes: swaywm#1874 Closes: swaywm/sway#4785 Closes: swaywm/sway#4717 Closes: swaywm/sway#4730 Fixes: 2bdd1d0 ("backend/drm: use modifiers for our GBM buffers")
`mode` points to an invalid pointer (head of the list) when the loop stops. Closes: swaywm/sway#4717
This commit: f576bcd - crashes sway when my external monitor is connected.
sway.log
dmesg.log
The text was updated successfully, but these errors were encountered: