Stack overflow exception
After working a bit on my little game project i compile and when i try to run i get a stack overflow exception. It gets thrown before the program gets to main.
I'm using SDL, here is the debug output
First-chance exception at 0x00415b07 in Bacjur.exe: 0xC00000FD: Stack overflow.
Unhandled exception at 0x00415b07 in Bacjur.exe: 0xC00000FD: Stack overflow.
First-chance exception at 0x00415b07 in Bacjur.exe: 0xC0000005: Access violation reading location 0x00030000.
Unhandled exception at 0x00415b07 in Bacjur.exe: 0xC0000005: Access violation reading location 0x00030000.
The program '[2824] Bacjur.exe: Native' has exited with code 0 (0x0).
I am no expert on SDL, but unless SDL defines its own main and let's you define your own secondary main(), it's unlikely that it is overflowing the stack. (Or you have found a huge bug in SDL, which is rather unlikely)
A stack overflow, for all practical purposes, occur when you have uncontrolled recursion. Make sure that all recursive functions have a valid halting condition and that you don't have something like:
A stack overflow, for all practical purposes, occur when you have uncontrolled recursion. Make sure that all recursive functions have a valid halting condition and that you don't have something like:
int method1() { method2();}int method2() { method1();}
It could happen in the constructor of a static or global variable. That's the first thing I'd check.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement