Unexplained crashes

Posted on 2004-08-24
Medium Priority
Last Modified: 2010-04-07
I am writing a DirectDraw game. I had a few memory issues, which I seem to have fixed using windows task-manager to find where things were going wrong. After watching the app running for some time, the memory usage doesn't seem to change.

My problem is that when I run my game on another machine to my own, it runs fine for some time, but after a while just dies. Windows doesn't give me any error messages, and as I said the memory usage doesn't seem to change, so I have no clue as to what is going on.

Does anyone have any ideas as to what is going on, or what I could do to find out?


Question by:phoenix260182
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 11885753
I take it tha your creating your game in C++, make sure you have created destructors for all your functions.

Otherwise you may be experiencing memory leaks and this will cause a crash.  

This may help you http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21010102.html 

good luck pjcrooks2000

Author Comment

ID: 11886194
Okay, I am finally getting some error messages. One of them mentions something about a call to a function. The function's name has something to do with the heap pointer. Helpful at all?

Author Comment

ID: 11886207
Oh, and yes I'm using C++ in Visual Studio .NET 2003.

Expert Comment

ID: 11886486
Yes it does sound like a problem with a call to a destructor, heap = adding to stack.  Try running debug and see where the problem comes in at from the compiler.   Possibly the F5 key I am not sure but you can get to it through the menu anyway.

Step through the program and it should stop at the point where you program fails at.

I had something not too long ago with a Tile Map game I was making, I am not sure I can help you too much more on that unless you can copy and paste the offending code in here.  But run debug to find it, you never know it may be obvious to you once you get there.

Good luck with that :)
LVL 11

Accepted Solution

bcladd earned 200 total points
ID: 11913616

The heap is where dynamic memory is allocated (new in C++). It is not enough to have destructors for every object. You also have to make sure that your destructors release any resources held by the object in question (every new MUST be paired with a delete). You also have to make sure that you release any Direct* resources that you get (they are reference counted and until all refereces are released they are not cleaned up).

I agree that the debugger is your friend if you can reproduce the error. Is there anything you can do to make it happen faster on the other machine? What are the differences between the two configurations? If you can repro the bug on a development machine, then you can (hopefully) runn the program under the VS debugger and get a postmortem (it will show where the program was when it crashed). Unfortunately, it will, most likely, be right after a call to new that has nothing to do with the problem (it is just where the memory problem was detected).

Good luck,

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question