swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.55k stars 1.11k forks source link

sway crash when trying to move chrome tab to different chrome window #5886

Open hypergig opened 3 years ago

hypergig commented 3 years ago

Versions

sway

sway version 1.4

ubuntu

Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

chrome

Google Chrome 87.0.4280.88

Description

Running chrome with --enable-features=UseOzonePlatform --ozone-platform=wayland options enabled, I right clicked a tab to have it move to another chrome window, and as the context menu tried opening to display other chrome windows sway hard crashed. Unfortunately, it doesn't happen every time I try so it is hard to reproduce consistently.

Configuration

Very minimal as I am in the middle of transitioning https://github.com/hypergig/workstation/pull/4/files?file-filters%5B%5D=.config

Logs

_I believe log lines with RUST_BACKTRACE is from alacritty crashing with everything else_

[4622:4622:1215/114306.212619:ERROR:page_load_metrics_update_dispatcher.cc(169)] Invalid first_paint 0.647 s for first_image_paint 0.614 s
thread 'main' panicked at 'failed to read wayland events: Connection reset by peer (os error 104)', <::std::macros::panic macros>:5:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
(EE)thread 'thread 'thread 'Gdk-Message: 11:48:06.162: Error reading events from display: Broken pipe
 mainmainmainfailed to read Wayland events: Broken pipe
' panicked at '' panicked at '' panicked at 'failed to read wayland events: Broken pipe (os error 32)failed to read wayland events: Broken pipe (os error 32)failed to read wayland events: Broken pipe (os error 32)', ', ', <::std::macros::panic macros><::std::macros::panic macros><::std::macros::panic macros>:::555:::666

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
Gdk-Message: 11:48:06.162: Error reading events from display: Broken pipe
[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
thread 'main' panicked at 'failed to read wayland events: Broken pipe (os error 32)', [2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
<::std::macros::panic macros>:5:[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Mode: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Mode: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Window: Unable to receive IPC header
[2020-12-15 11:48:06.162] [error] Workspaces: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Workspaces: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Workspaces: Unable to receive IPC header
[2020-12-15 11:48:06.163] [error] Workspaces: Unable to receive IPC header
Gdk-Message: 11:48:06.163: Error reading events from display: Broken pipe
[2020-12-15 11:48:06.163] [error] Workspaces: Unable to receive IPC header
emersion commented 3 years ago

Please provide a stack trace. You can do so by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

xofyarg commented 3 years ago

I'm having similar issue after switching to ozone chrome recently, though I haven't found a reliable way to reproduce. It happens several time per day, quite annoying.

Some information:

  1. Both sway(6059c744) and wlroots(c740fccc) are built from latest code.
  2. Coredump info
    
    [New LWP 3727874]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    Core was generated by `/tmp/sway/build/sway/sway'.
    Program terminated with signal SIGABRT, Aborted.
    #0  0x00007fcd1e919a21 in raise () from /lib64/libc.so.6
    (gdb) thread apply all bt full

Thread 1 (Thread 0x7fcd1dd1fa80 (LWP 3727874)):

0 0x00007fcd1e919a21 in raise () at /lib64/libc.so.6

1 0x00007fcd1e903536 in abort () at /lib64/libc.so.6

2 0x00007fcd2067790e in () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5

3 0x00007fcd206822c8 in () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5

4 0x00007fcd20687b28 in () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5

5 0x00007fcd20687375 in () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5

6 0x00007fcd1e91c646 in __cxa_finalize () at /lib64/libc.so.6

7 0x00007fcd20570be3 in () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5

8 0x00007ffcdbe64490 in ()

(gdb)



I don't feel backtrace is helpful, but I'm not familiar with the project. Please let me know if you need more info.
kennylevinsen commented 3 years ago

Your stack is just ASan aborting, not sway itself crashing.

Please share stderr from sway where the ASan diagnostic messages and abort reason will be. Preferably with debug output (-d) enabled.

xofyarg commented 3 years ago

Following is the stderr after crash:

...
00:19:02.770 [DEBUG] [wlr] [types/wlr_primary_selection_v1.c:149] Ignoring duplicate MIME type offer text/plain;charset=utf-8
00:19:13.155 [DEBUG] [wlr] [types/wlr_primary_selection_v1.c:149] Ignoring duplicate MIME type offer text/plain;charset=utf-8
[344159:344159:0320/172230.821968:ERROR:wayland_surface.cc(59)] Server doesn't support zwp_linux_explicit_synchronization_v1.
00:19:24.089 [DEBUG] [wlr] [types/wlr_surface.c:688] New wlr_surface 0x619000c8f080 (res 0x60c0006ee600)
00:19:28.540 [DEBUG] [sway/desktop/transaction.c:398] Transaction 0x6040004c3e90 committing with 5 instructions
00:19:28.540 [DEBUG] [sway/desktop/transaction.c:294] Applying transaction 0x6040004c3e90
i965: Failed to submit batchbuffer: Bad address

=================================================================
==343850==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4096 byte(s) in 6 object(s) allocated from:
    #0 0x7ff87653c8fe in realloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c8fe)
    #1 0x7ff874359720  (/usr/lib64/libfontconfig.so.1+0x21720)

Direct leak of 440 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff870b244e4  (/usr/lib/../lib64/libEGL_mesa.so.0+0x214e4)
    #2 0x7ff870b1d82a  (/usr/lib/../lib64/libEGL_mesa.so.0+0x1a82a)

Direct leak of 96 byte(s) in 2 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff86fd2233c  (/usr/lib64/dri/i965_dri.so+0x51733c)
    #2 0x61700008fb3f  (<unknown module>)

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff86fd2233c  (/usr/lib64/dri/i965_dri.so+0x51733c)
    #2 0x618000061ba3  (<unknown module>)

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff86fd2233c  (/usr/lib64/dri/i965_dri.so+0x51733c)
    #2 0x6160000a0af7  (<unknown module>)

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff86fd2233c  (/usr/lib64/dri/i965_dri.so+0x51733c)
    #2 0x61700008f403  (<unknown module>)

Direct leak of 37 byte(s) in 1 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x55f864193b44 in merge_output_config ../sway/config/output.c:113
    #2 0x55f86419d66a in get_output_config ../sway/config/output.c:581
    #3 0x55f86419dbfc in find_output_config ../sway/config/output.c:610
    #4 0x55f86421f917 in output_cmd_toggle ../sway/commands/output/toggle.c:24
    #5 0x55f86409cb34 in config_subcommand ../sway/commands.c:438
    #6 0x55f8641dd23c in cmd_output ../sway/commands/output.c:81
    #7 0x55f86409a9df in execute_command ../sway/commands.c:291
    #8 0x55f8641b6bb2 in seat_execute_command ../sway/commands/bind.c:631
    #9 0x55f864145308 in handle_key_event ../sway/input/keyboard.c:491
    #10 0x55f8641463d6 in handle_keyboard_group_key ../sway/input/keyboard.c:563
    #11 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #12 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #13 0x7ff875e71202 in handle_keyboard_key ../subprojects/wlroots/types/wlr_keyboard_group.c:133
    #14 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #15 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #16 0x7ff875d86ac4 in handle_keyboard_key ../subprojects/wlroots/backend/libinput/keyboard.c:82
    #17 0x7ff875d86212 in handle_libinput_event ../subprojects/wlroots/backend/libinput/events.c:237
    #18 0x7ff875d8296f in handle_libinput_readable ../subprojects/wlroots/backend/libinput/backend.c:57
    #19 0x7ff87536f431 in wl_event_loop_dispatch (/usr/lib64/libwayland-server.so.0+0xb431)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff870b15687  (/usr/lib/../lib64/libEGL_mesa.so.0+0x12687)

Direct leak of 6 byte(s) in 1 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x55f86419d607 in get_output_config ../sway/config/output.c:580
    #2 0x55f86419dbfc in find_output_config ../sway/config/output.c:610
    #3 0x55f86421f917 in output_cmd_toggle ../sway/commands/output/toggle.c:24
    #4 0x55f86409cb34 in config_subcommand ../sway/commands.c:438
    #5 0x55f8641dd23c in cmd_output ../sway/commands/output.c:81
    #6 0x55f86409a9df in execute_command ../sway/commands.c:291
    #7 0x55f8641b6bb2 in seat_execute_command ../sway/commands/bind.c:631
    #8 0x55f864145308 in handle_key_event ../sway/input/keyboard.c:491
    #9 0x55f8641463d6 in handle_keyboard_group_key ../sway/input/keyboard.c:563
    #10 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #11 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #12 0x7ff875e71202 in handle_keyboard_key ../subprojects/wlroots/types/wlr_keyboard_group.c:133
    #13 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #14 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #15 0x7ff875d86ac4 in handle_keyboard_key ../subprojects/wlroots/backend/libinput/keyboard.c:82
    #16 0x7ff875d86212 in handle_libinput_event ../subprojects/wlroots/backend/libinput/events.c:237
    #17 0x7ff875d8296f in handle_libinput_readable ../subprojects/wlroots/backend/libinput/backend.c:57
    #18 0x7ff87536f431 in wl_event_loop_dispatch (/usr/lib64/libwayland-server.so.0+0xb431)

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x55f864193d3d in merge_output_config ../sway/config/output.c:117
    #2 0x55f86419d66a in get_output_config ../sway/config/output.c:581
    #3 0x55f86419dbfc in find_output_config ../sway/config/output.c:610
    #4 0x55f86421f917 in output_cmd_toggle ../sway/commands/output/toggle.c:24
    #5 0x55f86409cb34 in config_subcommand ../sway/commands.c:438
    #6 0x55f8641dd23c in cmd_output ../sway/commands/output.c:81
    #7 0x55f86409a9df in execute_command ../sway/commands.c:291
    #8 0x55f8641b6bb2 in seat_execute_command ../sway/commands/bind.c:631
    #9 0x55f864145308 in handle_key_event ../sway/input/keyboard.c:491
    #10 0x55f8641463d6 in handle_keyboard_group_key ../sway/input/keyboard.c:563
    #11 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #12 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #13 0x7ff875e71202 in handle_keyboard_key ../subprojects/wlroots/types/wlr_keyboard_group.c:133
    #14 0x7ff875efbfcb in wlr_signal_emit_safe ../subprojects/wlroots/util/signal.c:29
    #15 0x7ff875e6d3b5 in wlr_keyboard_notify_key ../subprojects/wlroots/types/wlr_keyboard.c:93
    #16 0x7ff875d86ac4 in handle_keyboard_key ../subprojects/wlroots/backend/libinput/keyboard.c:82
    #17 0x7ff875d86212 in handle_libinput_event ../subprojects/wlroots/backend/libinput/events.c:237
    #18 0x7ff875d8296f in handle_libinput_readable ../subprojects/wlroots/backend/libinput/backend.c:57
    #19 0x7ff87536f431 in wl_event_loop_dispatch (/usr/lib64/libwayland-server.so.0+0xb431)

Indirect leak of 5952 byte(s) in 31 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff870b1e17b  (/usr/lib/../lib64/libEGL_mesa.so.0+0x1b17b)

Indirect leak of 5312 byte(s) in 166 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff874345cbf  (/usr/lib64/libfontconfig.so.1+0xdcbf)

Indirect leak of 2816 byte(s) in 88 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff874359cb8  (/usr/lib64/libfontconfig.so.1+0x21cb8)

Indirect leak of 2617 byte(s) in 210 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x7ff874358f14 in FcValueSave (/usr/lib64/libfontconfig.so.1+0x20f14)

Indirect leak of 2304 byte(s) in 72 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff8743591a7  (/usr/lib64/libfontconfig.so.1+0x211a7)

Indirect leak of 768 byte(s) in 24 object(s) allocated from:
    #0 0x7ff87653c6be in __interceptor_calloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c6be)
    #1 0x7ff874359046  (/usr/lib64/libfontconfig.so.1+0x21046)

Indirect leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7ff87653c8fe in realloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c8fe)
    #1 0x7ff870b15637  (/usr/lib/../lib64/libEGL_mesa.so.0+0x12637)

Indirect leak of 192 byte(s) in 4 object(s) allocated from:
    #0 0x7ff87653c4c8 in __interceptor_malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x10c4c8)
    #1 0x7ff8743532ed in FcLangSetCreate (/usr/lib64/libfontconfig.so.1+0x1b2ed)

Indirect leak of 15 byte(s) in 1 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x7ff8744d1ba8 in drmGetDeviceNameFromFd2 (/usr/lib64/libdrm.so.2+0xaba8)

Indirect leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7ff8764c515d in strdup (/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libasan.so.5+0x9515d)
    #1 0x7ff870b245d1  (/usr/lib/../lib64/libEGL_mesa.so.0+0x215d1)
    #2 0x7ff870b1d82a  (/usr/lib/../lib64/libEGL_mesa.so.0+0x1a82a)

SUMMARY: AddressSanitizer: 25093 byte(s) leaked in 614 allocation(s).
Gdk-Message: 17:22:36.856: Error reading events from display: Broken pipe
Gdk-Message: 17:22:36.857: Error reading events from display: Broken pipe
(EE) failed to read Wayland events: Broken pipe
kennylevinsen commented 3 years ago

This doesn't appear to be the same as your ASan crash. The LeakSanitizer warnings are just the result of us not deallocating memory on shutdown, while the previous crash was an AddressSanitizer abort.

The only interesting message here is:

i965: Failed to submit batchbuffer: Bad address
xofyarg commented 3 years ago

That's odd, I can see the crash in coredumpctl though:

Sun 2021-03-21 00:22:38 UTC 343850 1000 1000 6 error /tmp/sway/build/sway/sway