Assertion fail in rustix due to invalid errno value when closing libinput session
See: https://github.com/YaLTeR/niri/issues/1462
The backtrace:
апр 23 15:59:22 khamovnik niri[3401]: 2025-04-23T12:59:22.622219Z DEBUG niri::backend::tty: device changed: 57857
апр 23 15:59:22 khamovnik niri[3401]: 2025-04-23T12:59:22.635130Z DEBUG niri::backend::tty: disconnecting connector: "DP-3"
апр 23 15:59:22 khamovnik niri[3401]: 2025-04-23T12:59:22.731492Z DEBUG niri::protocols::output_management: OutputConfiguration: request from an outdated configuration
апр 23 15:59:22 khamovnik niri[3401]: thread 'main' panicked at /build/niri-25.02-vendor/rustix-0.38.44/src/backend/linux_raw/io/errno.rs:91:9:
апр 23 15:59:22 khamovnik niri[3401]: assertion failed: encoded >= 0xf001
апр 23 15:59:22 khamovnik niri[3401]: stack backtrace:
апр 23 15:59:22 khamovnik niri[3401]: 0: rust_begin_unwind
апр 23 15:59:22 khamovnik niri[3401]: 1: core::panicking::panic_fmt
апр 23 15:59:22 khamovnik niri[3401]: 2: core::panicking::panic
апр 23 15:59:22 khamovnik niri[3401]: 3: <smithay::backend::session::libseat::LibSeatSession as smithay::backend::session::Session>::close
апр 23 15:59:22 khamovnik niri[3401]: 4: input::context::close_restricted
апр 23 15:59:22 khamovnik niri[3401]: 5: evdev_device_suspend
апр 23 15:59:22 khamovnik niri[3401]: 6: evdev_device_remove
апр 23 15:59:22 khamovnik niri[3401]: 7: device_removed
апр 23 15:59:22 khamovnik niri[3401]: 8: evdev_udev_handler
апр 23 15:59:22 khamovnik niri[3401]: 9: libinput_dispatch
апр 23 15:59:22 khamovnik niri[3401]: 10: <smithay::backend::libinput::LibinputInputBackend as calloop::sources::EventSource>::process_events
апр 23 15:59:22 khamovnik niri[3401]: 11: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
апр 23 15:59:22 khamovnik niri[3401]: 12: calloop::loop_logic::EventLoop<Data>::run
апр 23 15:59:22 khamovnik niri[3401]: 13: niri::main
апр 23 15:59:22 khamovnik niri[3401]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
апр 23 15:59:22 khamovnik niri[3401]: thread 'main' panicked at core/src/panicking.rs:223:5:
апр 23 15:59:22 khamovnik niri[3401]: panic in a function that cannot unwind
апр 23 15:59:22 khamovnik niri[3401]: stack backtrace:
апр 23 15:59:22 khamovnik niri[3401]: 0: 0x562b99a68359 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7964c48fa1e13ebd
апр 23 15:59:22 khamovnik niri[3401]: 1: 0x562b98f48d83 - core::fmt::write::h26d370e762806908
апр 23 15:59:22 khamovnik niri[3401]: 2: 0x562b99a871ff - std::io::Write::write_fmt::h7172e38dd4e6c5be
апр 23 15:59:22 khamovnik niri[3401]: 3: 0x562b99a681b3 - std::sys::backtrace::BacktraceLock::print::hf0868af390127a97
апр 23 15:59:22 khamovnik niri[3401]: 4: 0x562b99a62e1b - std::panicking::default_hook::{{closure}}::hde4b94f2c8a1b75a
апр 23 15:59:22 khamovnik niri[3401]: 5: 0x562b99a62c30 - std::panicking::default_hook::hb1abdd4b376f163b
апр 23 15:59:22 khamovnik niri[3401]: 6: 0x562b99a63284 - std::panicking::rust_panic_with_hook::hd9708ed3eabf91e2
апр 23 15:59:22 khamovnik niri[3401]: 7: 0x562b99a68b36 - std::panicking::begin_panic_handler::{{closure}}::h5445e74fe4b5ee5a
апр 23 15:59:22 khamovnik niri[3401]: 8: 0x562b99a68569 - std::sys::backtrace::__rust_end_short_backtrace::h66f5b0e9fcf722b5
апр 23 15:59:22 khamovnik niri[3401]: 9: 0x562b99a62ebc - rust_begin_unwind
апр 23 15:59:22 khamovnik niri[3401]: 10: 0x562b98e1f95d - core::panicking::panic_nounwind_fmt::hcad7ecf13af918b8
апр 23 15:59:22 khamovnik niri[3401]: 11: 0x562b98e1f9f2 - core::panicking::panic_nounwind::h58e26932d9b8aa02
апр 23 15:59:22 khamovnik niri[3401]: 12: 0x562b98e1fb16 - core::panicking::panic_cannot_unwind::h4a5801e2a6f6f6f6
апр 23 15:59:22 khamovnik niri[3401]: 13: 0x562b99206b67 - input::context::close_restricted::h89b6634cc63c3484
апр 23 15:59:22 khamovnik niri[3401]: 14: 0x7fc7db618504 - evdev_device_suspend
апр 23 15:59:22 khamovnik niri[3401]: 15: 0x7fc7db6187ae - evdev_device_remove
апр 23 15:59:22 khamovnik niri[3401]: 16: 0x7fc7db63bdf9 - device_removed
апр 23 15:59:22 khamovnik niri[3401]: 17: 0x7fc7db63c411 - evdev_udev_handler
апр 23 15:59:22 khamovnik niri[3401]: 18: 0x7fc7db610240 - libinput_dispatch
апр 23 15:59:22 khamovnik niri[3401]: 19: 0x562b99150922 - <smithay::backend::libinput::LibinputInputBackend as calloop::sources::EventSource>::process_events::h7ef20b1acd90e9fe
апр 23 15:59:22 khamovnik niri[3401]: 20: 0x562b99159726 - <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events::h0bbc322a2d274321
апр 23 15:59:22 khamovnik niri[3401]: 21: 0x562b9962c611 - calloop::loop_logic::EventLoop<Data>::run::h82956d02d92a3e55
апр 23 15:59:22 khamovnik niri[3401]: 22: 0x562b9961217f - niri::main::ha5da5064ecb9c269
апр 23 15:59:22 khamovnik niri[3401]: 23: 0x562b996254a3 - std::sys::backtrace::__rust_begin_short_backtrace::h61f425fb9d43cd70
апр 23 15:59:22 khamovnik niri[3401]: 24: 0x562b99634b49 - std::rt::lang_start::{{closure}}::h0b1e01d32db59fc9
апр 23 15:59:22 khamovnik niri[3401]: 25: 0x562b99a61175 - std::rt::lang_start_internal::h288bfc959f5ce5b2
апр 23 15:59:22 khamovnik niri[3401]: 26: 0x562b9961497c - main
апр 23 15:59:22 khamovnik niri[3401]: 27: 0x7fc7db02a1fe - __libc_start_call_main
апр 23 15:59:22 khamovnik niri[3401]: 28: 0x7fc7db02a2b9 - __libc_start_main_alias_2
апр 23 15:59:22 khamovnik niri[3401]: 29: 0x562b98e7b3c5 - _start
апр 23 15:59:22 khamovnik niri[3401]: 30: 0x0 - <unknown>
апр 23 15:59:22 khamovnik niri[3401]: thread caused non-unwinding panic. aborting.
It seems that it panics inside here in Smithay https://github.com/Smithay/smithay/blob/cb90ea06c6cb89f47f65a8cdf71d78917707f822/src/backend/session/libseat.rs#L150 hitting this assert https://github.com/bytecodealliance/rustix/blob/cd9520157e08e4e70b2fc9c2e9aacb18c8d23439/src/backend/linux_raw/io/errno.rs#L91.
Further inspection of the errno value:
I didn't find a frame for
Session::close, but did forlibinput::LibinputInterface::close_restrictedinto whichclosewas likely inlined.At this point we have:
(gdb) p (int)errno $3 = 2
Maybe rustix expects it to be negative?
Experiencing a similar issue.
Jun 14 20:54:41 halcyon niri[1985272]: thread 'main' panicked at /cargo-vendor-dir/rustix-1.0.7/src/backend/linux_raw/io/errno.rs:91:9:
Jun 14 20:54:41 halcyon niri[1985272]: assertion failed: encoded >= 0xf001
Jun 14 20:54:41 halcyon niri[1985272]: stack backtrace:
Jun 14 20:54:41 halcyon niri[1985272]: 0: rust_begin_unwind
Jun 14 20:54:41 halcyon niri[1985272]: 1: core::panicking::panic_fmt
Jun 14 20:54:41 halcyon niri[1985272]: 2: core::panicking::panic
Jun 14 20:54:41 halcyon niri[1985272]: 3: from_errno
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/rustix-1.0.7/src/backend/linux_raw/io/errno.rs:91:9
Jun 14 20:54:41 halcyon niri[1985272]: 4: from_raw_os_error
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/rustix-1.0.7/src/backend/linux_raw/io/errno.rs:81:9
Jun 14 20:54:41 halcyon niri[1985272]: 5: {closure#0}
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/smithay-0.6.0/src/backend/session/libseat.rs:150:63
Jun 14 20:54:41 halcyon niri[1985272]: 6: map_err<(), errno::Errno, smithay::backend::session::libseat::Error, smithay::backend::session::libseat::{impl#2}::close::{closure_env#0}>
Jun 14 20:54:41 halcyon niri[1985272]: at /rustc-1.86.0-src/library/core/src/result.rs:856:27
Jun 14 20:54:41 halcyon niri[1985272]: 7: close
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/smithay-0.6.0/src/backend/session/libseat.rs:150:22
Jun 14 20:54:41 halcyon niri[1985272]: 8: close_restricted<smithay::backend::session::libseat::LibSeatSession>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/smithay-0.6.0/src/backend/libinput/mod.rs:696:17
Jun 14 20:54:41 halcyon niri[1985272]: 9: close_restricted<smithay::backend::libinput::LibinputSessionInterface<smithay::backend::session::libseat::LibSeatSession>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:77:9
Jun 14 20:54:41 halcyon niri[1985272]: 10: evdev_device_suspend
Jun 14 20:54:41 halcyon niri[1985272]: 11: evdev_device_remove
Jun 14 20:54:41 halcyon niri[1985272]: 12: evdev_device_dispatch
Jun 14 20:54:41 halcyon niri[1985272]: 13: libinput_dispatch
Jun 14 20:54:41 halcyon niri[1985272]: 14: dispatch
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:332:19
Jun 14 20:54:41 halcyon niri[1985272]: 15: process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/smithay-0.6.0/src/backend/libinput/mod.rs:720:13
Jun 14 20:54:41 halcyon niri[1985272]: 16: process_events<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/sources/mod.rs:326:9
Jun 14 20:54:41 halcyon niri[1985272]: 17: dispatch_events<niri::niri::State>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:445:31
Jun 14 20:54:41 halcyon niri[1985272]: 18: dispatch<niri::niri::State, core::option::Option<core::time::Duration>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:550:9
Jun 14 20:54:41 halcyon niri[1985272]: 19: run<niri::niri::State, niri::main::{closure_env#5}, core::option::Option<core::time::Duration>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:587:13
Jun 14 20:54:41 halcyon niri[1985272]: 20: main
Jun 14 20:54:41 halcyon niri[1985272]: at ./src/main.rs:280:5
Jun 14 20:54:41 halcyon niri[1985272]: 21: call_once<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, ()>
Jun 14 20:54:41 halcyon niri[1985272]: at /rustc-1.86.0-src/library/core/src/ops/function.rs:250:5
Jun 14 20:54:41 halcyon niri[1985272]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Jun 14 20:54:41 halcyon niri[1985272]: thread 'main' panicked at library/core/src/panicking.rs:218:5:
Jun 14 20:54:41 halcyon niri[1985272]: panic in a function that cannot unwind
Jun 14 20:54:41 halcyon niri[1985272]: stack backtrace:
Jun 14 20:54:41 halcyon niri[1985272]: 0: 0x5641ca23b200 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h9edbd6e38a8b0805
Jun 14 20:54:41 halcyon niri[1985272]: 1: 0x5641c9659273 - core::fmt::write::h7b1248e5e0c79c78
Jun 14 20:54:41 halcyon niri[1985272]: 2: 0x5641ca203a33 - std::io::Write::write_fmt::h5e301665499081bf
Jun 14 20:54:41 halcyon niri[1985272]: 3: 0x5641ca23b0a3 - std::sys::backtrace::BacktraceLock::print::h4a386d2ef944f43e
Jun 14 20:54:41 halcyon niri[1985272]: 4: 0x5641ca2360aa - std::panicking::default_hook::{{closure}}::h61b7aa0fc15f236b
Jun 14 20:54:41 halcyon niri[1985272]: 5: 0x5641ca235fb6 - std::panicking::default_hook::h2d21379b0b23a14f
Jun 14 20:54:41 halcyon niri[1985272]: 6: 0x5641ca2365bf - std::panicking::rust_panic_with_hook::h100726ba9570b85a
Jun 14 20:54:41 halcyon niri[1985272]: 7: 0x5641ca23b6a6 - std::panicking::begin_panic_handler::{{closure}}::h141712493bfacf0c
Jun 14 20:54:41 halcyon niri[1985272]: 8: 0x5641ca23b409 - std::sys::backtrace::__rust_end_short_backtrace::h891003731531c924
Jun 14 20:54:41 halcyon niri[1985272]: 9: 0x5641ca23614d - rust_begin_unwind
Jun 14 20:54:41 halcyon niri[1985272]: 10: 0x5641c95047bd - core::panicking::panic_nounwind_fmt::ha2f9a57c040716ff
Jun 14 20:54:41 halcyon niri[1985272]: 11: 0x5641c9504852 - core::panicking::panic_nounwind::h9817f69376d9bbc4
Jun 14 20:54:41 halcyon niri[1985272]: 12: 0x5641c9504976 - core::panicking::panic_cannot_unwind::h0197944997fd9fc5
Jun 14 20:54:41 halcyon niri[1985272]: 13: 0x5641c99faecb - close_restricted<smithay::backend::libinput::LibinputSessionInterface<smithay::backend::session::libseat::LibSeatSession>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:72:1
Jun 14 20:54:41 halcyon niri[1985272]: 14: 0x7f08d6872c84 - evdev_device_suspend
Jun 14 20:54:41 halcyon niri[1985272]: 15: 0x7f08d6872f2e - evdev_device_remove
Jun 14 20:54:41 halcyon niri[1985272]: 16: 0x7f08d68733f3 - evdev_device_dispatch
Jun 14 20:54:41 halcyon niri[1985272]: 17: 0x7f08d686a8c0 - libinput_dispatch
Jun 14 20:54:41 halcyon niri[1985272]: 18: 0x5641c9b4c5c7 - dispatch
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:332:19
Jun 14 20:54:41 halcyon niri[1985272]: 19: 0x5641c9b4c5c7 - process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/smithay-0.6.0/src/backend/libinput/mod.rs:720:13
Jun 14 20:54:41 halcyon niri[1985272]: 20: 0x5641c9b4c5c7 - process_events<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/sources/mod.rs:326:9
Jun 14 20:54:41 halcyon niri[1985272]: 21: 0x5641c9db62a4 - dispatch_events<niri::niri::State>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:445:31
Jun 14 20:54:41 halcyon niri[1985272]: 22: 0x5641c9db62a4 - dispatch<niri::niri::State, core::option::Option<core::time::Duration>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:550:9
Jun 14 20:54:41 halcyon niri[1985272]: 23: 0x5641c9db62a4 - run<niri::niri::State, niri::main::{closure_env#5}, core::option::Option<core::time::Duration>>
Jun 14 20:54:41 halcyon niri[1985272]: at /cargo-vendor-dir/calloop-0.14.2/src/loop_logic.rs:587:13
Jun 14 20:54:41 halcyon niri[1985272]: 24: 0x5641c9da874f - main
Jun 14 20:54:41 halcyon niri[1985272]: at ./src/main.rs:280:5
Jun 14 20:54:41 halcyon niri[1985272]: 25: 0x5641c9dc6623 - call_once<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, ()>
Jun 14 20:54:41 halcyon niri[1985272]: at /rustc-1.86.0-src/library/core/src/ops/function.rs:250:5
Jun 14 20:54:41 halcyon niri[1985272]: 26: 0x5641c9dc6623 - __rust_begin_short_backtrace<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>>
Jun 14 20:54:41 halcyon niri[1985272]: at /rustc-1.86.0-src/library/std/src/sys/backtrace.rs:152:18
Jun 14 20:54:41 halcyon niri[1985272]: 27: 0x5641c9ddd429 - {closure#0}<core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>>
Jun 14 20:54:41 halcyon niri[1985272]: at /rustc-1.86.0-src/library/std/src/rt.rs:199:18
Jun 14 20:54:41 halcyon niri[1985272]: 28: 0x5641ca2103a6 - std::rt::lang_start_internal::he3cad277a2bdfe30
Jun 14 20:54:41 halcyon niri[1985272]: 29: 0x5641c9dab28c - main
Jun 14 20:54:41 halcyon niri[1985272]: 30: 0x7f08d642a47e - __libc_start_call_main
Jun 14 20:54:41 halcyon niri[1985272]: 31: 0x7f08d642a539 - __libc_start_main_impl
Jun 14 20:54:41 halcyon niri[1985272]: 32: 0x5641c955d6e5 - _start
Jun 14 20:54:41 halcyon niri[1985272]: 33: 0x0 - <unknown>
Jun 14 20:54:41 halcyon niri[1985272]: thread caused non-unwinding panic. aborting.
-- Boot 606affe2c3194497995504cb8f5242be --
Same thing has happened to me.
System Information
niri version: unstable 2025-10-02 (commit https://github.com/YaLTeR/niri/commit/ba6e5e082a79901dc89b0d49c5da1b769d652aec) Distro: NixOS 25.11 (Xantusia) GPU: AMD Radeon RX 9070 XT CPU: AMD Ryzen 7 9800X3D
10月 15 19:50:54 yun niri[2977]: 2025-10-15T22:50:54.706759Z DEBUG niri::pw_utils: pw stream: moving to ready state stream_id=11
10月 15 19:50:54 yun niri[2977]: 2025-10-15T22:50:54.707722Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Streaming stream_id=11
10月 15 20:48:03 yun niri[2977]: thread 'main' panicked at /cargo-vendor-dir/rustix-1.1.2/src/backend/linux_raw/io/errno.rs:91:9:
10月 15 20:48:03 yun niri[2977]: assertion failed: encoded >= 0xf001
10月 15 20:48:03 yun niri[2977]: stack backtrace:
10月 15 20:48:03 yun niri[2977]: 0: __rustc::rust_begin_unwind
10月 15 20:48:03 yun niri[2977]: 1: core::panicking::panic_fmt
10月 15 20:48:03 yun niri[2977]: 2: core::panicking::panic
10月 15 20:48:03 yun niri[2977]: 3: from_errno
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/rustix-1.1.2/src/backend/linux_raw/io/errno.rs:91:9
10月 15 20:48:03 yun niri[2977]: 4: from_raw_os_error
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/rustix-1.1.2/src/backend/linux_raw/io/errno.rs:81:9
10月 15 20:48:03 yun niri[2977]: 5: {closure#0}
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/smithay-0.7.0/src/backend/session/libseat.rs:150:63
10月 15 20:48:03 yun niri[2977]: 6: map_err<(), errno::Errno, smithay::backend::session::libseat::Error, smithay::backend::session::libseat::{impl#2}::close::{closure_env#0}>
10月 15 20:48:03 yun niri[2977]: at /rustc-1.89.0-src/library/core/src/result.rs:914:27
10月 15 20:48:03 yun niri[2977]: 7: close
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/smithay-0.7.0/src/backend/session/libseat.rs:150:22
10月 15 20:48:03 yun niri[2977]: 8: close_restricted<smithay::backend::session::libseat::LibSeatSession>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/smithay-0.7.0/src/backend/libinput/mod.rs:696:24
10月 15 20:48:03 yun niri[2977]: 9: close_restricted<smithay::backend::libinput::LibinputSessionInterface<smithay::backend::session::libseat::LibSeatSession>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:77:19
10月 15 20:48:03 yun niri[2977]: 10: evdev_device_suspend
10月 15 20:48:03 yun niri[2977]: 11: evdev_device_remove
10月 15 20:48:03 yun niri[2977]: 12: evdev_device_dispatch
10月 15 20:48:03 yun niri[2977]: 13: libinput_dispatch
10月 15 20:48:03 yun niri[2977]: 14: dispatch
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:332:19
10月 15 20:48:03 yun niri[2977]: 15: process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/smithay-0.7.0/src/backend/libinput/mod.rs:720:26
10月 15 20:48:03 yun niri[2977]: 16: process_events<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/sources/mod.rs:327:14
10月 15 20:48:03 yun niri[2977]: 17: dispatch_events<niri::niri::State>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:527:36
10月 15 20:48:03 yun niri[2977]: 18: dispatch<niri::niri::State, core::option::Option<core::time::Duration>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:632:14
10月 15 20:48:03 yun niri[2977]: 19: run<niri::niri::State, niri::main::{closure_env#3}, core::option::Option<core::time::Duration>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:669:18
10月 15 20:48:03 yun niri[2977]: 20: main
10月 15 20:48:03 yun niri[2977]: at /niri/src/main.rs:265:10
10月 15 20:48:03 yun niri[2977]: 21: call_once<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, ()>
10月 15 20:48:03 yun niri[2977]: at /rustc-1.89.0-src/library/core/src/ops/function.rs:250:5
10月 15 20:48:03 yun niri[2977]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
10月 15 20:48:03 yun niri[2977]: thread 'main' panicked at library/core/src/panicking.rs:225:5:
10月 15 20:48:03 yun niri[2977]: panic in a function that cannot unwind
10月 15 20:48:03 yun niri[2977]: stack backtrace:
10月 15 20:48:03 yun niri[2977]: 0: 0x555919d327fa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hbebe6f6ccb03097e
10月 15 20:48:03 yun niri[2977]: 1: 0x555919116f9f - core::fmt::write::hfda183a3e738d044
10月 15 20:48:03 yun niri[2977]: 2: 0x555919d1802f - std::io::Write::write_fmt::h385639f6e2e60abe
10月 15 20:48:03 yun niri[2977]: 3: 0x555919d32653 - std::sys::backtrace::BacktraceLock::print::h9110a91b501bc8af
10月 15 20:48:03 yun niri[2977]: 4: 0x555919d1182e - std::panicking::default_hook::{{closure}}::h3a76c41a68190ab9
10月 15 20:48:03 yun niri[2977]: 5: 0x555919d116f5 - std::panicking::default_hook::hb6fc964030182ea8
10月 15 20:48:03 yun niri[2977]: 6: 0x555919d11d3e - std::panicking::rust_panic_with_hook::h891c50946202eb22
10月 15 20:48:03 yun niri[2977]: 7: 0x555919d33496 - std::panicking::begin_panic_handler::{{closure}}::h76f44c85d7c4573f
10月 15 20:48:03 yun niri[2977]: 8: 0x555919d329f9 - std::sys::backtrace::__rust_end_short_backtrace::h24fdf43e0ddd28f3
10月 15 20:48:03 yun niri[2977]: 9: 0x555919d118cd - __rustc[8ed47d4163cac052]::rust_begin_unwind
10月 15 20:48:03 yun niri[2977]: 10: 0x555918e84cdd - core::panicking::panic_nounwind_fmt::h616ff5d1f7b72da8
10月 15 20:48:03 yun niri[2977]: 11: 0x555918e84d72 - core::panicking::panic_nounwind::h0d95be9362426743
10月 15 20:48:03 yun niri[2977]: 12: 0x555918e84e96 - core::panicking::panic_cannot_unwind::h4de95ab056af3213
10月 15 20:48:03 yun niri[2977]: 13: 0x55591972372b - close_restricted<smithay::backend::libinput::LibinputSessionInterface<smithay::backend::session::libseat::LibSeatSession>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:72:1
10月 15 20:48:03 yun niri[2977]: 14: 0x7fbabbb75d69 - evdev_device_suspend
10月 15 20:48:03 yun niri[2977]: 15: 0x7fbabbb75fde - evdev_device_remove
10月 15 20:48:03 yun niri[2977]: 16: 0x7fbabbb765dc - evdev_device_dispatch
10月 15 20:48:03 yun niri[2977]: 17: 0x7fbabbb65ec0 - libinput_dispatch
10月 15 20:48:03 yun niri[2977]: 18: 0x5559197b0002 - dispatch
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/input-0.9.1/src/context.rs:332:19
10月 15 20:48:03 yun niri[2977]: 19: 0x5559197b0002 - process_events<calloop::sources::{impl#4}::process_events::{closure_env#0}<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/smithay-0.7.0/src/backend/libinput/mod.rs:720:26
10月 15 20:48:03 yun niri[2977]: 20: 0x5559196b0626 - process_events<niri::niri::State, smithay::backend::libinput::LibinputInputBackend, niri::backend::tty::{impl#1}::new::{closure_env#2}>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/sources/mod.rs:327:14
10月 15 20:48:03 yun niri[2977]: 21: 0x5559198c4281 - dispatch_events<niri::niri::State>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:527:36
10月 15 20:48:03 yun niri[2977]: 22: 0x5559198c4281 - dispatch<niri::niri::State, core::option::Option<core::time::Duration>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:632:14
10月 15 20:48:03 yun niri[2977]: 23: 0x5559198c4281 - run<niri::niri::State, niri::main::{closure_env#3}, core::option::Option<core::time::Duration>>
10月 15 20:48:03 yun niri[2977]: at /cargo-vendor-dir/calloop-0.14.3/src/loop_logic.rs:669:18
10月 15 20:48:03 yun niri[2977]: 24: 0x5559198b6e59 - main
10月 15 20:48:03 yun niri[2977]: at /niri/src/main.rs:265:10
10月 15 20:48:03 yun niri[2977]: 25: 0x5559198ddf83 - call_once<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, ()>
10月 15 20:48:03 yun niri[2977]: at /rustc-1.89.0-src/library/core/src/ops/function.rs:250:5
10月 15 20:48:03 yun niri[2977]: 26: 0x5559198ddf83 - __rust_begin_short_backtrace<fn() -> core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>, core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>>
10月 15 20:48:03 yun niri[2977]: at /rustc-1.89.0-src/library/std/src/sys/backtrace.rs:152:18
10月 15 20:48:03 yun niri[2977]: 27: 0x5559198cbed9 - {closure#0}<core::result::Result<(), alloc::boxed::Box<dyn core::error::Error, alloc::alloc::Global>>>
10月 15 20:48:03 yun niri[2977]: at /rustc-1.89.0-src/library/std/src/rt.rs:206:18
10月 15 20:48:03 yun niri[2977]: 28: 0x555919d0fb66 - std::rt::lang_start_internal::h57fd143a2cf6a208
10月 15 20:48:03 yun niri[2977]: 29: 0x5559198b8b9c - main
10月 15 20:48:03 yun niri[2977]: 30: 0x7fbabb62a4d8 - __libc_start_call_main
10月 15 20:48:03 yun niri[2977]: 31: 0x7fbabb62a59b - __libc_start_main_alias_1
10月 15 20:48:03 yun niri[2977]: 32: 0x555918ef1455 - _start
10月 15 20:48:03 yun niri[2977]: 33: 0x0 - <unknown>
10月 15 20:48:03 yun niri[2977]: thread caused non-unwinding panic. aborting.
I don't know about the others but this happens with like 40% probability on boot for me and completely locks me out causing me to reboot the machine. I have now changed the dinit script that niri packages to have
restart = true
instead of false, so hopefully that mitigates it a bit. edit: it doesn't
According to @sunfishcode from rustix (see above issue):
That code in rustix is assuming that the argument value is the value of an error code from a syscall which has failed, which would always be non-zero. Admittedly it's not made explicit in the documentation; that's something we should fix.
Can someone who knows rust / smithay confirm whether it is possible that 0 is being passed to this function, causing the assert to fail? (I see errno = 0 in my corefile). Maybe @ids1024 ?
I have release seatd 0.9.3 which has some errno improvements. People who can reproduce this issue are suggested to try that release.
Thanks for releasing seatd 0.9.3. I appear to be affected by the same issue on Pop!_OS 24.04 with COSMIC.
After attempting to wake my laptop from s2idle, the screen remained unusable and I had to force a shutdown. The journal contains:
kernel: PM: suspend entry (s2idle)
cosmic-comp: thread 'main' panicked at
'assertion failed: encoded >= 0xf001':
.../vendor/rustix/src/backend/linux_raw/io/errno.rs:91
cosmic-comp: thread 'main' panicked at
'panic in a function that cannot unwind'
The backtrace includes libinput_dispatch, although most frames are not symbolized. There is no PM: suspend exit in the journal for this cycle.
My system currently has libseat1 0.8.0-1, which is the version available in my Pop!_OS 24.04 repositories. Since seatd 0.9.3 includes improvements to errno propagation, it seems relevant to this assertion, but I have not verified whether it fixes my particular failure.
I would prefer not to replace the system library manually on my daily-use machine. Is there a recommended way to test 0.9.3 safely on Pop!_OS 24.04? It would also be useful if the Pop!_OS maintainers could consider packaging or backporting it for testing.
Environment:
- Pop!_OS 24.04, COSMIC Wayland
- Kernel:
7.2.15-76070215-generic - cosmic-comp:
0.1~1793802426~24.04~ec674cd - AMD Phoenix iGPU + NVIDIA RTX 4070 Laptop GPU, hybrid mode
- NVIDIA driver:
615.71.09 - libseat1:
0.8.0-1 - Suspend mode:
s2idle