Priest of the Order of the Butterfly
Posts: 525 from 2004/2/10
Thank you very much for spending your time to resolve this issue for me.
I will try and find someone who owns the source code for Ami-Back to see it may be a chance to get it corrected. I will also test some of the other programs on MOS and see if they run reliably enough. Funny it was the best one I tested on a 3000 when I wrote my review and have used it for 30 years and rarely had any issues with it. I was lucky indeed!
Again thanks for the help!
AMI-Back crashes when writing the index file at the end of a backup.
How can I work to resolve this?
I spent some hours debugging this today.
Ami-Back is unfortunately buggy in a way it handles subtask ("AmiBackTask") termination: rather than properly waiting for this subtask to terminate it makes an assumption about the task termination and FreeMem() the "struct Task" memory before the subtask has really terminated. This results in the task memory being re-used for other purposes while the task is still executing. If you're lucky the timing goes in your favour and the task manages to terminate before the memory is really reused. If you're unlucky this results in a complete system crash due to invalid memory references deep in the system scheduler (that the system can't recoverer from).
There is unfortunately nothing that can be done to fix this is in MorphOS itself. The application would need to be fixed to prevent this crash.
In particular the subtask would need to Forbid() before indicating the parent task about completion. This way the subtask would safely clean up before the parent task has a chance to run (and FreeMem() the subtask "struct Task").
The Ami-Back application has always been buggy like this, but the probability of the crash getting triggered depends on the system: Less busy system with fewer memory allocations and running tasks might survive by luck. It also depends on the specifics of the system scheduler.
Hence the application has better chances of running by luck on AmigaOS 68k system. Yet, if unluckly it will crash there as well.
I'm afraid this is bad news in general if your backup solution is based on this application. I'm afraid there is no way to make it run reliably, unless if someone wants to take the task of fixing the application by binary patching it.