Debugging a system hang (entire OS freezes)

Started by
5 comments, last by Endurion 9 years, 8 months ago

Hi. I have an application I'm working on that, perhaps 1 time in 500, hangs the entire system on startup. And by that, I mean that the entire OS freezes including the mouse pointer, and no input is accepted from the keyboard. I can't even imagine what I could be doing from within the confines of my program in order to cause these system-wide effects, but I assume that it's some kernel mode thing. Does anyone have any tips on debugging this sort of issue? This is a C++ OpenGL application running on Windows 7.

Advertisement

I would try to log as much as I could to a file (flush it out or close the file after each write). Then when it hangs, reboot, and look over the log file. This may give you at least approximate area where it hags.

Ok yeah, I've got trace logging, although this happens so infrequently that I'd hate to have it on all the time. I guess I really should, though. Thanks.

attach a windbg remotely and see if you can debug it that way? =)

This is a C++ OpenGL application running on Windows 7.


Update your graphics drivers first. The major proprietary OpenGL drivers are often very buggy and even simple functions or innocent combinations of functions can cause all kinds of kernel panics and freezes. This is one of the reasons both Firefox and Chrome jump through hoops to translate WebGL and their internal rendering through Direct3D instead of using OpenGL directly. Direct3D drivers are forced to use more of Microsoft's runtime and the WDDM model which also makes them more resilient to internal driver errors or hardware errors than the typical OpenGL driver (on any platform).

Sean Middleditch – Game Systems Engineer – Join my team!

Check the system logs in the Control Panel. There's often useful information there.

Check if minidumps are being generated.
If you've disabled your Swap File or its size is too low, minidumps won't be generated.

Also don't rule the possibility of hardware problems. If your application has no VSync, and the CPU is not doing anything, the GPU may be running so fast it overheats or your PSU can't deliver enough power; which is harder to witness in other programs because rarely the GPU runs 100% uninterrupted (because of VSync or because the CPU has actually some work to do, stalling the GPU)

Are you using any libraries or systems beside OpenGL? Like playing sound during startup?

Sometimes it's the coincidental accessing of a resource (by your game and some other program) getting drivers bonkers

(I had something similar on a HP desktop where starting a sound in DirectSound and WinAmp starting a song at the same time would completely hang the machine)

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

This topic is closed to new replies.

Advertisement