Stack overflow exception

Started by
2 comments, last by Agony 18 years, 1 month ago
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).
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();}
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Your code is bugged. Show us your code!
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
It could happen in the constructor of a static or global variable. That's the first thing I'd check.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke

This topic is closed to new replies.

Advertisement