Archived

This topic is now archived and is closed to further replies.

Malikive

Possibly tough question to answer

Recommended Posts

Hey all, first time to the forums here. I consider myself a beginner programmer but enough to make a Direct X game so I posted here cuz it''s about a game... Anyways, I started making a Direct X tetris clone that''s about half way done with bugs galore. The most obvious bug is about 2 ~ 3 mins into the game (roughly), the game crashes, a blue screen (not the blue screen of death) with a bunch of information flashes for 1/2 a second (can''t even read it) and restarts my computer displaying a Windows XP error report. I don''t even know what could cause it, if anyone has any suggestions, I would appreciate it. If this post is too vague, I apoligize for asking.

Share this post


Link to post
Share on other sites
quote:
Original post by Malikive If this post is too vague, I apoligize for asking.
Don't apologize, post more info! I'd look for overflows, personally. Sounds like that might be your problem, what with it crashing 2 - 3 minutes into the game. Some value could be accumulating until it reaches the limit of it's data type, and crashes the program. Look for integer overflows, I've had problems with those before.

Also, is there anything specific which happens in the game after 2 - 3 minutes? Some special feature which messes up DirectX? In fact, what are you using for rendering: Direct3D, or DirectDraw? If you could post some or all of your code (use the tags [*source] and [*/source] without the asterisks to surround it; you'll get a nice little source code box), then I'm sure some of the DirectX guys around here will be able to sort it out...

EDIT: Welcome to the forums, by the way. May you live long and prosper...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on May 4, 2003 10:25:42 PM]

Share this post


Link to post
Share on other sites
Also.... what video card do you have, and do you have the latest drivers installed? a critical STOP error (which is what that was) can be caused by buggy drivers.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
I agree with Sneftel - a memory leak is probably your first concern as a BSOD is pretty drastic, but it''s not the only posibility. The DirectX documentation talks about exceptions with regards to a reset call. DX9 also includes some new information regarding Internal Driver Errors. If the BSOD is of type unhandled exception you may want to investigate further here.

If you are not handling errors or checking SDK return values then update your code and step trace through them. Ensure that you zero out all data before using it and check against NULL for basic santity checking - this will flush out lots of basic problems.

MSVC also has a mechanism where you can set a break point to happen after a certain condition becomes true. This can be very handy with bugs like this as you do not need to go through your game loop 10,000 times manually waiting for the ''problem'' to occur.

Good Luck -

Share this post


Link to post
Share on other sites
hrm, I am using DirectDraw with DirectX 9.0 installed and the DX 8 SDK (I believe).

my system specs:
Windows XP
AMD Athlon XP 2000+ @ 1.7 Ghz
512 RAM

Video: GeForce 3 Ti 200
4072 Drivers

Perhaps my driver is a bit out of date, I thought I kept it updated, I''ll try that...

I do actually have error checks in my DirectX calls ...example (trying to use that source thing iNsAn1tY suggested...)


   
// create direct draw 7 interface

if(FAILED(DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7,NULL)))
{
MessageBox(GlobalHWND,"Failed to Create Direct Draw Interface","DirectX Error",MB_ICONSTOP);
return(0);
} // end if



Will try to update Drivers...thank you all for the warm welcome and helpful comments, will keep this post updated.

Share this post


Link to post
Share on other sites
quote:
Original post by Malikive
a blue screen (not the blue screen of death) with a bunch of information flashes for 1/2 a second (can't even read it) and restarts my computer displaying a Windows XP error report.


that's windows xp's way of avoiding BSODs, it just restarts before you get a chance to read it. it's true.

edit: ye olde spelling

[edited by - necromancer_df on May 4, 2003 11:58:34 PM]

Share this post


Link to post
Share on other sites
You can set windows xp so it won''t automatically reboot on a system failure. Look in the startup and recovery section in the system properties. At least that way you can see what''s failed.

Share this post


Link to post
Share on other sites
The infamous "Blue Screen of Death" is a Kernel Panic. That blue screen is Windows XP''s Kernel Panic screen. Yes, it is a "blue screen of death" of sorts. Just so you know...

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"ralashi. jeva kel''juret''tot kunsholat kar''gran."
"Life. It is not the game it was."

- = ( serevu tiogshi sa kar''nio sharik je''sharti. ) = -
- = ( Tiogshi wrote this sharti ) = -

I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites
Thank you for your comments everyone...

I did turn off the restart on system failure like cavemanbob suggested and got the BSOD with somethin like...

IRQL_NOT_LESS_OR_EQUAL

(some junk) and a STOP: 0x000000A (hex numbers)

Prolly not worth much, but I do need to go back through the program and check for increasing variables and integer overflows like suggested. Haven''t had a ton of time to work with it. Thank you all for your comments and will keep this thread updated

Share this post


Link to post
Share on other sites
Ah - the IRQL_NOT_LESS_OR_EQUAL message...

I have seen this a couple of times and I *think* (IIRC) that this happens when a system process tries to access memory which it does not own. Check on Google as I would expect you'll find more info. there...

NOTE: Buggy driver implementation can cause this error condition.

Regards,
Sharky

EDIT: check this link if you haven't already

---
#define _WEBSITE
Sharky's Coding Corner
#endif
---


[edited by - Sharky on May 5, 2003 7:12:49 PM]

Share this post


Link to post
Share on other sites
IRQL_NOT_LESS_OR_EQUAL is a very common problem in drivers and happens when a driver is using an improper address, which is usually an errant pointer. This gets triggered when a thread accesses pageable memory when the interrupt request level is too high. In english this basically means that somewhere in the driver routine there is access to pageable memory when the system has it''s IRQL to high. The reason this happens is because the routine can get called away and the memory paged causing a "BadThing" so the system bugchecks to keep the system from becoming unstable.

The stack trace should give you an idea of the offending routine. The first parameter is the virtual address of the memory referenced. The second parameter is the IRQL level at whcih access was attempted. The third parameter indicates if it was a read (0) or write (1) operation. The fourth parameter is the address in he code that referenced the memory.

This is most likely a driver or DX issue unless your app somehow managed to overwrite something in the driver routines (interesting, that would indicate a possible buffer overflow situation...) which is pretty unlikely. Still, if you are able to run just about any comercial game without issue you have to think whatever you are sending to the driver is causing it to puke.

Share this post


Link to post
Share on other sites
Oh, brilliant, a real flamewar! IMHO, DirectX is crappy, and OpenGL is the only real graphics API! Ahahahahahahahahahaha! Nah, I'm just kidding. Anyway, my Phalanx anti-missile Gatling gun beats your flamethrower...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on May 9, 2003 4:00:28 PM]

Share this post


Link to post
Share on other sites