Page 1 of 1

Help with crash

Posted: Sat Oct 05, 2019 11:57 pm
by vnsbr
This crash is ocurring at random times... how can i trace the line code?

I have symbol file, but not sure wich values should i look for (there is nothing related to ADDR in that file)

thanks!

Re: Help with crash

Posted: Sun Oct 06, 2019 8:12 am
by cero
You can try addr2line with the generated .elf file and that PC address. Verify with a debugging emulator, use the memory view and see what asm is at the pc address.

Re: Help with crash

Posted: Sun Oct 06, 2019 1:58 pm
by Chilly Willy
A0 clearly got loaded with the wrong value. Why is the question, and could have many answers. You'll need to find the code where a0 is getting loaded and find where it got off.

Re: Help with crash

Posted: Tue Oct 08, 2019 12:25 am
by cloudstrifer
Be carefull with array sizes, maximum variable sizes, variable initialization.
Use GensKMod with debug options, CPU -> Messages.

Re: Help with crash

Posted: Tue Oct 08, 2019 1:11 pm
by vnsbr
thanks to all, i am developing in linux though and dont have access to gens kmod, only gens, but that one doesnt have debug opions afaik. Using addr2line I only got garbage values like ??:??, maybe some transformation to the address is necessary? that looks like a really strange address..

I redid the linked list code and i think i got ride of the bug at least :D!

Re: Help with crash

Posted: Tue Oct 08, 2019 4:23 pm
by Chilly Willy
You want to use PC for addr2line, not the faulting ADDR. The faulting address is clearly trash loaded from somewhere unintended - an unset pointer, an out of range array, whatever. You want to look at the code at the PC to see what it was doing when it loaded A0 so you can find it in your code to determine where you went wrong.

And I dev in linux for old consoles, too. What I do is make logging routines - they sometimes print messages to the screen, and in some cases merely set the background color. By setting different colors at different points in the code, you can tell how far it got before crashing at a glance. You can also run gens kmod in WINE.