Log in

View Full Version : Softice and System crash when going into message loop


Joe Doe
June 24th, 2001, 21:33
I am getting started debugging with Ice. However whenever I break into the the program at the beginning, and trace it into the message loop the system will hang. The hole system. SI, windows everything.
So somewhere in here:


while( GetMessage( &lpMsg, NULL, 0, 0 ) ) /* begin the message loop */
{
TranslateMessage( &lpMsg );
DispatchMessage( &lpMsg );
}
The system is hanging. Has anyone else experienced this problem, or know why it is happening to me?

Thanks a lot

Kayaker
June 24th, 2001, 23:34
Hi,

You may have a bad RET sitting in ESP and your calls return to some non-code address. I've had SI hang a few times on me this way. It may also hang if you're performing some operation on an invalid memory address. Like mov [500000], eax where [500000] contains 'FFFFFFFF', meaning that address isn't mapped into memory yet. Chances are you'd just get an error message with the above example, but who knows, it might just decide to hang instead on your system, it's the kind of thing to watch out for anyway.

If you're tracing with SI you should be able to single step (F8 ) and find the exact location where it hangs, and watch the registers to see what's being passed, or where you end up. You can look at your TranslateMessage Msg structure, its address being pushed in eax just before the call, and see if it's all OK. If you can F10 step over the TranslateMessage call without hanging, then maybe it's the DispatchMessage call giving trouble.

In any case, that's the beauty of SoftIce, you should be able to single step to the exact trouble spot, even if that means tracing completely through the API calls. If you do find it, you can use the 'a', 'e' or 'r' commands in SI to change the code, memory contents, or register values to try to circumvent the hanging until you can fix your code (even a crash is better than a hang).

Hope this helps,

Kayaker