Closed general

Panic in tao event-loop runner at OS-initiated shutdown (cannot move state from Destroyed), after the wake-heal shutdown hook

John Lauer · 1mo ago ·closed by John Lauer

Seen on arav-rog, ah 1.0.201, 2026-09-04 15:38 local, during a Windows restart chosen from the Start menu (System log 1074 from StartMenuExperienceHost, event log stop 15:38:19):

15:38:17.840 [app] Exiting pid=16852 after 367s
15:38:17.842 [wake-heal] shutdown: power-watch pump quit posted, app handle dropped
15:38:17.865 [PANIC] thread='main' at src-tauri\vendor\tao\src\platform_impl\windows\event_loop\runner.rs:371:25: cannot move state from Destroyed

The exit had already been requested and completed its own shutdown steps; the panic comes from tao's Windows event-loop runner being asked to transition after it was already Destroyed. No WER event, no dialog, autostart brought Hydrogen back at 15:39:05, so the user saw nothing. It is still a panic on the main thread at every OS-initiated shutdown, and the [wake-heal] shutdown: ... app handle dropped line immediately before it is the likely trigger: dropping the app handle from the power-watch shutdown path while the event loop is tearing down.

Not a release blocker (exit path only, invisible to the user). Worth fixing next week alongside the build-time work (#56): on the wake-heal shutdown hook, do not touch the event loop or app handle once the runner is past Destroyed, or order the power-watch quit before the Tauri exit rather than after.

1 Reply

John Lauer · 1mo ago

Fixed in ah 1.0.203 (insiders) and verified on AdomLapper.

Cause: wake_heal::shutdown() ran in the RunEvent::Exit arm, after tao had already destroyed its event-loop runner; dropping the watcher's AppHandle at that point made the runner move state from Destroyed and panic on the main thread. The call now runs in RunEvent::ExitRequested, while the loop is alive, and the Exit-arm call stays as an idempotent backstop.

Exit path on 1.0.203, a clean exit-and-relaunch via the control API:

09:11:49.281 [wake-heal] shutdown: power-watch pump quit posted, app handle dropped   <- now BEFORE the exit
09:11:49.282 [app] Exit requested
09:11:49.285 [app] Exiting pid=50960 after 67s
09:11:49.286 [wake-heal] shutdown: app handle dropped (no watch thread)               <- the backstop, a no-op
=== Hydrogen Desktop started at 2026-09-05 09:11:49 ===

PANIC lines after the exit: 0 (the 1.0.201 log on arav-rog had the panic at exactly this spot). An OS-initiated shutdown takes the same two arms.

Log in to reply.