Replies: 1 comment 1 reply
-
I doubt this can be done in a way that is even vaguely reliable. First off you can make rust just abort on panic and not even try to unwind the stack. Secondly it is not flly documented waht happens in edge cases during unwinding (like triggering a second panic during the unwind process, etc.). Even if you manage to rn all the necessary Drop traits for everythign: One typical reason to panic is running out of memory. Rebuilding the entire UI from scratch in that case does not sound like a good idea -- as that will just panic again when trying to allocate memory for the UI elements. I think the only reliable way to recover a process after a panic is from another process. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Do you have any ideas how to try to recover app after a panic?
Of course I know the simplest solution of having kind of a watchdog script restoring entire process, but sometimes it's practical to read "last valid state" from memory.
So here is how I've tried:
The I preferred restoring all slint structures (generated in
ui
module) to avoid any possibility of inconsistent state left after panic. Unfortunately, the second run always fails:winit
backend panics when callingshow
, saying that creating multiple event loops is not supported.qt
running event loop again repeatedly panics with message 'Recursion in timer code'.I guess what I do is not quite supported. My question is: do you have any idea how can achieve something similar?
Beta Was this translation helpful? Give feedback.
All reactions