Help with crash

SGDK only sub forum

Moderator: Stef

Post Reply
vnsbr
Interested
Posts: 39
Joined: Sun Dec 17, 2017 4:13 pm

Help with crash

Post by vnsbr » Sat Oct 05, 2019 11:57 pm

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!
Attachments
Screenshot from 2019-10-05 20-55-36.png
Screenshot from 2019-10-05 20-55-36.png (17.85 KiB) Viewed 215 times

cero
Very interested
Posts: 262
Joined: Mon Nov 30, 2015 1:55 pm

Re: Help with crash

Post by cero » Sun Oct 06, 2019 8:12 am

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.

Chilly Willy
Very interested
Posts: 2784
Joined: Fri Aug 17, 2007 9:33 pm

Re: Help with crash

Post by Chilly Willy » Sun Oct 06, 2019 1:58 pm

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.

cloudstrifer
Very interested
Posts: 73
Joined: Mon Feb 19, 2018 7:31 pm

Re: Help with crash

Post by cloudstrifer » Tue Oct 08, 2019 12:25 am

Be carefull with array sizes, maximum variable sizes, variable initialization.
Use GensKMod with debug options, CPU -> Messages.

vnsbr
Interested
Posts: 39
Joined: Sun Dec 17, 2017 4:13 pm

Re: Help with crash

Post by vnsbr » Tue Oct 08, 2019 1:11 pm

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!

Chilly Willy
Very interested
Posts: 2784
Joined: Fri Aug 17, 2007 9:33 pm

Re: Help with crash

Post by Chilly Willy » Tue Oct 08, 2019 4:23 pm

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.

Post Reply