Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm using XNA 3.1 ( .NET 3.5 ) and my program closes without any warning, errors, or code instructing it to do so. I looked in the output, and there aren't any obscure messages outside of telling me that certain modules had been loaded and the program was optimized. FURTHERMORE, this doesn't occur on my own personal computer. It only happens on my school computers and my mom's laptop which makes me wonder if there's a hardware issue ( ? ). The schools run Windows XP, and the laptop runs Windows 7. Both of them have the full SDK installed, so it's not a dependency problem. Does anybody have any advice for this?

Sometimes it will run for 2 seconds. Other times it will run for about 10. Sometimes if I rebuild it enough times, it runs and doesn't crash ( or rather, the "countdown" was severely extended somehow. I don't really know. )

( I would post code, but since I have absolutely no clue where my code is doing stuff wrong, that's kind of a challenge ).

share|improve this question
1  
Surrounding the main loop in a try/catch should get any unhandled errors. You could then look at the stack trace to find the source of your issue. It's likely either a race condition or as you say, a graphics hardware issue. –  Byte56 Apr 27 '13 at 20:44
    
The thing is -- I don't have access to the Main loop. XNA Defines that for me in the main Game class, and I'm pretty sure it's not a virtual function. –  Full Metal Apr 27 '13 at 22:02
2  
@FullMetal In your Program.cs file (as per the template), you can wrap game.Run(); in a try/catch block to the same effect. –  Andrew Russell Apr 28 '13 at 7:39
    
I have tried, and there is still no exception being thrown that I can detect. –  Full Metal Apr 30 '13 at 14:59

1 Answer 1

This kind of rapid exit is sometimes from calling a driver with invalid data, or for abilities it just can't do.

Assuming that you're in visual studio, find the Debug-Exceptions menu and temporarily turn on all the system ones.

Also also, check all function returns because, just because. Be paranoid whenever calling the system. While you're doing that, check all device caps to verify that the hardware you're running on has features that your code expects.

And finally, try using the debug version of DirectX/D3D (which gives a ton of extra console status output).

share|improve this answer
    
Mm...I don't think I have any references to DirectX/D3D. Nor do I have any calls to system that I'm aware of ( Unless it's done in JigLibX ). I tried turning on all system exceptions on throw and on uncaught, nothing arose. :\ –  Full Metal Apr 27 '13 at 21:54
    
Additional resources: check the event logs in your windows administration panel. Strip features out of your code until it doesn't crash. Go old school and add debug console print statements to trace program execution before the crash. Take a look at the exception handling section at MSDN, you may read something that helps. More hardcore is to install msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx and play around, I don't remember what the learning curve in windbg is anymore. –  Patrick Hughes Apr 27 '13 at 22:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.