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

Sway crashes when external monitor is connected #4717

Closed
johnae opened this issue Nov 9, 2019 · 30 comments · Fixed by swaywm/wlroots#1944 or swaywm/wlroots#1951
Closed

Sway crashes when external monitor is connected #4717

johnae opened this issue Nov 9, 2019 · 30 comments · Fixed by swaywm/wlroots#1944 or swaywm/wlroots#1951
Labels
bug Not working as intended

Comments

@johnae
Copy link
Contributor

johnae commented Nov 9, 2019

This commit: f576bcd - crashes sway when my external monitor is connected.

sway.log
dmesg.log

@emersion
Copy link
Member

emersion commented Nov 9, 2019

Please provide a stack trace. You can do so by running coredumpctl gdb and then bt full.

@johnae
Copy link
Contributor Author

johnae commented Nov 10, 2019

coredumpctl gdb
           PID: 6323 (sway)
           UID: 1337 (john)
           GID: 100 (users)
        Signal: 11 (SEGV)
     Timestamp: Sun 2019-11-10 10:28:54 CET (4min 56s ago)
  Command Line: sway -d
    Executable: /nix/store/iqx987a41781x372g28daf072sh5xxkd-sway-f576bcdb8cb3ed1506ad03503815ad159c1c0479/bin/sway
 Control Group: /user.slice/user-1337.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1337.slice
       Session: 3
     Owner UID: 1337 (john)
       Boot ID: 3e65....removed.....
    Machine ID: dce4....removed.....
      Hostname: europa
       Storage: /var/lib/systemd/coredump/core.sway.1337.3e65e75fabc841e6a6c8bc1784b4f0b6.6323.1573378134000000000000.lz4
       Message: Process 6323 (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 /nix/store/iqx987a41781x372g28daf072sh5xxkd-sway-f576bcdb8cb3ed1506ad03503815ad159c1c0479/bin/sway...
(No debugging symbols found in /nix/store/iqx987a41781x372g28daf072sh5xxkd-sway-f576bcdb8cb3ed1506ad03503815ad159c1c0479/bin/sway)
[New LWP 6323]
[New LWP 6325]
[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 `sway -d'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fe1158e2af0 in gbm_bo_get_user_data () from /nix/store/qyn94687djrgrvpb413wly2v4iya06p2-mesa-19.2.1/lib/libgbm.so.1
[Current thread is 1 (Thread 0x7fe112205640 (LWP 6323))]
(gdb) bt full
#0  0x00007fe1158e2af0 in gbm_bo_get_user_data () from /nix/store/qyn94687djrgrvpb413wly2v4iya06p2-mesa-19.2.1/lib/libgbm.so.1
No symbol table info available.
#1  0x00007fe11609815f in get_fb_for_bo () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#2  0x00007fe11609303f in drm_connector_pageflip_renderer () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#3  0x00007fe11609315b in drm_connector_init_renderer () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#4  0x00007fe1160947cc 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 ()
No symbol table info available.
#6  0x000000000044e380 in output_enable ()
No symbol table info available.
#7  0x000000000041d11a in handle_new_output ()
No symbol table info available.
#8  0x00007fe1160d3c0c in wlr_signal_emit_safe () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#9  0x00007fe1160d3c0c in wlr_signal_emit_safe () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#10 0x00007fe116095cfb in scan_drm_connectors () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#11 0x00007fe116092641 in backend_start () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#12 0x00007fe11609c4c5 in multi_backend_start () from /nix/store/q3v5ca6dqxw8slp5hf04f9rfxv15q57q-wlroots/lib/libwlroots.so.3
No symbol table info available.
#13 0x000000000041963a in server_start ()
No symbol table info available.
#14 0x000000000040e54a in main ()
No symbol table info available.
(gdb) quit

@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?

@johnae
Copy link
Contributor Author

johnae commented Nov 10, 2019

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

@Vorsplummi
Copy link

I have the same problem. Sometimes sway crashes immediately after connecting and sometimes when I try to change screen resolution.

sway version 1.2-37afbc4d (Nov 14 2019, branch 'master')

Backtrace.

@J0nnyMak0
Copy link
Contributor

J0nnyMak0 commented Nov 14, 2019

yet another trace, but looks slightly different...
gdb.txt

(This might be a resume crash, but it only happens when connected to external monitors while resuming)

@emersion emersion added the bug Not working as intended label Nov 27, 2019
@emersion emersion added this to the 1.3 milestone Nov 27, 2019
emersion added a commit to emersion/wlroots that referenced this issue Dec 5, 2019
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")
@johnae
Copy link
Contributor Author

johnae commented Dec 6, 2019

@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.

@emersion
Copy link
Member

emersion commented Dec 6, 2019

Please provide a new backtrace.

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

backtrace.txt
sway.log

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

Above log and backtrace from build of
sway 2d0f15d
wlroots: swaywm/wlroots@6ca8208

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

And again, sway only crashes when the external display is connected.

@emersion
Copy link
Member

emersion commented Dec 8, 2019

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. /usr/local.

@MatthiasCoppens
Copy link

@johnae I had to reboot after updating wlroots and sway for the problem to disappear.

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

@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.

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

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.

@johnae
Copy link
Contributor Author

johnae commented Dec 8, 2019

Here's what ldd says for this build of sway:

	linux-vdso.so.1 (0x00007fffca754000)
	libcairo.so.2 => /nix/store/kwcvlsfyd9k9m159jz5j61pkrnj7x6va-cairo-1.16.0/lib/libcairo.so.2 (0x00007fa1b843f000)
	libjson-c.so.4 => /nix/store/q6n7dxs4siags6hsmmhfvarcrqc8m8r7-json-c-0.13.1/lib/libjson-c.so.4 (0x00007fa1b842b000)
	libevdev.so.2 => /nix/store/d78hl6dzwfd5n13jwjf0k438crab9rjd-libevdev-1.8.0/lib/libevdev.so.2 (0x00007fa1b840e000)
	libinput.so.10 => /nix/store/ka1miz99f442230gp352zc9jyav7wpl9-libinput-1.14.3/lib/libinput.so.10 (0x00007fa1b83c0000)
	libm.so.6 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libm.so.6 (0x00007fa1b822a000)
	libpango-1.0.so.0 => /nix/store/m6hifnw53wmh21k3g8a8d0qiz3xi467w-pango-1.43.0/lib/libpango-1.0.so.0 (0x00007fa1b81e0000)
	libgobject-2.0.so.0 => /nix/store/knakqpfzni62a84q17qz9syisnf6p5gm-glib-2.62.2/lib/libgobject-2.0.so.0 (0x00007fa1b8184000)
	libglib-2.0.so.0 => /nix/store/knakqpfzni62a84q17qz9syisnf6p5gm-glib-2.62.2/lib/libglib-2.0.so.0 (0x00007fa1b805b000)
	libpcre.so.1 => /nix/store/gqfgvx5b5c2qj75l91iadh9cjd1hibfd-pcre-8.43/lib/libpcre.so.1 (0x00007fa1b7fe8000)
	libGLESv2.so.2 => /nix/store/rqb1ifadqzh1fbkx5aqnq00nfm2dch64-libglvnd-1.2.0/lib/libGLESv2.so.2 (0x00007fa1b7fd1000)
	libpixman-1.so.0 => /nix/store/4wag8lmydcg8lp647c0mxcszfsiv62j2-pixman-0.38.4/lib/libpixman-1.so.0 (0x00007fa1b7f26000)
	libwayland-server.so.0 => /nix/store/9m2d63fvw042ny9pdc7k8hii927lc8mg-wayland-1.17.0/lib/libwayland-server.so.0 (0x00007fa1b7f10000)
	libwlroots.so.3 => /home/john/Development/sway-debug/wlroots/build/libwlroots.so.3 (0x00007fa1b7e62000)
	libxkbcommon.so.0 => /nix/store/712y93lp3qv0j8ywq32sr8wdkmiqzrzl-libxkbcommon-0.8.4/lib/libxkbcommon.so.0 (0x00007fa1b7e1e000)
	libxcb.so.1 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb.so.1 (0x00007fa1b7df3000)
	libpangocairo-1.0.so.0 => /nix/store/m6hifnw53wmh21k3g8a8d0qiz3xi467w-pango-1.43.0/lib/libpangocairo-1.0.so.0 (0x00007fa1b7de3000)
	libc.so.6 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libc.so.6 (0x00007fa1b7c2d000)
	libpthread.so.0 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libpthread.so.0 (0x00007fa1b7c0a000)
	libfontconfig.so.1 => /nix/store/xghnmcg4d2c2rql8z22b8dx6mzksw4ff-fontconfig-2.12.6-lib/lib/libfontconfig.so.1 (0x00007fa1b7bc2000)
	libfreetype.so.6 => /nix/store/vqlq4rs0nwwz49cfzqjxacprpygf437r-freetype-2.10.1/lib/libfreetype.so.6 (0x00007fa1b7b02000)
	libEGL.so.1 => /nix/store/rqb1ifadqzh1fbkx5aqnq00nfm2dch64-libglvnd-1.2.0/lib/libEGL.so.1 (0x00007fa1b7aed000)
	libdl.so.2 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libdl.so.2 (0x00007fa1b7ae8000)
	libpng16.so.16 => /nix/store/a6kjbjvdcj3hsiqwm5li9k58ik2ymy1k-libpng-apng-1.6.37/lib/libpng16.so.16 (0x00007fa1b7aad000)
	libxcb-shm.so.0 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb-shm.so.0 (0x00007fa1b7aa8000)
	libxcb-render.so.0 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb-render.so.0 (0x00007fa1b7a98000)
	libXrender.so.1 => /nix/store/i5wgvmsfknmmml9z9lxbgy36f36kgn18-libXrender-0.9.10/lib/libXrender.so.1 (0x00007fa1b7a8b000)
	libX11.so.6 => /nix/store/wy0kwpj6fnkhzr77s2fvkm37v40pmczy-libX11-1.6.8/lib/libX11.so.6 (0x00007fa1b7948000)
	libXext.so.6 => /nix/store/y322bgylrib707hlvdp1g290v90hkciw-libXext-1.3.4/lib/libXext.so.6 (0x00007fa1b7933000)
	libz.so.1 => /nix/store/8wanm00dzn5vlajz1rznbf6dbj8931d6-zlib-1.2.11/lib/libz.so.1 (0x00007fa1b7912000)
	libGL.so.1 => /nix/store/rqb1ifadqzh1fbkx5aqnq00nfm2dch64-libglvnd-1.2.0/lib/libGL.so.1 (0x00007fa1b7877000)
	librt.so.1 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/librt.so.1 (0x00007fa1b786d000)
	/nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007fa1b8579000)
	libmtdev.so.1 => /nix/store/kpjvpd46ly5yj4k6g5isxrsfvz8xdili-mtdev-1.1.5/lib/libmtdev.so.1 (0x00007fa1b7865000)
	libudev.so.1 => /nix/store/vazmyn3svfzs3zq0gmpapplr3nwaffql-systemd-243-lib/lib/libudev.so.1 (0x00007fa1b7832000)
	libwacom.so.2 => /nix/store/4lyd3m6kddcqdrqnf0xjjy9yvgwi2a61-libwacom-1.1/lib/libwacom.so.2 (0x00007fa1b7823000)
	libfribidi.so.0 => /nix/store/8v9z9p2q2qmja8cjnmz92w0r73vnx322-fribidi-1.0.7/lib/libfribidi.so.0 (0x00007fa1b7805000)
	libffi.so.6 => /nix/store/5h4mz4l2y4d7p7z2cp0l6d8d5mck7i32-libffi-3.2.1/lib/../lib64/libffi.so.6 (0x00007fa1b77f9000)
	libGLdispatch.so.0 => /nix/store/rqb1ifadqzh1fbkx5aqnq00nfm2dch64-libglvnd-1.2.0/lib/libGLdispatch.so.0 (0x00007fa1b7738000)
	libcap.so.2 => /nix/store/i8rfylg7gcn29wk9lm4ff8fmdwch6srn-libcap-2.27-lib/lib/libcap.so.2 (0x00007fa1b7731000)
	libsystemd.so.0 => /nix/store/vazmyn3svfzs3zq0gmpapplr3nwaffql-systemd-243-lib/lib/libsystemd.so.0 (0x00007fa1b7677000)
	libwayland-client.so.0 => /nix/store/9m2d63fvw042ny9pdc7k8hii927lc8mg-wayland-1.17.0/lib/libwayland-client.so.0 (0x00007fa1b7663000)
	libwayland-egl.so.1 => /nix/store/9m2d63fvw042ny9pdc7k8hii927lc8mg-wayland-1.17.0/lib/libwayland-egl.so.1 (0x00007fa1b765e000)
	libdrm.so.2 => /nix/store/n0fcbk370k2xyka8sxsf17brk4m14l2b-libdrm-2.4.100/lib/libdrm.so.2 (0x00007fa1b7649000)
	libgbm.so.1 => /nix/store/0ikp40cvhxvxlcslyxzfxy4vnry49bal-mesa-19.2.6/lib/libgbm.so.1 (0x00007fa1b7638000)
	libxcb-composite.so.0 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb-composite.so.0 (0x00007fa1b7633000)
	libxcb-xfixes.so.0 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb-xfixes.so.0 (0x00007fa1b7629000)
	libxcb-errors.so.0 => /nix/store/i9lczjgz8lmb1xz7qmzaq2sg8b9axw2m-xcb-util-errors-1.0/lib/libxcb-errors.so.0 (0x00007fa1b761b000)
	libxcb-icccm.so.4 => /nix/store/z851k4a44h0xim2wg0jdmgs25p8bm44h-xcb-util-wm-0.4.1/lib/libxcb-icccm.so.4 (0x00007fa1b7613000)
	libfreerdp2.so.2 => /nix/store/a7iwp34h4yqsxpvbr5k0dcmw8lvmic4n-freerdp-2.0.0-rc4/lib/libfreerdp2.so.2 (0x00007fa1b74a0000)
	libwinpr2.so.2 => /nix/store/a7iwp34h4yqsxpvbr5k0dcmw8lvmic4n-freerdp-2.0.0-rc4/lib/libwinpr2.so.2 (0x00007fa1b738a000)
	libX11-xcb.so.1 => /nix/store/wy0kwpj6fnkhzr77s2fvkm37v40pmczy-libX11-1.6.8/lib/libX11-xcb.so.1 (0x00007fa1b7385000)
	libxcb-xinput.so.0 => /nix/store/8j6syp2y60f2j915m475ymliz9hhngsj-libxcb-1.13.1/lib/libxcb-xinput.so.0 (0x00007fa1b735e000)
	libXau.so.6 => /nix/store/1pindigwb468nhhh2bcl17js9w5lyy87-libXau-1.0.9/lib/libXau.so.6 (0x00007fa1b7359000)
	libXdmcp.so.6 => /nix/store/yy4gw52bh1yak7s68ia03fdvn5f2pj8p-libXdmcp-1.1.3/lib/libXdmcp.so.6 (0x00007fa1b7351000)
	libpangoft2-1.0.so.0 => /nix/store/m6hifnw53wmh21k3g8a8d0qiz3xi467w-pango-1.43.0/lib/libpangoft2-1.0.so.0 (0x00007fa1b7337000)
	libbz2.so.1 => /nix/store/ndgvwzxcf05cg2xfa4443zvz8x9jmirc-bzip2-1.0.6.0.1/lib/libbz2.so.1 (0x00007fa1b7322000)
	libexpat.so.1 => /nix/store/dvi67hzkwbq94aa9flqd5qz3n7wf6ip0-expat-2.2.8/lib/libexpat.so.1 (0x00007fa1b72e5000)
	libGLX.so.0 => /nix/store/rqb1ifadqzh1fbkx5aqnq00nfm2dch64-libglvnd-1.2.0/lib/libGLX.so.0 (0x00007fa1b72b0000)
	libgudev-1.0.so.0 => /nix/store/ga9v8ldr627x39a98nx5nflh6yg83xnz-libgudev-233/lib/libgudev-1.0.so.0 (0x00007fa1b72a3000)
	liblzma.so.5 => /nix/store/l9d2ycm68b007la6aag0qhxlwrdi3hsj-xz-5.2.4/lib/liblzma.so.5 (0x00007fa1b7277000)
	liblz4.so.1 => /nix/store/wi4jj6psx4cicii33xc15x2xsxz01j9j-lz4-1.9.1/lib/liblz4.so.1 (0x00007fa1b7243000)
	libgcrypt.so.20 => /nix/store/pg89pi9h91bvqs9mnwm3r8hiapjylig9-libgcrypt-1.8.5/lib/libgcrypt.so.20 (0x00007fa1b7124000)
	libssl.so.1.1 => /nix/store/d86czzx6rlm7la0xi6h6chy78wy755wk-openssl-1.1.1d/lib/libssl.so.1.1 (0x00007fa1b708c000)
	libcrypto.so.1.1 => /nix/store/d86czzx6rlm7la0xi6h6chy78wy755wk-openssl-1.1.1d/lib/libcrypto.so.1.1 (0x00007fa1b6da3000)
	libxkbfile.so.1 => /nix/store/831b0fp43245lyqhnv1zflkl70yfa2pb-libxkbfile-1.1.0/lib/libxkbfile.so.1 (0x00007fa1b6d7a000)
	libavcodec.so.57 => /nix/store/y4m6ggwdfq9h8nnqn5vd5ji71zfdkf7d-ffmpeg-3.4.6/lib/libavcodec.so.57 (0x00007fa1b591e000)
	libavutil.so.55 => /nix/store/y4m6ggwdfq9h8nnqn5vd5ji71zfdkf7d-ffmpeg-3.4.6/lib/libavutil.so.55 (0x00007fa1b58a3000)
	libswresample.so.2 => /nix/store/y4m6ggwdfq9h8nnqn5vd5ji71zfdkf7d-ffmpeg-3.4.6/lib/libswresample.so.2 (0x00007fa1b5882000)
	libharfbuzz.so.0 => /nix/store/8ysqq2h8r5yhhglnk15nxpiciqdgyp5w-harfbuzz-2.6.4/lib/libharfbuzz.so.0 (0x00007fa1b5778000)
	libgio-2.0.so.0 => /nix/store/knakqpfzni62a84q17qz9syisnf6p5gm-glib-2.62.2/lib/libgio-2.0.so.0 (0x00007fa1b55b2000)
	libgpg-error.so.0 => /nix/store/fvlkiwdl891w2gimrax1q7jj04zfcbgr-libgpg-error-1.36/lib/libgpg-error.so.0 (0x00007fa1b558e000)
	libva.so.2 => /nix/store/mzxw1adlr6zk9xjfsr8dwaiyssnpj1cn-libva-2.5.0/lib/libva.so.2 (0x00007fa1b5565000)
	libxvidcore.so.4 => /nix/store/bxrh9lcmcw284f88cgc6927635ywdncv-xvidcore-1.3.5/lib/libxvidcore.so.4 (0x00007fa1b5451000)
	libx265.so.179 => /nix/store/s0b5xj08ixn46mc3znbrpck1kiwpf8w1-x265-3.2/lib/libx265.so.179 (0x00007fa1b4eb6000)
	libx264.so.157 => /nix/store/kjxjjq7kylmjvi15yy04b77644j9r87q-x264-20190517-2245-lib/lib/libx264.so.157 (0x00007fa1b4b91000)
	libvpx.so.5 => /nix/store/qrc6lk3rh9swnmblw171hi0p0xbn42zv-libvpx-1.7.0/lib/libvpx.so.5 (0x00007fa1b4854000)
	libvorbisenc.so.2 => /nix/store/v50b77fz7gd8ndv2imwrcinn918wscc1-libvorbis-1.3.6/lib/libvorbisenc.so.2 (0x00007fa1b47a7000)
	libvorbis.so.0 => /nix/store/v50b77fz7gd8ndv2imwrcinn918wscc1-libvorbis-1.3.6/lib/libvorbis.so.0 (0x00007fa1b4770000)
	libtheoraenc.so.1 => /nix/store/ab7m2007as5nnr10vlqjzdgl95w5hjs0-libtheora-1.1.1/lib/libtheoraenc.so.1 (0x00007fa1b472d000)
	libtheoradec.so.1 => /nix/store/ab7m2007as5nnr10vlqjzdgl95w5hjs0-libtheora-1.1.1/lib/libtheoradec.so.1 (0x00007fa1b470c000)
	libspeex.so.1 => /nix/store/m5g1zyijcm8d0wkww3c95209lvhgc4vq-speex-1.2.0/lib/libspeex.so.1 (0x00007fa1b46ef000)
	libopus.so.0 => /nix/store/lvssi0hxfwcrsc89aphjpfqxxyrals43-libopus-1.3.1/lib/libopus.so.0 (0x00007fa1b4690000)
	libmp3lame.so.0 => /nix/store/871k0zaj76w4a7ckss4k4kfz8pigypfk-lame-3.100-lib/lib/libmp3lame.so.0 (0x00007fa1b4614000)
	libvdpau.so.1 => /nix/store/irbbwypyx6q7hsa8q2i1fa13kkr1b7l0-libvdpau-1.2/lib/libvdpau.so.1 (0x00007fa1b460d000)
	libva-x11.so.2 => /nix/store/mzxw1adlr6zk9xjfsr8dwaiyssnpj1cn-libva-2.5.0/lib/libva-x11.so.2 (0x00007fa1b4605000)
	libva-drm.so.2 => /nix/store/mzxw1adlr6zk9xjfsr8dwaiyssnpj1cn-libva-2.5.0/lib/libva-drm.so.2 (0x00007fa1b45fe000)
	libsoxr.so.0 => /nix/store/r9brqcrfdnjgmy42p75rhnxcv3xg1imi-soxr-0.1.3/lib/libsoxr.so.0 (0x00007fa1b4586000)
	libgraphite2.so.3 => /nix/store/vmj6sl3lrb7zhk2k30zx0p447nd1xyhs-graphite2-1.3.6/lib/libgraphite2.so.3 (0x00007fa1b4555000)
	libgmodule-2.0.so.0 => /nix/store/knakqpfzni62a84q17qz9syisnf6p5gm-glib-2.62.2/lib/libgmodule-2.0.so.0 (0x00007fa1b454e000)
	libmount.so.1 => /nix/store/wkc0zrzr99y0nzgz24zmkaxg3184bgja-util-linux-2.33.2/lib/libmount.so.1 (0x00007fa1b44ec000)
	libselinux.so.1 => /nix/store/l5kcadbp39zhlnqp00gara4haw5rvf6y-libselinux-2.9/lib/libselinux.so.1 (0x00007fa1b44bf000)
	libresolv.so.2 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libresolv.so.2 (0x00007fa1b44a6000)
	libnuma.so.1 => /nix/store/pf92ssxsy8gx4k3p0gin6li91l203087-numactl-2.0.13/lib/libnuma.so.1 (0x00007fa1b4497000)
	libstdc++.so.6 => /nix/store/1mr01vwvg7922xp0sgd4gry54swrx19m-gcc-8.3.0-lib/lib/libstdc++.so.6 (0x00007fa1b430c000)
	libmvec.so.1 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libmvec.so.1 (0x00007fa1b42dd000)
	libgcc_s.so.1 => /nix/store/xlxiw4rnxx2dksa91fizjzf7jb5nqghc-glibc-2.27/lib/libgcc_s.so.1 (0x00007fa1b40c7000)
	libogg.so.0 => /nix/store/33v3abr6zb713frvx8c6hn740gqy115s-libogg-1.3.4/lib/libogg.so.0 (0x00007fa1b40bc000)
	libXfixes.so.3 => /nix/store/r87x7zavkbxl2avn58lm9l1a1yc2v1v1-libXfixes-5.0.3/lib/libXfixes.so.3 (0x00007fa1b40b4000)
	libgomp.so.1 => /nix/store/1mr01vwvg7922xp0sgd4gry54swrx19m-gcc-8.3.0-lib/lib/libgomp.so.1 (0x00007fa1b4083000)
	libblkid.so.1 => /nix/store/wkc0zrzr99y0nzgz24zmkaxg3184bgja-util-linux-2.33.2/lib/libblkid.so.1 (0x00007fa1b402d000)
	libuuid.so.1 => /nix/store/wkc0zrzr99y0nzgz24zmkaxg3184bgja-util-linux-2.33.2/lib/libuuid.so.1 (0x00007fa1b4024000)

Eg.

libwlroots.so.3 => /home/john/Development/sway-debug/wlroots/build/libwlroots.so.3 (0x00007fa1b7e62000)

And the wlroots referenced there is the clone and build I did of wlroots which is commit swaywm/wlroots@6ca8208

@johnae
Copy link
Contributor Author

johnae commented Dec 9, 2019

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.

backtrace2.txt
sway2.log

@emersion
Copy link
Member

emersion commented Dec 9, 2019

Seems like bo is NULL when calling get_fb_for_bo

@emersion emersion reopened this Dec 9, 2019
@emersion emersion removed this from the 1.3 milestone Dec 9, 2019
@Vorsplummi
Copy link

Issue resurfaced.

coredump.txt

@johnae
Copy link
Contributor Author

johnae commented Dec 9, 2019

Just want to, again, mention that reverting this commit f576bcd allows me to run sway/wlroots from HEAD again.

@johnae
Copy link
Contributor Author

johnae commented Dec 11, 2019

@RedSoxFan that doesn't fix it. This was reopened because it is still crashing after that fix as you can see from the conversation.

@RedSoxFan
Copy link
Member

Uh sorry. I guess when I updated my fork it auto closed it again.. Which is stupid...

@RedSoxFan RedSoxFan reopened this Dec 11, 2019
@Vorsplummi
Copy link

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
Copy link
Contributor

Emantor commented Dec 15, 2019

@emersion
Copy link
Member

@johnae
Copy link
Contributor Author

johnae commented Dec 15, 2019

@Emantor After applying the patch on top of HEAD of sway, I'm not able to compile sway:

In file included from /nix/store/9m2d63fvw042ny9pdc7k8hii927lc8mg-wayland-1.17.0/include/wayland-server-core.h:32,
                 from /home/john/Development/sway-debug/wlroots/build/include/wlr/types/wlr_cursor.h:12,
                 from ../sway/config/output.c:8:
../sway/config/output.c: In function ‘apply_output_config’:
../sway/config/output.c:349:35: error: ‘struct sway_output’ has no member named ‘modes’; did you mean ‘mode’?
    mode = wl_container_of(output->modes.prev, mode, link);

@Emantor
Copy link
Contributor

Emantor commented Dec 15, 2019

@johnae my bad, updated the branch.

@emersion you're right, but the only thing that changes is that preferred mode can now return NULL in the commit given by @johnae.

emersion added a commit to emersion/wlroots that referenced this issue Dec 15, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
@emersion
Copy link
Member

Please give swaywm/wlroots#1951 a try

ascent12 pushed a commit to swaywm/wlroots that referenced this issue Dec 16, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
@johnae
Copy link
Contributor Author

johnae commented Dec 16, 2019

@ascent12 hmm, guess this was automatically closed again by your pull or seomthing? Can we reopen? Was about to test the wlroots pull.

@johnae
Copy link
Contributor Author

johnae commented Dec 16, 2019

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!

aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
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")
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
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")
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
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")
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
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")
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
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")
aiqs4 pushed a commit to aiqs4/wlroots that referenced this issue Dec 19, 2019
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
filips pushed a commit to filips/wlroots that referenced this issue Mar 15, 2020
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")
filips pushed a commit to filips/wlroots that referenced this issue Mar 15, 2020
`mode` points to an invalid pointer (head of the list) when the loop
stops.

Closes: swaywm/sway#4717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
7 participants