View Full Version : visual c++ debugger crashes my OS. help!
sodasoft
12-09-2003, 02:24 PM
hi,
My visual c++ project crashes my OS (win 2000) when I exit the debugger. This only happens on my game project, not on other projects. One of the signs of impending doom is when the global watch variables in the debugger change to "out of memory error".
While I can reboot each time I enter the debugger, this is very annoying. Does anyone know why this might possibly happen? Again, it doesn't happen on other visual c++ project files, just my current game one.
Thanks in advance.
Pyabo
12-10-2003, 12:26 AM
Have you applied all the service packs? Then check the knowledge base.
LordKronos
12-10-2003, 04:33 AM
Assuming you haven't done something bad in your code, first try to do a clean and then rebuild all. If that doesn't work, copy all of your source files to another directory and create a brand new project. If there is a corruption in one of your project files, this will fix it since all the files will be recreated. You'll just have to remember to redo all the custom settings you were using.
Mark Fassett
12-10-2003, 08:29 AM
One of the signs of impending doom is when the global watch variables in the debugger change to "out of memory error".
From this line, sounds like you have a memory leak in your game that's running your machine out of memory.
sodasoft
12-10-2003, 09:04 AM
Originally posted by Mark Fassett
From this line, sounds like you have a memory leak in your game that's running your machine out of memory.
Maybe so. But this out of memory twitch occurs while I'm tracing through instruction by instruction. And those instructions don't allocate or deallocate memory. Which leads me to believe it's not really a memory leak but something else really bizarre.
As for the other suggestions, they're good ones but what about the resource files that I'm using? My game is integrated to a map/sprite editor. Do I just copy resource.h? I definitely don't want to recreate all the dialog boxes this project uses.
Thanks for all the comments and feedbacks.
SPACENEEDLEEXCHANGE
12-10-2003, 10:45 AM
do you have some kind of function call in your watch window that could be chewing up memory with each call every time it's evaluated (which, when inside the quickwatch window, is OFTEN)?
sodasoft
12-10-2003, 11:13 AM
Originally posted by SPACENEEDLEEXCHANGE
do you have some kind of function call in your watch window that could be chewing up memory with each call every time it's evaluated (which, when inside the quickwatch window, is OFTEN)?
Im' not sure I understand your question. You may have something if it affects just one variable but I get "out of memory" for all of the globals.
The only thing I can think of is, I am fixing the logic/game to 60HZ/second, and video update to variable. It could be that when I'm stepping through in the debugger, and when I click F5 to run, somehow the debugger program is unable to process the many seconds that have passed and consequently locks up, causing it to fail.
Does this sound plausible to anyone?
sodasoft
12-10-2003, 06:26 PM
I think I solved it. It turns out there was a bad block in the virtual memory disk sector windows 2000 uses. This bug would only manifest itself in large projects during debug such as my game project. Because of the bad block, it would cause Win2K to hang.
Solution: I moved the virtual memory to my secondary HD and that seems to have taken care of it.
Question: Does that mean I can never again use my C Disk for the OS virtual memory? Doesn't windows use the same sectors for it's virtual memory? I am unfamilar with how harddisks are used. Since a bad block exists, does that mean my C drive is now unreliable? If data is written in the future to that bad block, what's going to happen? loss of data?
LordKronos
12-11-2003, 03:35 AM
If you run scandisc on the drive, it should detect it and mark it as bad. Once that's done, the OS will never use that sector again, so you are safe from that aspect. The only problem is that (at least in my experience) when one sector on a drive goes bad, it usually isn't long before more start to go.
BitBoy
12-11-2003, 06:52 AM
Originally posted by sodasoft
I think I solved it. It turns out there was a bad block in the virtual memory disk sector windows 2000 uses. This bug would only manifest itself in large projects during debug such as my game project. Because of the bad block, it would cause Win2K to hang.
Wow, that must be one of the most obscure and hard-to-solve bug/problem I've ever heard of. Bad disk blocks aren't exactly one of the first things you look for! :rolleyes:
As LordKronos just said, bad blocks tend to socialize in crowds, so don't expect that block to be single for very long. I would get a replacement for the drive as fast as I could, and also make a backup of all my stuff!
My last harddrive (the infamous IBM Deskstar) crashed this summer, making me loose a couple of months worth of work. It could have been much worse, since I didn't make backups very often. I'm trying to make backups at least semi-regularly after that lesson, but I'm still lazy...
sodasoft
12-11-2003, 07:11 AM
Thank you for the replies. If it's true that my C drive is about to crash, this couldn't have happened at a worse time. I'm about to go Alpha and this is the last thing I need. I'll be backing up routinely now. I'd hate to lose even a single day's work. :mad: