Posts: 571 from 2003/2/24
From: finland, the l...
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.[ Edited by Piru 04.07.2021 - 13:49 ]