09 August 2017, 09:12 | #1 |
son of 68k
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 ? |
09 August 2017, 17:39 | #2 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
IMHO it has to reappear in the exec's task list, either in 'waiting' or 'running' state. This can only be done with createprocess(), i believe?
|
09 August 2017, 18:04 | #3 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Such a task actually remains in 'waiting' list. Something like Wait(0) involved to freeze it permanently.
It doesn't get removed and therefore does not need to get added again ; trying this could well mess the task lists up. |
09 August 2017, 18:41 | #4 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
Not what you ask but I've the source code of never released software done by a friend who do stuff a bit like GOMF. It is doing ressource tracking etc and try to cleanly close a crashed prog. It surely could be improved.
Kamelito |
09 August 2017, 19:13 | #5 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
What is that 'never released software' able to do ? |
|
09 August 2017, 20:07 | #6 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Found something !
The OS changes tc_TrapCode to call the guru if the program crashes again. In addition, strange behavior of subsequent programs run from that cli seems to be linked to tc_TDNestCnt. |
10 August 2017, 07:48 | #7 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
It patches OS functions to be able to do ressources tracking and if a program crash try to safely close it and free the ressources that program
Programs like ARTM, Xoper and Scout could be analyzed, better have a look at Scout as the sources are available on Aminet. Kamelito Last edited by kamelito; 10 August 2017 at 08:04. |
10 August 2017, 09:29 | #8 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Ok but i don't want to patch the system. As i said my programs do that internally so it works everywhere.
|
10 August 2017, 12:32 | #9 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
The source to Xoper ist also included in its archive, fully asm.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Winuae crashed | kep | support.WinUAE | 1 | 24 January 2016 16:55 |
Workbench crashed | Leandro Jardim | support.WinUAE | 2 | 31 May 2013 08:52 |
Amiga 2000 HD: Time to resurrect :) | Analog-X64 | support.Hardware | 3 | 08 November 2012 15:41 |
Just decided to resurrect my Amiga500's | ceedy | support.Hardware | 5 | 17 February 2011 21:51 |
Which gamemap should i process next...?? | Joe Maroni | HOL contributions | 35 | 10 July 2008 05:36 |
|
|