August 23, 2020

Tracking down a Synchronous Abort

Suppose you finish adding some new code, boot up Kyu and are greeted with this:
Ram alloc start: 400e0000
ram_alloc: 4194304 (4194304) bytes -- 400e0000
Current EL = 2

Synchronous Abort
cur_thread: 400d5820 ()

SP:      7bf1ac00
LR:      4000a844
ELR:     40009db4
SPSR:    600003c9
One approach is to just go look at whatever code you just added and see if you can quickly identify whatever stupid thing you did. This is probably the best approach, but it is possible to use the information above. Part of the current build process is to produce the file "kyu.dump" during each build. This is a disassembly of the entire Kyu kernel.

Fire up an editor and search for the address given by the LR register and you should quickly see exactly what routine was executing to cause the abort.

Typical causes

In one case I was passing a variable when I should have been passing the address of a variable. That was simple enough to fix.

The case shown above led me to a call to thr_free() inside of thr_alloc(). This in itself was not immediately instructive. The problem was that I was trying to launch a thread before fully initializing the thread system.


Have any comments? Questions? Drop me a line!

Kyu / [email protected]