Resurrect a crashed process
Hi all,
Sometimes a process crashes "cleanly" and does the usual suspend/reboot popup. There is no resource tracking and everything is left open : files, screens, etc. In theory you should just save what you can and then reboot, but the system isn't necessarily unstable at that point.
Most of my programs have internal resource tracking, so i've had the idea to use that to clear them up when something goes wrong -- this is useful for debugging.
The method is simple, i just run another program which finds the task structure, changes its program counter to point to clean-up code (which will restore normal stack pointer), sets some signals to wait and then Signal() it.
So far i've been only partially successful. The program is indeed closed and control is returned to the parent cli. Everything's fine if i just close that cli.
But if i try to reuse it, it will not work properly : behaves strangely with regard to multitasking and a second crash will directly call the guru.
I guess something's left in a bad state.
What Exec does to the task when suspending it ?
What to change in the Task or Process structure to make it clean again ?
|