• Advertisement
Sign in to follow this  

Stack overflow exception

This topic is 4366 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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).

Share this post


Link to post
Share on other sites
Advertisement
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:


int method1() {
method2();
}

int method2() {
method1();
}

Share this post


Link to post
Share on other sites
It could happen in the constructor of a static or global variable. That's the first thing I'd check.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement