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 when disconnecting/reconnecting monitor #906

Closed
rmrfbugs opened this issue Oct 5, 2024 · 22 comments
Closed

Crash when disconnecting/reconnecting monitor #906

rmrfbugs opened this issue Oct 5, 2024 · 22 comments

Comments

@rmrfbugs
Copy link

rmrfbugs commented Oct 5, 2024

Distro: Arch Linux
Version: cosmic-comp 1.0.0.alpha.2-1

When reconnecting the monitor (happens when turning monitor back on according to timestamp) cosmic-comp crashes, taking all open programs with it.

Logs:

Oct 05 13:45:24 cosmic cosmic-comp[1501]: thread 'main' panicked at 'called `Option::unwrap()` on a `None` value': src/shell/mod.rs:973
                                             0: <unknown>
                                             1: <unknown>
                                             2: <unknown>
                                             3: <unknown>
                                             4: <unknown>
                                             5: <unknown>
                                             6: <unknown>
                                             7: <unknown>
                                             8: <unknown>
                                             9: <unknown>
                                            10: <unknown>
                                            11: <unknown>
                                            12: <unknown>
                                            13: <unknown>
                                            14: <unknown>
                                            15: <unknown>
                                            16: <unknown>
                                            17: <unknown>
                                            18: <unknown>
                                            19: <unknown>
                                            20: __libc_start_main
                                            21: <unknown>
Oct 05 13:45:24 cosmic cosmic-comp[1501]: thread 'surface-HDMI-A-1' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }': src/backend/kms/surface/mod.rs:1076
                                             0: <unknown>
                                             1: <unknown>
                                             2: <unknown>
                                             3: <unknown>
                                             4: <unknown>
                                             5: <unknown>
                                             6: <unknown>
                                             7: <unknown>
                                             8: <unknown>
                                             9: <unknown>
                                            10: <unknown>
                                            11: <unknown>
                                            12: <unknown>
                                            13: <unknown>
                                            14: <unknown>
                                            15: <unknown>
                                            16: <unknown>
                                            17: <unknown>
Oct 05 13:45:24 cosmic xdg-desktop-por[1752]: Error reading events from display: Broken pipe
Oct 05 13:45:24 cosmic cosmic-session[1476]: Io error: Broken pipe (os error 32)
Oct 05 13:45:24 cosmic systemd[1463]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=1/FAILURE
Oct 05 13:45:24 cosmic systemd[1463]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Oct 05 13:45:24 cosmic cosmic-session[1476]: process ' COSMIC_SESSION_SOCK=12 cosmic-comp ' failed with code 101
Oct 05 13:45:24 cosmic cosmic-session[1476]: cosmic-comp exited with error code 101
Oct 05 13:45:24 cosmic cosmic-session[1476]: draining stdin receiver before restarting process
Oct 05 13:45:24 cosmic cosmic-session[1476]: sleeping for 0ms before restarting process cosmic-comp (restart 0)
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(11v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(10v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(9v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(8v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(7v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(6v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(5v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(4v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(3v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(2v1)' cancelled
Oct 05 13:45:24 cosmic cosmic-session[1476]: RESTARTING: session restarted by request
Oct 05 13:45:24 cosmic cosmic-session[1476]: restarted process ' COSMIC_SESSION_SOCK=12 cosmic-comp ', now at 1 restarts
Oct 05 13:45:24 cosmic cosmic-session[1476]: process 'ProcessKey(1v1)' cancelled
Oct 05 13:45:26 cosmic systemd[1463]: Stopped target Cosmic Session Target.
Oct 05 13:45:26 cosmic systemd[1463]: Stopped target Current graphical user session.
Oct 05 13:45:26 cosmic systemd[1463]: Stopped target Session services which should run early before the graphical session is brought up.
Oct 05 13:45:26 cosmic systemd[1463]: Stopped target Startup of XDG autostart applications.
Oct 05 13:45:26 cosmic dbus-broker[1823]: Dispatched 20 messages @ 3(±4)μs / message.
Oct 05 13:45:26 cosmic cosmic-session[1476]: Restarting
Oct 05 13:45:26 cosmic systemd[1463]: Stopping Accessibility services bus...
Oct 05 13:45:26 cosmic systemd[1463]: Stopping Portal service...
Oct 05 13:45:26 cosmic systemd[1463]: Stopping flatpak document portal service...
Oct 05 13:45:26 cosmic systemd[1463]: Stopping sandboxed app permission store...
Oct 05 13:45:26 cosmic systemd[1463]: Stopped sandboxed app permission store.
Oct 05 13:45:26 cosmic cosmic-session[1476]: Starting cosmic-session
@RingOfStormsBot
Copy link

RingOfStormsBot commented Oct 12, 2024

I am also experiencing this and is bad enough for me to need to use another DE for a while. Since switching with a KVM causes this to wipe my entire desktop and all apps close every time I switch computers.

The error occurs when I re-connect with the KVM. The first 1:27:28 timestamps is me switching to my other machine. I waited 20 seconds or so and connected back, which is when the 1:27:49 logs with the error occurs.

Oct 12 01:27:28 lio kernel: usb 1-5.3: USB disconnect, device number 21
Oct 12 01:27:28 lio kernel: usb 1-5.3.1: USB disconnect, device number 22
Oct 12 01:27:28 lio acpid[1300]: input device has been disconnected, fd 22
Oct 12 01:27:28 lio kernel: usb 2-5.3: USB disconnect, device number 6
Oct 12 01:27:28 lio kernel: usb 1-5.3.3: USB disconnect, device number 23
Oct 12 01:27:28 lio kernel: usb 1-5.3.4: USB disconnect, device number 24
Oct 12 01:27:49 lio kernel: usb 2-5.3: new SuperSpeed USB device number 7 using xhci_hcd
Oct 12 01:27:49 lio kernel: usb 2-5.3: New USB device found, idVendor=2109, idProduct=0817, bcdDevice=90.54
Oct 12 01:27:49 lio kernel: usb 2-5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 12 01:27:49 lio kernel: usb 2-5.3: Product: USB3.0 Hub
Oct 12 01:27:49 lio kernel: usb 2-5.3: Manufacturer: VIA Labs, Inc.
Oct 12 01:27:49 lio kernel: hub 2-5.3:1.0: USB hub found
Oct 12 01:27:49 lio kernel: hub 2-5.3:1.0: 3 ports detected
Oct 12 01:27:49 lio wireplumber[2619]: wplua: [string "alsa.lua"]:182: attempt to concatenate a nil value (local 'node_name')
                                       stack traceback:
                                               [string "alsa.lua"]:182: in function <[string "alsa.lua"]:175>
Oct 12 01:27:49 lio kernel: usb 1-5.3: new high-speed USB device number 25 using xhci_hcd
Oct 12 01:27:49 lio .cosmic-comp-wrapped[12269]: thread 'main' panicked at 'called `Option::unwrap()` on a `None` value': src/shell/mod.rs:972
                                                    0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                    1: log_panics::Config::install_panic_hook::{{closure}}
                                                    2: std::panicking::rust_panic_with_hook
                                                    3: std::panicking::begin_panic_handler::{{closure}}
                                                    4: std::sys::backtrace::__rust_end_short_backtrace
                                                    5: rust_begin_unwind
                                                    6: core::panicking::panic_fmt
                                                    7: core::panicking::panic
                                                    8: core::option::unwrap_failed
                                                    9: cosmic_comp::shell::Workspaces::active
                                                   10: cosmic_comp::input::<impl cosmic_comp::state::State>::surface_under
                                                   11: cosmic_comp::shell::focus::<impl cosmic_comp::state::Common>::refresh_focus
                                                   12: calloop::loop_logic::EventLoop<Data>::run
                                                   13: cosmic_comp::main
                                                   14: std::sys::backtrace::__rust_begin_short_backtrace
                                                   15: main
                                                   16: __libc_start_call_main
                                                   17: __libc_start_main@GLIBC_2.2.5
                                                   18: _start
Oct 12 01:27:49 lio .cosmic-comp-wrapped[12269]: thread 'surface-DP-3' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }': src/backend/kms/surface/mod.rs:1076
                                                    0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                    1: log_panics::Config::install_panic_hook::{{closure}}
                                                    2: std::panicking::rust_panic_with_hook
                                                    3: std::panicking::begin_panic_handler::{{closure}}
                                                    4: std::sys::backtrace::__rust_end_short_backtrace
                                                    5: rust_begin_unwind
                                                    6: core::panicking::panic_fmt
                                                    7: core::result::unwrap_failed
                                                    8: cosmic_comp::backend::kms::surface::SurfaceThreadState::redraw
                                                    9: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
                                                   10: cosmic_comp::backend::kms::surface::surface_thread
                                                   11: std::sys::backtrace::__rust_begin_short_backtrace
                                                   12: core::ops::function::FnOnce::call_once{{vtable.shim}}
                                                   13: std::sys::pal::unix::thread::Thread::new::thread_start
                                                   14: start_thread
                                                   15: clone3
Oct 12 01:27:49 lio kernel: usb 1-5.3: New USB device found, idVendor=2109, idProduct=2817, bcdDevice=90.54
Oct 12 01:27:49 lio kernel: usb 1-5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 12 01:27:49 lio kernel: usb 1-5.3: Product: USB2.0 Hub
Oct 12 01:27:49 lio kernel: usb 1-5.3: Manufacturer: VIA Labs, Inc.
Oct 12 01:27:49 lio .xdg-desktop-po[12620]: Error reading events from display: Broken pipe
Oct 12 01:27:49 lio cosmic-session[2398]: Io error: Broken pipe (os error 32)
Oct 12 01:27:49 lio systemd[2381]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=1/FAILURE
Oct 12 01:27:49 lio systemd[2381]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Oct 12 01:27:49 lio kernel: hub 1-5.3:1.0: USB hub found
Oct 12 01:27:49 lio kernel: hub 1-5.3:1.0: 4 ports detected
Oct 12 01:27:49 lio cosmic-session[2398]: process ' COSMIC_SESSION_SOCK=12 cosmic-comp ' failed with code 101
Oct 12 01:27:50 lio cosmic-session[2398]: cosmic-comp exited with error code 101
Oct 12 01:27:50 lio cosmic-session[2398]: draining stdin receiver before restarting process
Oct 12 01:27:50 lio cosmic-session[2398]: sleeping for 3ms before restarting process cosmic-comp (restart 0)
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(12v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(11v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(10v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(9v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(8v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(7v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(6v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(5v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(4v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(3v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(2v1)' cancelled
Oct 12 01:27:50 lio cosmic-session[2398]: RESTARTING: session restarted by request
Oct 12 01:27:50 lio polkitd[1511]: Unregistered Authentication Agent for unix-session:3 (system bus name :1.220, object path /com/system76/CosmicOsd, locale en_US) (disconnected from bus)
Oct 12 01:27:50 lio cosmic-session[2398]: restarted process ' COSMIC_SESSION_SOCK=12 cosmic-comp ', now at 1 restarts
Oct 12 01:27:50 lio cosmic-session[2398]: process 'ProcessKey(1v1)' cancelled
Oct 12 01:27:50 lio kernel: usb 1-5.3.1: new full-speed USB device number 26 using xhci_hcd
Oct 12 01:27:51 lio kernel: usb 1-5.3.1: New USB device found, idVendor=19f7, idProduct=0003, bcdDevice= 1.00
Oct 12 01:27:51 lio kernel: usb 1-5.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 12 01:27:51 lio kernel: usb 1-5.3.1: Product: RODE NT-USB
Oct 12 01:27:51 lio kernel: usb 1-5.3.1: Manufacturer: RODE Microphones
Oct 12 01:27:51 lio kernel: input: RODE Microphones RODE NT-USB Consumer Control as /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:0c:00.0/usb1/1-5/1-5.3/1-5.3.1/1-5.3.1:1.3/0003:19F7:0003.0017/input/input39
Oct 12 01:27:51 lio kernel: hid-generic 0003:19F7:0003.0017: input,hiddev97,hidraw7: USB HID v1.00 Device [RODE Microphones RODE NT-USB] on usb-0000:0c:00.0-5.3.1/input3
Oct 12 01:27:51 lio mtp-probe[14120]: checking bus 1, device 26: "/sys/devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:0c:00.0/usb1/1-5/1-5.3/1-5.3.1"
Oct 12 01:27:51 lio mtp-probe[14120]: bus: 1, device: 26 was not an MTP device
Oct 12 01:27:51 lio mtp-probe[14131]: checking bus 1, device 26: "/sys/devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:0c:00.0/usb1/1-5/1-5.3/1-5.3.1"
Oct 12 01:27:51 lio mtp-probe[14131]: bus: 1, device: 26 was not an MTP device
Oct 12 01:27:51 lio wireplumber[2619]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
Oct 12 01:27:51 lio wireplumber[2619]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
Oct 12 01:27:51 lio wireplumber[2619]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
Oct 12 01:27:51 lio wireplumber[2619]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
Oct 12 01:27:51 lio wireplumber[2619]: spa.alsa: The decibel volume range for element 'PCM' (-9999999 dB - -500 dB) has negative maximum. Disabling the decibel range.
Oct 12 01:27:51 lio kernel: usb 1-5.3.3: new full-speed USB device number 27 using xhci_hcd
Oct 12 01:27:52 lio kernel: usb 1-5.3.3: New USB device found, idVendor=0b05, idProduct=1931, bcdDevice= 1.10
Oct 12 01:27:52 lio kernel: usb 1-5.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 12 01:27:52 lio kernel: usb 1-5.3.3: Product: ROG Gaming Display Aura Device
Oct 12 01:27:52 lio kernel: hid-generic 0003:0B05:1931.0018: hiddev99,hidraw9: USB HID v1.11 Device [ROG Gaming Display Aura Device] on usb-0000:0c:00.0-5.3.3/input0
Oct 12 01:27:52 lio mtp-probe[14132]: checking bus 1, device 27: "/sys/devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:0c:00.0/usb1/1-5/1-5.3/1-5.3.3"
Oct 12 01:27:52 lio mtp-probe[14132]: bus: 1, device: 27 was not an MTP device
Oct 12 01:27:52 lio mtp-probe[14134]: checking bus 1, device 27: "/sys/devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:0c:00.0/usb1/1-5/1-5.3/1-5.3.3"
Oct 12 01:27:52 lio mtp-probe[14134]: bus: 1, device: 27 was not an MTP device
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: new high-speed USB device number 28 using xhci_hcd
Oct 12 01:27:52 lio systemd[2381]: Stopped target Cosmic Session Target.
Oct 12 01:27:52 lio systemd[2381]: Stopped target Current graphical user session.
Oct 12 01:27:52 lio systemd[2381]: Stopped target Session services which should run early before the graphical session is brought up.
Oct 12 01:27:52 lio systemd[2381]: Stopped target Startup of XDG autostart applications.
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service - Apple File Conduit monitor...
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service...
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service - GNOME Online Accounts monitor...
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service - digital camera monitor...
Oct 12 01:27:52 lio cosmic-session[2398]: Restarting
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service - Media Transfer Protocol monitor...
Oct 12 01:27:52 lio systemd[2381]: Stopping Virtual filesystem service - disk device monitor...
Oct 12 01:27:52 lio systemd[2381]: Stopping Portal service...
Oct 12 01:27:52 lio systemd[2381]: Stopping flatpak document portal service...
Oct 12 01:27:52 lio systemd[2381]: Stopping sandboxed app permission store...
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service - Apple File Conduit monitor.
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service - Media Transfer Protocol monitor.
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service - digital camera monitor.
Oct 12 01:27:52 lio cosmic-session[2398]: Starting cosmic-session
Oct 12 01:27:52 lio systemd[2381]: Stopped sandboxed app permission store.
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service - GNOME Online Accounts monitor.
Oct 12 01:27:52 lio cosmic-session[2398]: starting process ' COSMIC_SESSION_SOCK=12 cosmic-comp '
Oct 12 01:27:52 lio systemd[1]: run-user-1000-gvfs.mount: Deactivated successfully.
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service.
Oct 12 01:27:52 lio systemd[1]: run-user-1000-doc.mount: Deactivated successfully.
Oct 12 01:27:52 lio systemd[2381]: Stopped flatpak document portal service.
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Failed to read config 'workspaces'
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: New USB device found, idVendor=2109, idProduct=8884, bcdDevice= 0.01
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: Product: USB Billboard Device
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: Manufacturer: VIA Labs, Inc.
Oct 12 01:27:52 lio kernel: usb 1-5.3.4: SerialNumber: 0000000000000001
Oct 12 01:27:52 lio systemd[2381]: Stopped Portal service.
Oct 12 01:27:52 lio systemd[2381]: Stopped Virtual filesystem service - disk device monitor.
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: failed to read local shortcuts config 'system_actions': NoConfigDirectory
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Key-Binding 'Period' only matched case insensitive for "period"
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Key-Binding 'Comma' only matched case insensitive for "comma"
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Key-Binding 'Period' only matched case insensitive for "period"
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Key-Binding 'Comma' only matched case insensitive for "comma"
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: tiling exceptions defaults config error: NoConfigDirectory
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: tiling exceptions custom config error: NoConfigDirectory
Oct 12 01:27:52 lio dbus-daemon[1306]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.252" (uid=1000 pid=14141 comm="cosmic-comp" label="kernel") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination="com.system76.PowerDaemon" (uid=0 pid=1320 comm="/nix/store/9pi7q98fcqbz8my458vy44igjjmhndcf-system" label="kernel")
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Unable to become drm master, assuming unprivileged mode
Oct 12 01:27:52 lio .cosmic-comp-wrapped[14141]: Unable to become drm master, assuming unprivileged mode

@Quackdoc
Copy link
Contributor

Quackdoc commented Oct 21, 2024

I am hitting a bug where cosmic-comp will lock up when I reconnect a monitor, possibly related, AMD stuff can be disregarded most likely. but I can pull the card out for more testing if needed.

Oct 21 18:27:36 quackdock kernel:  intel_pre_plane_update+0x3a3/0x720 [i915 1400000003000000474e5500dfbe2941d0b4954c]
Oct 21 18:27:36 quackdock kernel:  intel_atomic_commit_tail+0x233/0x11e0 [i915 1400000003000000474e5500dfbe2941d0b4954c]
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? flush_workqueue_prep_pwqs+0x108/0x120
Oct 21 18:27:36 quackdock kernel:  ? __flush_workqueue+0x170/0x400
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  intel_atomic_commit+0x2bd/0x300 [i915 1400000003000000474e5500dfbe2941d0b4954c]
Oct 21 18:27:36 quackdock kernel:  drm_atomic_commit+0xa9/0xe0
Oct 21 18:27:36 quackdock kernel:  ? __pfx___drm_printfn_info+0x10/0x10
Oct 21 18:27:36 quackdock kernel:  drm_mode_atomic_ioctl+0xa73/0xcb0
Oct 21 18:27:36 quackdock kernel:  ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
Oct 21 18:27:36 quackdock kernel:  drm_ioctl_kernel+0xb3/0x100
Oct 21 18:27:36 quackdock kernel:  drm_ioctl+0x27a/0x510
Oct 21 18:27:36 quackdock kernel:  ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
Oct 21 18:27:36 quackdock kernel:  __x64_sys_ioctl+0x97/0xd0
Oct 21 18:27:36 quackdock kernel:  do_syscall_64+0x82/0x190
Oct 21 18:27:36 quackdock kernel:  ? drm_ioctl+0x2a4/0x510
Oct 21 18:27:36 quackdock kernel:  ? __pfx_drm_mode_getproperty_ioctl+0x10/0x10
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? syscall_exit_to_user_mode+0x10/0x200
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? do_syscall_64+0x8e/0x190
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? syscall_exit_to_user_mode+0x10/0x200
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? do_syscall_64+0x8e/0x190
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? do_syscall_64+0x8e/0x190
Oct 21 18:27:36 quackdock kernel:  ? srso_return_thunk+0x5/0x5f
Oct 21 18:27:36 quackdock kernel:  ? do_syscall_64+0x8e/0x190
Oct 21 18:27:36 quackdock kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
Oct 21 18:27:36 quackdock kernel: RIP: 0033:0x58d80e3c3159
Oct 21 18:27:36 quackdock kernel: Code: 01 00 00 48 89 9c 24 20 01 00 00 89 cf 48 8d 94 24 00 01 00 00 b8 10 00 00 00 be bc 64 38 c0 c5 fa 7f 84 24>
Oct 21 18:27:36 quackdock kernel: RSP: 002b:00007ffdb8312870 EFLAGS: 00000217 ORIG_RAX: 0000000000000010
Oct 21 18:27:36 quackdock kernel: RAX: ffffffffffffffda RBX: 000058d854ee3df0 RCX: 000058d80e3c3159
Oct 21 18:27:36 quackdock kernel: RDX: 00007ffdb8312970 RSI: 00000000c03864bc RDI: 00000000000000ae
Oct 21 18:27:36 quackdock kernel: RBP: 00000000000000ba R08: 000058d8568b3170 R09: 0000000000000004
Oct 21 18:27:36 quackdock kernel: R10: 000058d8550096f0 R11: 0000000000000217 R12: 000058d84fc30e30
Oct 21 18:27:36 quackdock kernel: R13: 0000000000000004 R14: 0000000000000004 R15: 000058d8546d99b0
Oct 21 18:27:36 quackdock kernel:  </TASK>
Oct 21 18:27:36 quackdock kernel: ---[ end trace 0000000000000000 ]---
Oct 21 18:27:36 quackdock kernel: [drm] PCIE GART of 256M enabled (table at 0x000000F4FFF80000).
Oct 21 18:27:36 quackdock kernel: [drm] UVD and UVD ENC initialized successfully.
Oct 21 18:27:36 quackdock kernel: [drm] VCE initialized successfully.
Oct 21 18:27:36 quackdock kernel: amdgpu 0000:0a:00.0: [drm] Cannot find any crtc or sizes
Oct 21 18:27:36 quackdock cosmic-comp[4693]: Failed to destroy old mode property blob: No such file or directory (os error 2)
Oct 21 18:27:37 quackdock cosmic-comp[4693]: thread 'surface-DP-3' panicked at 'internal error: entered unreachable code': src/backend/kms/surface/>
                                                0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                1: log_panics::Config::install_panic_hook::{{closure}}
                                                2: std::panicking::rust_panic_with_hook
                                                3: std::panicking::begin_panic_handler::{{closure}}
                                                4: std::sys_common::backtrace::__rust_end_short_backtrace
                                                5: rust_begin_unwind
                                                6: core::panicking::panic_fmt
                                                7: core::panicking::panic
                                                8: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatche>
                                                9: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatche>
                                               10: cosmic_comp::backend::kms::surface::surface_thread
                                               11: std::sys_common::backtrace::__rust_begin_short_backtrace
                                               12: core::ops::function::FnOnce::call_once{{vtable.shim}}
                                               13: std::sys::pal::unix::thread::Thread::new::thread_start
                                               14: <unknown>
                                               15: <unknown>

I also often hit the error Oct 21 18:31:07 quackdock kernel: i915 0000:0d:00.0: [drm] HPD interrupt storm detected on connector HDMI-A-2: switching from hotplug detection to polling

@cjshearer
Copy link

cjshearer commented Nov 14, 2024

Same here:

$ journalctl --since "2024-11-13 21:19:49" --until "2024-11-13 21:20:05"
Nov 13 21:19:50 sisyphus .cosmic-comp-wrapped[2139]: thread 'main' panicked at 'called `Option::unwrap()` on a `None` value': src/shell/mod.rs:974
                                                        0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                        1: log_panics::Config::install_panic_hook::{{closure}}
                                                        2: std::panicking::rust_panic_with_hook
                                                        3: std::panicking::begin_panic_handler::{{closure}}
                                                        4: std::sys::backtrace::__rust_end_short_backtrace
                                                        5: rust_begin_unwind
                                                        6: core::panicking::panic_fmt
                                                        7: core::panicking::panic
                                                        8: core::option::unwrap_failed
                                                        9: cosmic_comp::shell::Workspaces::active
                                                       10: cosmic_comp::input::<impl cosmic_comp::state::State>::surface_under
                                                       11: cosmic_comp::shell::focus::<impl cosmic_comp::state::Common>::refresh_focus
                                                       12: calloop::loop_logic::EventLoop<Data>::run
                                                       13: cosmic_comp::main
                                                       14: std::sys::backtrace::__rust_begin_short_backtrace
                                                       15: main
                                                       16: __libc_start_call_main
                                                       17: __libc_start_main_alias_2
                                                       18: _start
Nov 13 21:19:50 sisyphus .cosmic-comp-wrapped[2139]: thread 'surface-DP-1' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }': src/backend/kms/surface/mod.rs:1124
                                                        0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                        1: log_panics::Config::install_panic_hook::{{closure}}
                                                        2: std::panicking::rust_panic_with_hook
                                                        3: std::panicking::begin_panic_handler::{{closure}}
                                                        4: std::sys::backtrace::__rust_end_short_backtrace
                                                        5: rust_begin_unwind
                                                        6: core::panicking::panic_fmt
                                                        7: core::result::unwrap_failed
                                                        8: cosmic_comp::backend::kms::surface::SurfaceThreadState::redraw
                                                        9: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
                                                       10: cosmic_comp::backend::kms::surface::surface_thread
                                                       11: std::sys::backtrace::__rust_begin_short_backtrace
                                                       12: core::ops::function::FnOnce::call_once{{vtable.shim}}
                                                       13: std::sys::pal::unix::thread::Thread::new::thread_start
                                                       14: start_thread
                                                       15: __GI___clone3
Nov 13 21:19:50 sisyphus .xdg-desktop-po[2723]: Error reading events from display: Broken pipe
Nov 13 21:19:50 sisyphus cosmic-session[2122]: Io error: Broken pipe (os error 32)
Nov 13 21:19:50 sisyphus systemd[2100]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 21:19:50 sisyphus systemd[2100]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'.
Nov 13 21:19:50 sisyphus cosmic-session[2122]: process ' COSMIC_SESSION_SOCK=12 cosmic-comp ' failed with code 101
Nov 13 21:19:50 sisyphus pipewire[2382]: mod.x11-bell: X11 I/O error handler called on display :1
Nov 13 21:19:50 sisyphus pipewire[2382]: mod.x11-bell: X11 display (:1) has encountered a fatal I/O error
Nov 13 21:19:50 sisyphus systemd[2100]: cosmic-launcher.scope: Consumed 41min 35.720s CPU time, 653.5M memory peak.
Nov 13 21:19:50 sisyphus systemd[2100]: app-cosmic-google-chrome-30911.scope: Consumed 3min 23.597s CPU time, 1.4G memory peak.
Nov 13 21:19:50 sisyphus cosmic-session[2122]: cosmic-comp exited with error code 101

$ neofetch --backend off
cjshearer@sisyphus
------------------
OS: NixOS 24.11.20241109.76612b1 (Vicuna) x86_64
Host: ASUSTeK COMPUTER INC. TUF Z390-PLUS GAMING (WI-FI)
Kernel: 6.6.60
Uptime: 13 hours, 32 mins
Packages: 1303 (nix-system), 693 (nix-user)
Shell: bash 5.2.26
Resolution: 5120x1440
DE: COSMIC (Wayland)
Theme: Adwaita-dark [GTK2/3]
Icons: Adwaita-dark [GTK2/3]
Terminal: .cosmic-term-wr
CPU: Intel i9-9900KF (16) @ 5.000GHz
GPU: AMD ATI Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT
Memory: 7393MiB / 64221MiB

@cjshearer
Copy link

I think this is a duplicate of #679, which might trace back to #57. This is also being tracked in pop-os/cosmic-epoch#84.

@Wasabi375
Copy link

I get a similar error when trying to "wake up" my computer after sleep.

Nov 18 16:36:53  .cosmic-comp-wrapped[1514]: Failed to destroy old mode property blob: No such file or directory (os error 2)
Nov 18 16:36:53  .cosmic-comp-wrapped[1514]: Failed to set new config.
Nov 18 16:36:53  .cosmic-comp-wrapped[1514]: failed to create signaled syncobj
Nov 18 16:36:53  .cosmic-comp-wrapped[1514]: ignoring requested context priority, EGL_IMG_context_priority not supported
Nov 18 16:36:53  .cosmic-comp-wrapped[1514]: ignoring requested context priority, EGL_IMG_context_priority not supported
Nov 18 16:36:54  .cosmic-comp-wrapped[1514]: ignoring requested context priority, EGL_IMG_context_priority not supported
Nov 18 16:36:54  .cosmic-comp-wrapped[1514]: ignoring requested context priority, EGL_IMG_context_priority not supported
Nov 18 16:36:59  .cosmic-comp-wrapped[1514]: Failed to destroy old mode property blob: No such file or directory (os error 2)
Nov 18 16:36:59  .cosmic-comp-wrapped[1514]: thread 'surface-HDMI-A-1' panicked at 'internal error: entered unreachable code': src/backend/kms/surface/mod.rs:780
                                                            0: <backtrace::capture::Backtrace as core::default::Default>::default
                                                            1: log_panics::Config::install_panic_hook::{{closure}}
                                                            2: std::panicking::rust_panic_with_hook
                                                            3: std::panicking::begin_panic_handler::{{closure}}
                                                            4: std::sys::backtrace::__rust_end_short_backtrace
                                                            5: rust_begin_unwind
                                                            6: core::panicking::panic_fmt
                                                            7: core::panicking::panic
                                                            8: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events::{{closure}}
                                                            9: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
                                                           10: cosmic_comp::backend::kms::surface::surface_thread
                                                           11: std::sys::backtrace::__rust_begin_short_backtrace
                                                           12: core::ops::function::FnOnce::call_once{{vtable.shim}}
                                                           13: std::sys::pal::unix::thread::Thread::new::thread_start
                                                           14: start_thread
                                                           15: clone3

System is NixOs using the stable branch. Cosmic versions are

cosmic-applets-1.0.0-alpha.2-unstable-2024-10-21
cosmic-applibrary-1.0.0-alpha.2-unstable-2024-10-24
cosmic-bg-1.0.0-alpha.2-unstable-2024-10-09
cosmic-comp-1.0.0-alpha.2-unstable-2024-10-25
cosmic-edit-1.0.0-alpha.2-unstable-2024-10-29
cosmic-files-1.0.0-alpha.2-unstable-2024-10-29
cosmic-greeter-1.0.0-alpha.2-unstable-2024-10-14
cosmic-icons-1.0.0-alpha.2-unstable-2024-10-02
cosmic-idle-0-unstable-2024-10-30
cosmic-launcher-1.0.0-alpha.2-unstable-2024-10-29
cosmic-notifications-1.0.0-alpha.2-unstable-2024-10-24
cosmic-osd-1.0.0-alpha.2-unstable-2024-10-09
cosmic-panel-1.0.0-alpha.2-unstable-2024-10-22
cosmic-randr-1.0.0-alpha.2-unstable-2024-10-24
cosmic-screenshot-1.0.0-alpha.2-unstable-2024-07-25
cosmic-session-1.0.0-alpha.2-unstable-2024-10-30
cosmic-settings-1.0.0-alpha.2-unstable-2024-10-30
cosmic-settings-daemon-1.0.0-alpha.2-unstable-2024-09-26
cosmic-term-1.0.0-alpha.2-unstable-2024-10-30
cosmic-wallpapers-1.0.0-alpha.2-unstable-2024-09-27
cosmic-workspaces-epoch-1.0.0-alpha.2-unstable-2024-08-07
xdg-desktop-portal-cosmic-1.0.0-alpha.2-unstable-2024-10-10

@mattipunkt
Copy link

Same here on Pop_OS! 24.04 alpha 4

@Drakulix
Copy link
Member

Should be fixed by #1057

@zsilet
Copy link

zsilet commented Dec 13, 2024

@Drakulix Please note that I just updated and am still able to reproduce this issue and #1043 .

I've tried it maybe 5-6 times in a row, with terminal open on the laptop screen and browser on the external monitor, and I lose both every single time I unplug HDMI.

I have attached my software versions as well as the journal log from the crash (starting around timestamp 0932).

Dec 13 09:32:03 pop-os cosmic-comp[2537]: thread 'main' panicked at 'called Option::unwrap() on a None value': src/shell/mod.rs:974

journal_log.txt
sys_info_sw_2024-Dec-13- 921.txt

@Drakulix
Copy link
Member

@Drakulix Please note that I just updated and am still able to reproduce this issue and #1043 .

How have you updated your install? I am not sure that version is live anywhere, but the Pop!_OS staging repo.

These logs are unfortunately not very helpful, as they don't contain full backtraces. A debug build of cosmic-comp would produce proper ones.

@APCBoston
Copy link

@Drakulix the COSMIC alpha apt repo appears to be pushing nightly builds; today's update version has the commit hash matching #1057 merging to master.

I've just updated, if I continue to see the issue I'll see about getting a stacktrace from a debug build.

$ apt show cosmic-comp
Package: cosmic-comp
Version: 0.1~1734010190~24.04~9b41275
Priority: optional
Section: x11
Maintainer: Victoria Brekenfeld <[email protected]>
Installed-Size: 24.7 MB
Depends: libc6 (>= 2.38), libgbm1 (>= 21.3.0~rc1), libgcc-s1 (>= 4.2), libinput10 (>= 1.19.1), libpixman-1-0 (>= 0.30.0), libseat1 (>= 0.5.0), libudev1 (>= 183), libxkbcommon0 (>= 0.5.0), libegl1, libwayland-server0
Recommends: cosmic-session, libgl1-mesa-dri
Homepage: https://github.com/pop-os/cosmic-comp
Download-Size: 7,859 kB
APT-Manual-Installed: no
APT-Sources: http://apt.pop-os.org/release noble/main amd64 Packages
Description: Wayland compositor of pop-os cosmic shell

@Drakulix
Copy link
Member

@Drakulix the COSMIC alpha apt repo appears to be pushing nightly builds; today's update version has the commit hash matching #1057 merging to master.

Not nightlies, but explicitly released builds: pop-os/repo-release#425

The last update was merged 17 hours ago and contained the fix, so it is possible some of your are already running the up to date version.

@Drakulix
Copy link
Member

Found and fixed a second occurrence of a similar bug: 2e1f6a4

@Philipp-M
Copy link

Philipp-M commented Dec 13, 2024

I unfortunately still get that issue with 2e1f6a4. I've built it with debugging symbols and tried to bisect the relevant parts, maybe this cosmic-reconnect-crash-log.txt log helps (I think the relevant stacktrace is on line 1015), it looks pretty similar as the log from @zsilet.

What I find interesting, is that cosmic-panel crashes first, maybe related, maybe a similar issue as this within cosmic-panel.

@Drakulix
Copy link
Member

I unfortunately still get that issue with 2e1f6a4. I've built it with debugging symbols and tried to bisect the relevant parts, maybe this cosmic-reconnect-crash-log.txt log helps (I think the relevant stacktrace is on line 1015), it looks pretty similar as the log from @zsilet.

What I find interesting, is that cosmic-panel crashes first, maybe related, maybe a similar issue as this within cosmic-panel.

No, that is a different one and helpful. Will take a look.

@ids1024
Copy link
Member

ids1024 commented Dec 14, 2024

I still see to see unwrap panics in Workspaces::active() sometimes on disconnecting on monitor, even with the latest changes.

@hayandev
Copy link

hayandev commented Dec 14, 2024

I've found the issue in my case(pop-os/cosmic-epoch#84 (comment)).
Here's a step-by-step breakdown of the process leading to the panic:

  1. Monitor disconnected (let's call it Output-1).
  2. In Workspaces::remove_output:
    1. Removed from the sets.
    2. The backup_set is set (line 772).
  3. Monitor connected (let's call it Output-2).
  4. In Workspaces::add_output:
    1. The backup_set is added to sets with Output-2 as the key.
  5. Main function starts handling the event loop (line 120).
  6. In Common::refresh_focus, a loop over seats:
    1. In State::surface_under, the function shell.workspaces.active(output) is called.
      1. At no point in the above steps is the seat's output updated to Output-2.
      2. Therefore, the output passed as a parameter is Output-1.
    2. Panic occurs.

I think it may be done like this commit.

However, I’m not sure what exactly update_pointer_focus() is for, so I could be wrong.
Therefore, I didn’t submit a PR, and I also haven’t cleaned up the code.

Anyway, I found that this resolves the issue.

I’m not very good at English, so I got help from ChatGPT. I’ve read through it and made some revisions, but I apologize if the sentences sound awkward.

@APCBoston
Copy link

I can confirm I am no longer seeing the sleep/wake variant of this issue.

@Drakulix
Copy link
Member

I am pretty confident the last variant of this issue has now been resolved with 7ac204e.

Thanks @hayandev for debugging this. The missing piece was, that this only happens, when the last output is disconnected (even if just temporarily), which is why I wasn't able to reproduce this earlier.

I bunch of this code was refactored when focus-follows-cursor was introduced, which caused some subtle regressions, which only surfaced after some other fixes to output hotplug. At last that logic should be sound now.

@Drakulix
Copy link
Member

Closing for now. Please comment if you can still reproduce on latest master (preferably with reproducing steps and/or a stack trace). I'll re-open this issue should we find another cause.

@zsilet
Copy link

zsilet commented Dec 17, 2024

Thank you @Drakulix , verified working with the latest update.

@gmpinder
Copy link

Working for me too on

$ rpm -q cosmic-comp
cosmic-comp-1.0.0~alpha.4^git20241216.7ac204e-1.fc41.x86_64

@RingOfStorms
Copy link

Can confirm my crash is also fixed. Thank you very much, this was the last blocker to me trying out Cosmic full time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests