Sign in to follow this  
Surg

Stack overflow exception

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this