Hello guys,
I am trying to understand how I can use a crashlog to find were the problem is on my programs. Is there any documentation anywhere that gives some information on how to use that information? I checked the wiki.amigaos.net and couldn't find something there.
Thanks for your help.
There still some information on the wiki: check the Tutorials/Debugging section.
But not sure if it will help to understand why the app crashes. Usually, most of the important info non-developer or just a C developer can get, is a stack trace (when app builds with -gstab, meaning debug information stored in binary, and GR can get it to the stack trace with the pointing out on the source file and line where it crashes).
Then, all other information is mostly for developers: some values in some registers may help to understand what kind of crash happens (null pointer crash, or something else). PPC disassembly may also point to something. But that all for a low-level developer who knows assembler and internals of the memory layouts, heap constructions, how a stack works, and so on.
Thanks kas1e for your reply.
I also found your comment at https://www.os4coding.net/comment/986#comment-986 which seems to cover some part of the changelog output.
It seems both memguard and GrimReaper output similar information, or am I completely wrong?
It does help knowing some machine language. And common PPC instructions for loading and storing. But here is a sample crash log for examination:
This is stripped slightly to focus on relevant sections.
Now we can see the task and type at the top. This one is a common DSI (Data Storage Interrupt) exception. Which translates to an illegal memory address. This could be unmapped memory, a bad address or even a null pointer. We see here the Data Address (dar) is zero. So this one was a null pointer. (Note that on the X1000 I have found the DSI to contain mismatched data.)
The Instruction Pointer (ip) contains the address of the offending instruction.
The Stack trace is top down. On top the last address it found pointing to the crash. On bottom the first address leading up to the crash.
The PPC disassembly lists the bad code. Pointed to by an asterix. In this case it was an lbz, a byte load from register r9, offset zero. If we check r9 in the Register dump we can confirm it contains a zero. Therefore, it tried to read a byte from address zero. An illegal operation. Easily caught on OS4/PPC. Easily missed on OS3/68K.
If your binary has debug symbols these will also be showed. Usually as function name and offset from entry. Which can help to narrow it down to where it crashed and with what.