Skip to content

anvil crashes when the tty is left and reentered #1790

@PatrickHechler

Description

@PatrickHechler

when anvil is started with --tty-udev and the left and then entered again anvil crashes.
after leaving the tty the anvil process stays alive, until the anvil tty is entered again.

anvil prints a lot of

2025-08-03T11:27:09.702016Z  WARN anvil::udev: Error during rendering: TemporaryFailure(
    DeviceInactive,
)

and ends with (the backtrace is only shown when RUST_BACKTRACE is set to 1)

2025-08-03T11:30:51.160231Z  WARN anvil::udev: Error during rendering: ContextLost(
    Access(
        AccessError {
            errmsg: "Failed to page flip",
            dev: Some(
                "/dev/dri/card0",
            ),
            source: Os {
                code: 22,
                kind: InvalidInput,
                message: "Invalid argument",
            },
        },
    ),
)

thread 'main' panicked at anvil/src/udev.rs:1494:30:
Rendering loop lost: DRM access error: Failed to page flip on device `Some("/dev/dri/card0")` (Invalid argument (os error 22))
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: anvil::udev::<impl anvil::state::AnvilState<anvil::udev::UdevData>>::render_surface
             at ./src/udev.rs:1494:30
   3: anvil::udev::<impl anvil::state::AnvilState<anvil::udev::UdevData>>::render
             at ./src/udev.rs:1375:17
   4: anvil::udev::run_udev::{{closure}}::{{closure}}
             at ./src/udev.rs:360:50
   5: calloop::loop_logic::LoopHandle<Data>::insert_idle::{{closure}}
             at /home/pat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/calloop-0.14.3/src/loop_logic.rs:164:17
   6: <core::option::Option<F> as calloop::sources::IdleDispatcher<Data>>::dispatch
             at /home/pat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/calloop-0.14.3/src/sources/mod.rs:597:13
   7: calloop::loop_logic::EventLoop<Data>::dispatch_idles
             at /home/pat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/calloop-0.14.3/src/loop_logic.rs:615:13
   8: calloop::loop_logic::EventLoop<Data>::dispatch
             at /home/pat/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/calloop-0.14.3/src/loop_logic.rs:633:9
   9: anvil::udev::run_udev
             at ./src/udev.rs:527:22
  10: anvil::main
             at ./src/main.rs:47:13
  11: core::ops::function::FnOnce::call_once
             at /usr/src/debug/rust/rustc-1.88.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions