View Single Post
Old 09 August 2017, 09:12   #1
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
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 ?
meynaf is offline  
 
Page generated in 0.04374 seconds with 11 queries