Linux: showing a desktop notification panics (notify_rust block_on inside the runtime) #752

Closed
opened 2026-11-16 06:21:43 +00:00 by charles · 1 comment
Owner

Found in Charles's client logs, 2026-11-16 (Linux AppImage, git 6d3ca17d, nightly 2026.1116.341). Five panic reports in two days in ~/.local/state/flaxative/logs/panic-*.txt; the latest:

thread: tokio-rt-worker
location: zruntime-0.2.2/src/driver.rs:797:9
message: block_on called from a task this runtime is running: the call would wait for the very thread it is on
backtrace (top):
   6: <zruntime::driver::InBlockOn>::enter
   7: notify_rust::xdg::get_server_information
   8: … lazy_static … notify_rust::SPEC_VERSION …
  12: notify_rust::hints::hints_to_map
  13: <notify_rust::notification::Notification>::show
  14: <fluxer_platform::notify::linux::LinuxNotifier as fluxer_platform::notify::Notifier>::notify_with_icon
  15: fluxer::runtime::notify_worker
  16: tokio … BlockingTask<fluxer::runtime::run::{closure#0}::{closure#2}> …

So showing a desktop notification panics: notify_rust (zbus backend) calls a blocking block_on to ask the notification server for its version (lazily, on the first notification that has hints), from the notify_worker that runs on a tokio blocking thread, and the zbus runtime (zruntime) refuses because it considers itself already inside that runtime. The worker thread dies with the panic; whether notifications keep working afterwards, and whether the app is otherwise affected, needs checking (the app kept running here).

Wanted. No panic; desktop notifications shown reliably on Linux. Options to evaluate: run the notifier on a plain std::thread that never enters a tokio/zbus runtime context; initialise notify_rust's server information once at start on such a thread; or use the async API on the runtime. Add a test that shows a notification from the same context the runtime uses (against a fake org.freedesktop.Notifications on a private session bus, as crates/fluxer-platform/tests/notify_identity.rs already does) so this cannot regress. Check the other panic reports in that folder for different causes and file them separately if they differ.

**Found in Charles's client logs, 2026-11-16 (Linux AppImage, git 6d3ca17d, nightly 2026.1116.341).** Five panic reports in two days in `~/.local/state/flaxative/logs/panic-*.txt`; the latest: ``` thread: tokio-rt-worker location: zruntime-0.2.2/src/driver.rs:797:9 message: block_on called from a task this runtime is running: the call would wait for the very thread it is on backtrace (top): 6: <zruntime::driver::InBlockOn>::enter 7: notify_rust::xdg::get_server_information 8: … lazy_static … notify_rust::SPEC_VERSION … 12: notify_rust::hints::hints_to_map 13: <notify_rust::notification::Notification>::show 14: <fluxer_platform::notify::linux::LinuxNotifier as fluxer_platform::notify::Notifier>::notify_with_icon 15: fluxer::runtime::notify_worker 16: tokio … BlockingTask<fluxer::runtime::run::{closure#0}::{closure#2}> … ``` So showing a desktop notification panics: `notify_rust` (zbus backend) calls a blocking `block_on` to ask the notification server for its version (lazily, on the first notification that has hints), from the `notify_worker` that runs on a tokio blocking thread, and the zbus runtime (`zruntime`) refuses because it considers itself already inside that runtime. The worker thread dies with the panic; whether notifications keep working afterwards, and whether the app is otherwise affected, needs checking (the app kept running here). **Wanted.** No panic; desktop notifications shown reliably on Linux. Options to evaluate: run the notifier on a plain `std::thread` that never enters a tokio/zbus runtime context; initialise `notify_rust`'s server information once at start on such a thread; or use the async API on the runtime. Add a test that shows a notification from the same context the runtime uses (against a fake `org.freedesktop.Notifications` on a private session bus, as `crates/fluxer-platform/tests/notify_identity.rs` already does) so this cannot regress. Check the other panic reports in that folder for different causes and file them separately if they differ.
Author
Owner

Fixed in nightly 2026.1116.347. Not yet confirmed by the reporter in real use.

Fixed in nightly 2026.1116.347. Not yet confirmed by the reporter in real use.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#752
No description provided.