Jump to content
  • Advertisement
Sign in to follow this  
bugboy

GAH! WTF?

This topic is 5181 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

My programming life just went from fine to horrible in about 5 minutes. This is what happened. 1. Started MSVC7 and loaded my game. 2. Coded some new code. 3. Noticed that my new code gave me a weird asm error and took it out. 4. Tested my code in the state where it was a day ago when it worked and still got the error. 5. Pasted in my code from two days ago and still got the error. 6. Restarted and still got the error. And here's the error: First-chance exception at 0x00512a15 in shooter.exe: 0xC00000FD: Stack overflow. Unhandled exception at 0x00512a15 in shooter.exe: 0xC00000FD: Stack overflow. It then takes me to an asm file called chkstk.asm and gives me this code: The fourth line is the line it says is the error. probepages: sub ecx,_PAGESIZE_ ; yes, move down a page sub eax,_PAGESIZE_ ; adjust request and... test dword ptr [ecx],eax ; ...probe it cmp eax,_PAGESIZE_ ; more than one page requested? jae short probepages ; no I'm not very good at techinical things like this, I've only been programming in c++ for a few months, its just that I had 4+ years of prior experience in java, vb and basic so I've been able to make alot of progress.

Share this post


Link to post
Share on other sites
Advertisement
Try a clean rebuild from nothing. Sometimes that's all it takes.

Also, I would add that even if you're just working on a project by yourself, having some kind of source revision control can be a complete and total lifesaver. I put all my projects on sourceforge and use TortoiseCVS to manage it and I never have to worry about changes that may have broken something because I always have a revision history to look at. It's saved my bacon many, many times.

Share this post


Link to post
Share on other sites

your overflowing your stack, check your functions maybe one has a huge array defined or something (place it on the heap [global] or malloc it). Or try a complete rebuild.

Share this post


Link to post
Share on other sites
Rebuild didn't work. I did notice that when I changed the number of an array it worked up to the main loop instead of crashing before the window even appeared. But the array was tiny, I was changing it from 5 to 1.

Share this post


Link to post
Share on other sites
Try to make sure you're not using recursive functions that can go down to huge depths, and that you're not returning functions, as this is the same thing as recursion although people sometimes don't see it. Other than that all I can suggest is setting a few breakpoints to find out more about where things are going wrong.

Share this post


Link to post
Share on other sites
Are you using any recursive functions? That could also be the source of a stack overflow if the recursion goes too deep.

Share this post


Link to post
Share on other sites
Post a topic with a good titile next time and I'll post a reply with a good answer.

NOTE: no one can guess this without seeing any code or having any idea what you changed.

Share this post


Link to post
Share on other sites
Using breakpoints it seems that the error is starting at the function that updates the enemies. I commented it out and now the error happens again at the function that updates bullets. So I kept on going and commented out a bunch of stuff and now it apparently does one loop before giving me the error somewhere else.

I'm pretty sure that none of my functions are recursive. Maybe I should try sending someone my code and seeing if it works on their comp.

I think the real question should be why does code that ran perfectly a few days ago give me a error today?

Share this post


Link to post
Share on other sites
Are you certain the compiler settings haven't been accidently or unexpectedly set to make the requested stack space smaller than usual? I would try your code, but I only have MSVC++ 6.0 and the 8.0 Express Beta.

Share this post


Link to post
Share on other sites
I can't figure out how to change the requested stack space and yes i have googled.

If you told me what you do in MSVC6 then I could probably figure it out.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!