Microsoft KB Archive/286568

= Using Application Verifier to Troubleshoot Programs in Windows XP =

Article ID: 286568

Article Last Modified on 1/13/2006

-

APPLIES TO


 * Microsoft Windows XP Professional

-



This article was previously published under Q286568



SUMMARY
Application Verifier (AppVerifier) is included in Windows XP to promote stability and reliability. You can use this tool to troubleshoot application issues. This article describes how to use Application Verifier to isolate and troubleshoot a program in Windows XP.



AppVerifier Modes of Operation
AppVerifier features two modes of operation: debugging and logging. Developers that are familiar with software development and testing use the debugging mode to troubleshoot applications; Developers and network administrators use the logging mode to generate a log of issues encountered by a program. In this log, each issue is paired with a specific remedy.

Regardless of the mode in which it is run, AppVerifier is not an automated test tool. You must exercise all functions of the program that you are testing. AppVerifier will only aid you in pinpointing a problem after it is encountered during the testing process.

AppVerifier and SafeDisk
Many gaming and software companies use SafeDisk to prevent users from getting around copyright violations by preventing the program from running with a debugger attached. This means that if you are testing one of these programs, you may not be able to test it using AppVerifier.

Using AppVerifier
To use AppVerifier:
 * 1) Click Add to add a program to the list.

When a program is added to the list, AppVerifier is globally enabled for it. This means that whether the program is run from AppVerifier, a short cut, or the command line, the selected AppVerifier tests will be applied.
 * 1) Select the appropriate tests from the Test settings list.
 * 2) Start your application and exercise it. AppVerifier does not perform the tests of your binary; it only monitors and reports suspicious activity that it detects while you perform tests.

Note: You do not need to click the Run button to exercise your application. It is only provided as a short cut; You can always run the program as you normally would run it.
 * 1) After you complete the testing, click View Logs to see the log entries that were generated.
 * 2) Remove the program from AppVerifier when testing is complete.

AppVerifier Features
AppVerifier offers the following features:
 * Integration of PageHeap and GFlags: AppVerifier wraps the functionality of PageHeap and GFlags in a simplified user interface (UI). You can enable page-heap checking with a single mouse click.
 * Error Logging: AppVerifier places debug information into a log file that you can view and manipulate through the AppVerifier UI. This is helpful for non-technical users who do not know how to use a debugger.
 * Application Compatibility Testing: The tests written by the AppCompat team monitor for the most common application problems, including incorrect version checking, bad registry usage, and hard-coded file paths.
 * Extensible Test Architecture: Internal development teams can create their own tests by leveraging AppCompat's shim architecture. AppCompat will package approved submissions for distribution.

Expected Application Behavior While Using AppVerifier

 * The program may run slower than usual, which happens because of test overhead.
 * The program may not start for any of the following reasons:
 * The program may fail a test during launch. To work around this issue, try unchecking a few of the tests, and then try to restart the program.
 * The program may not work with a debugger attached.
 * The program may crash and you may be prompted to have a debugger attached. Some tests will crash the program if a fault is detected.

Sharing AppVerifier Logs
If you want to share an AppVerifier log with another person, click Export Log in the Verifier Log window. This will create a text file that you can send to other individuals. You can view the exported log file in any program in which you can view a text file, or you can use View External Log to examine the exported log from AppVerifier.

Main AppVerifier UI
The AppVerifier window is made up of the following three parts:
 * Applications to be verified: This section remains empty until you click Add to add the name of an executable program to be verified.
 * Test settings: This section also remains empty until you add at least one executable program to the Applications to be verified list. After you add an executable program, the available test settings appear in the Test settings list.
 * Test setting descriptions: If you would like to see descriptions of the displayed test settings, select one from the Test settings list to view the description in this section. You do not need to check the test setting for the description to be displayed.

AppVerifier Options
In AppVerifier, you can use the four following options:
 * Clear session log when test settings change: Use this option to tell AppVerifier to automatically clear a session log for the specified executable when a program is added or removed or has one of its test settings changed.
 * Break in the debugger for each log event: Use this option if you are attaching to a debugger and you want any event that would show up in the log to cause the program to break in a debugger. This option is provided primarily for advanced users who are familiar with the use of a debugger and who want to see exactly where problems are occurring in their code.
 * Use full page heap (heavy memory usage): Use this option to help find heap-related bugs and corruption anywhere in your executable. For more information about the use of full-page heap, see the explanation of Full-Page Heap in the &quot;Choosing a Method to Investigate Heap Block Corruptions&quot; section of PageHeap notes.
 * Use the AppVerifier debugger to get crash logs: Use this option to allow AppVerifier to attempt to analyze crashes on its own and dump output into the log rather than requiring a user to launch a debugger. This option is provided for less experienced users who are not familiar with the use of a debugger.

AppVerifier Log
When you run a program using AppVerifier, you can view the output in the AppVerifier Log window. You can also use this window to view logs that have been exported by using Export Log.

The logs are shown in tree form. Each log is made up of expandable items displaying information about the executable's run. This information can be as simple as a notification that the listed executable started and stopped, but it can also include more detailed information about specific Microsoft Windows requirements that are violated by the executable. Expanding an item shows a list of violations that fall under that item's category. Click an item to see more information on resolving the problem in the Possible solutions box.

Important: The log is not a complete list of issues found. Some tests log data, some throw exceptions (which means that they crash the program intentionally), and some change the programs environment and rely on the tester to verify that the program continues to function correctly.