How to use Microsoft Application Verifier
Asked Answered
T

2

34

Using C++ and discovered today during a demo that I'm suffering from a corrupted heap (but only on important occasions!!). I found a few posts here on SO and decided to download Application Verifier and Debugging tool. I am current running Visual Studio 2010.

So, now I'm left with an installtion of the the debugging tool where I get a folder called Windows Kits. In the folder I have an app called WinDbg where I tried to open my app and run it. It worked fined but I was not able to get any info about my heap corruption. Then I installed the verifier which only left me with a header file and a .dll file which I dont know what to do with.

So, could anyone please tell me how to use this tool so that I dont have to suffer anymore embarrassing moments like these? Been searching in forums and since I dont even know how to open the verifier, I'm truly lost when I read the instructions how to use it (from 2009)

Trousers answered 20/4, 2012 at 4:2 Comment(3)
Here is your question answered, in great detail ! blogs.technet.microsoft.com/askperf/2009/05/22/…Courtesy
@Rigel link invalidLordship
Just in case other people run into the issue I had - Be sure to run appverif.exe under administrator priviledges. (Right-click "Run As Administrator"). If you aren't running the appverif.exe under admin conditions it won't let you add your application for testing. It'll only allow you to view previous logs.Seine
P
34

App Verifier will install a AppVerif.EXE executable. Run it, and tell it to verify your application. Then run your application in a debugger (either WinDBG or your IDE).

Psychosomatics answered 20/4, 2012 at 7:22 Comment(9)
where? in the app verifier folder under program and files i could not see any executablesTrousers
it was located in system32 and did not know how to look for it when i didnt know the name of itTrousers
The last step is: re-run App Verifier and select menu item View->Logs; application reports will be listed along with date, number of errors and warnings detected. To see the results, there is the View button, but on my system does nothing. I Save As xml files and read the output with a generic text viewer.Kathrynekathy
Is it necessary to run the application in debug mode? technet.microsoft.com/en-us/library/bb457063.aspx says just run the application.Plaice
Appverifier says to get the best results, application should run in debug mode.Plaice
Sorry but your answer sucks. Your 25 words does not actually explain what to do.Courtesy
@Sahara: MSalters got my vote because, in my case, AppVerifier found the problem without my exerting an iota of effort. I ran c:\windows\system32\AppVerif.exe, added my app to the left-hand window via "File > Add Application", selected "Basics" in the right-hand window, pressed "Save" and "Exit", and then ran my app in Visual Studio in debug mode. It instantly pinpointed where my code was adding a 7th element to the end of a 6-element array. This is all I needed to do to allow AppVerifier to "do its thing".Emergent
@MosheRubin - Thanks. This is helpful. I did not understood that I have to run the program from 'outside'. I was looking to run it from inside AppVerifier!Courtesy
What if the application runs as a SYSTYEM service ? Does the application verifier work if I start the service as usual and then I attach the debugger to the process ? Should I use the vsjitdebugger.exe (Just-in-time debugger) instead ?Kamenskuralski
U
11

Consider using the Application Verifier in conjunction with the Visual Studio debugger.

  1. Start Visual Studio and compile your application
  2. Start the application Verifier utility.
  3. File => Add Application
  4. Select the appropriate Tests (e.g. heaps, exceptions,...)
  5. Use Visual Studio Debug to start your application.

When something bad happens... your debugger will stop. This should give you a pretty good idea of the source of the problem.

Also, it might help to load the missing symbols before starting your test. In Visual Studio 2017, you can do this by:

  1. Debug
  2. Options and Settings
  3. Debugging
  4. Symbols
  5. Load all symbols

Good luck!

NOTE: When you are done, be sure to disable the AppVerfier checks that you enabled... otherwise you may experience some unexpected side-effects 6 months down the road when you have forgotten about AppVerifier.

REFERENCES

Unicorn answered 25/1, 2019 at 14:46 Comment(4)
Using VS 2019 and started app under debugger the only thing I see is "process has exited with code X" - no break, just finished state. Even when I enable all checkmarkus in exception settings window and disable "just my code".Ursas
appVerif.exe was not present on Windows 10 19h1 default install. I did find @ C:\Windows\System32\appverif.exe on my developer host machine with has several toolsets. Perhaps it came with Microsoft ADK or WDK debugger tools.Magdala
@kevinf as mentioned the References section above, you have to download the application.Unicorn
THIS VERSION OF APPLICATION VERIFIER IS OUTDATED AND SUPPLIED AS-IS FOR OPERATING SYSTEMS OLDER THAN WINDOWS 7. New releases are distributed in the Windows SDK - developer.microsoft.com/windows/downloads/windows-10-sdk. For previous versions of Windows, archived SDK releases are available at developer.microsoft.com/windows/downloads/sdk-archive.Magdala

© 2022 - 2024 — McMap. All rights reserved.