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

ringboard-x11 fails to restart syscalls after interruption #31

Closed
vi opened this issue Aug 21, 2024 · 4 comments
Closed

ringboard-x11 fails to restart syscalls after interruption #31

vi opened this issue Aug 21, 2024 · 4 comments

Comments

@vi
Copy link

vi commented Aug 21, 2024

ringboard-x11 &Error: an I/O error occurred
│
╰─▶ Interrupted system call (os error 4)
    ╰╴Failed to wait for epoll events.

I think EINTR should be just restarted in most of the cases.

Maybe this was caused by suspend-to-ram, maybe by something else.

@SUPERCILEX
Copy link
Owner

I'm a little bit worried about getting stuck in an infinite loop because of this: https://stackoverflow.com/questions/46502099/epoll-wait-returns-eintr-infinitely. But in my testing it seemed fine? I wish that post had figured out the root cause cuz I feel like it's a bug in their code rather than something that can actually happen. Hopefully.

@vi
Copy link
Author

vi commented Aug 21, 2024

I typically assume that any syscall that waits for something can spuriously wake with EINTR. Sometimes I also handle unexpected EAGAINs (by sleeping a bit before resuming the loop).

@vi
Copy link
Author

vi commented Aug 21, 2024

Note: as of commit 1625939 ringboard-server crashes when I try to start ringboard-x11.

$ RUST_LOG=debug RUST_BACKTRACE=1 target/debug/ringboard-server
[2024-08-21T20:00:49Z INFO  ringboard_server] Starting Ringboard server v0.5.4.
[2024-08-21T20:00:49Z INFO  ringboard_server] Using database in "/home/vi/.local/share/clipboard-history".
[2024-08-21T20:00:49Z WARN  ringboard_server::startup] Unclean shutdown detected, forcibly claiming server lock.
[2024-08-21T20:00:49Z INFO  ringboard_server] Acquired server lock.
[2024-08-21T20:00:49Z WARN  ringboard_server::allocator] Reconstructing allocator free lists.
[2024-08-21T20:00:49Z DEBUG ringboard_server::reactor] Detected cgroup v1 which is unsupported.
[2024-08-21T20:00:49Z INFO  ringboard_server::reactor] Server event loop started.
[2024-08-21T20:00:52Z DEBUG ringboard_server::reactor] Handling accept completion.
thread 'main' panicked at server/src/reactor.rs:342:21:
assertion failed: client < u32::from(MAX_NUM_CLIENTS)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/6de928dce9472b864f4e5d590dd7aa2075cb7551/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /rustc/6de928dce9472b864f4e5d590dd7aa2075cb7551/library/core/src/panicking.rs:74:14
   2: core::panicking::panic
             at /rustc/6de928dce9472b864f4e5d590dd7aa2075cb7551/library/core/src/panicking.rs:148:5
   3: ringboard_server::reactor::run
             at /mnt/bkel/vi/src/clipboard-history/server/src/reactor.rs:342:21
   4: ringboard_server::run
             at /mnt/bkel/vi/src/clipboard-history/server/src/main.rs:110:13
   5: ringboard_server::main
             at /mnt/bkel/vi/src/clipboard-history/server/src/main.rs:54:5
   6: core::ops::function::FnOnce::call_once
             at /rustc/6de928dce9472b864f4e5d590dd7aa2075cb7551/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Value of nearby result variable is Ok(34).

@SUPERCILEX
Copy link
Owner

Fixed in 3676439. Thanks for catching that!

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

2 participants