Adding some more code to my program causes this (I'm using dc-load if it matters):
Unhandled exception: PC 8c015ca4, code 1, evt 0100
This is code that works (it's copy/pasted from elsewhere). Any idea what's going on?
Unhandled exception??
-
- DCEmu Cool Newbie
- Posts: 16
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Fri Feb 23, 2007 11:18 pm
- Has thanked: 0
- Been thanked: 0
- BB Hood
- DC Developer
- Posts: 189
- Joined: Fri Mar 30, 2007 12:09 am
- Has thanked: 41 times
- Been thanked: 10 times
Re: Unhandled exception??
Well I read in another thread that you have a BBA. I also have a BBA and I may have encoutered this same problem but im not sure. Do you upload a .bin or a .elf to the dreamcast?
Are you using DC-Tool Gui-2.0?
Are you using DC-Tool Gui-2.0?
Re: Unhandled exception??
I'm using "make run", which runs dc-tool -x whatever.bin
I just tried with the .elf, made no difference.
I just tried with the .elf, made no difference.
Re: Unhandled exception??
mat_store(&matrix)
That seems to be at the root of it. I have a few calls to this function, but the one that crashes it seems to depend on the alignment of the planets and whether I've sacrificed a goat or a chicken.
That seems to be at the root of it. I have a few calls to this function, but the one that crashes it seems to depend on the alignment of the planets and whether I've sacrificed a goat or a chicken.
Re: Unhandled exception??
Looks like fflush(stdout) wasn't getting my output out before my program crashes.
I seem to crash there.
if(state != NULL && timer < timer_ms_gettime64()) {
I seem to crash there.
if(state != NULL && timer < timer_ms_gettime64()) {
Re: Unhandled exception??
I think maybe I figured out the problem.
Is there a limit on the dreamcast/kos stack size? Once I made a few variables global, things weren't breaking for random things.
I remember having a smiliar issue on SPARC last fall.
Is there a limit on the dreamcast/kos stack size? Once I made a few variables global, things weren't breaking for random things.
I remember having a smiliar issue on SPARC last fall.
- BlueCrab
- The Crabby Overlord
- Posts: 5658
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Re: Unhandled exception??
I don't think there's any artificial limit on the stack size, and if it was a problem with your program overrunning the stack, you probably would've gotten something else about it (something to the effect of "About to overrun kernel stack, aborting").
As for what the exception code that it gave you means, a quick check of the SH4 Programming Manual (great thing to have around, by the way) tells me that it is a "Data Address Error (write)".
My guess is that you're trying to write a longword to a non-longword aligned boundary, or a word to a non-word aligned boundary. That's generally what causes problems like that (considering your code isn't running in user mode, there's only one other possibility: writing a quadword to a non-quadword aligned boundary). Check any memory access that is going on, and make sure you're not doing anything completely wrong around that area.
As for what the exception code that it gave you means, a quick check of the SH4 Programming Manual (great thing to have around, by the way) tells me that it is a "Data Address Error (write)".
My guess is that you're trying to write a longword to a non-longword aligned boundary, or a word to a non-word aligned boundary. That's generally what causes problems like that (considering your code isn't running in user mode, there's only one other possibility: writing a quadword to a non-quadword aligned boundary). Check any memory access that is going on, and make sure you're not doing anything completely wrong around that area.
-
- DC Developer
- Posts: 1753
- Joined: Thu Jan 16, 2003 4:01 am
- Location: The Netherlands
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: Unhandled exception??
The stack size for the main program has no fixed limit. Threads however are limited at 8K.Hiryu wrote:I think maybe I figured out the problem.
Is there a limit on the dreamcast/kos stack size? Once I made a few variables global, things weren't breaking for random things.
I remember having a smiliar issue on SPARC last fall.
"Nothing works" - Catweazle