4.12.1 Handling a Fatal Exit

If the abnormal termination was a fatal exit and the application was running with the retail version of Windows, CVW displays a fatal exit code and the CS:IP register contains an address in the Windows code itself. This small amount of information provides little to help you locate the last call that your application made before the error was detected.

If, however, your application was running with the debugging version of Windows, the CVW Command window displays a stack trace that is much more useful for finding the error in your source code.

After the stack trace appears in the CVW Command window, Windows prompts you with the following message:

Abort, Break, or Ignore?

To locate the cause of the error, press the B key. This allows CVW to regain control from Windows.

In most cases, the stack trace will have been scrolled past the top of the CVW Command window; but once CVW regains control, you can scroll the information in the window to examine the entire stack trace. The following information appears at the top of the stack trace:

A fatal exit number. For more information about Windows debugging messages, see Appendix C, “Windows Debugging Version.”

The CS:IP address, the name of the Windows function where the error was detected, or the name of the last Windows function called before the error was detected.

Following this information, additional Windows functions may be listed in the stack trace. Somewhere near the top of the stack trace, a CS:IP address is listed without a Windows function name. In most cases, this is the location in the source code of your application at which the call to a Windows function occurred, triggering the fatal exit.

To examine this location in your source code, open or switch to a Source window and use the v (View) command followed by the CS:IP address; be sure to precede both the segment and the offset with the hexadecimal prefix 0x. For example, if CVW indicates that the error occurred at 07DA:0543 in your application, type the following command:

v 0x07DA:0x0543

If the module at which the error occurred was compiled to produce object files containing symbolic information, the CVW Source window displays the location in your code at which the errant call to a Windows function occurred.

The first CS:IP address without a name in the stack trace may point to a location in your code without symbols. For example, the code may be in a DLL you didn't specify with the /l command-line option or when CVW prompted you for a DLL, or the address might be in a module that was not compiled to produce symbolic information. In such cases, CVW reports that no source code is available. If this happens, continue down the stack trace, using the v command to examine each unnamed CS:IP address. You are likely to find a location in a module that was compiled to produce symbolic information and to find this location made a call into one of your modules that was not compiled to produce symbolic information.