application-verifier

How to use Debug with/without Microsoft Application Verifier in Visual Studio 2013

浪子不回头ぞ 提交于 2020-01-23 11:13:12
问题 So I've installed the application verifier to help me with debugging, however I don't know how to use it properly. First off, it seems to have attached itself permanently to visual studio. Whenever I run any application in debugging mode through visual studio, the verifier automatically steps in. This is a problem, because it slows down the execution massively, but there doesn't seem to be a way to run the debugger without the verifier anymore? I really don't want to reinstall it every time I

ApplicationVerifier is not detecting handle leaks, what do I do?

≯℡__Kan透↙ 提交于 2020-01-17 13:44:13
问题 I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak. Here is an example: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { HANDLE hFile = CreateFile(_T("C:\\test.txt"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); return 0; } ApplicationVerifier doesn't detect this. What can I do to detect the above problem? 回答1: Is your code

ApplicationVerifier is not detecting handle leaks, what do I do?

安稳与你 提交于 2020-01-17 13:43:04
问题 I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak. Here is an example: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { HANDLE hFile = CreateFile(_T("C:\\test.txt"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); return 0; } ApplicationVerifier doesn't detect this. What can I do to detect the above problem? 回答1: Is your code

How to use Application Verifier to find memory leaks

混江龙づ霸主 提交于 2019-12-18 12:28:26
问题 I want to find memory leaks in my application using standard utilities. Previously I used my own memory allocator, but other people (yes, you AlienFluid) suggested to use Microsoft's Application Verifier, but I can't seem to get it to report my leaks. I have the following simple application: #include <iostream> #include <conio.h> class X { public: X::X() : m_value(123) {} private: int m_value; }; void main() { X *p1 = 0; X *p2 = 0; X *p3 = 0; p1 = new X(); p2 = new X(); p3 = new X(); delete

ASSERT(::IsWindow(m_hWnd)) fails in Afxwin2.inl

老子叫甜甜 提交于 2019-12-11 20:15:38
问题 I am creating a view in my project which is a child class of CView. class CBaseGLView : public CView In oncreate function I am checking it null or not as below: int CBaseGLView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; m_hWnd = GetSafeHwnd(); if( ::IsWindow(m_hWnd)== NULL) { return 1; } m_pCDC= new CClientDC(this); m_hDC = m_pCDC->GetSafeHdc(); if (SetWindowPixelFormat()==FALSE) return 0; return 0; } When I am debugging with

gethostbyname API fails when App Verifier is on

折月煮酒 提交于 2019-12-08 01:59:17
问题 I ran into a problem trying to test an application under Application Verifier with Page Heap on. It turns out that gethostbyname API always fails even for legit host names like "localhost". The problem reproduces on every Win-7 or Server 2008 R2 I tried even for a very simple test applications using gethostbyname. Repro steps: in appverifier check "page heap" and "UseLFGGuard..." checkboxes, run any app using gethostbyname(..). Example of application code (prints "127.0.0.1" when appverifier

gethostbyname API fails when App Verifier is on

偶尔善良 提交于 2019-12-06 09:17:13
I ran into a problem trying to test an application under Application Verifier with Page Heap on. It turns out that gethostbyname API always fails even for legit host names like "localhost". The problem reproduces on every Win-7 or Server 2008 R2 I tried even for a very simple test applications using gethostbyname. Repro steps: in appverifier check "page heap" and "UseLFGGuard..." checkboxes, run any app using gethostbyname(..). Example of application code (prints "127.0.0.1" when appverifier is off, "getaddrinfo failed" when appverifier is on): #include <winsock2.h> #include <ws2tcpip.h>

How to use Microsoft Application Verifier

亡梦爱人 提交于 2019-12-03 19:44: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

Application Verifier reports access violation in call to ShellExecuteEx

我与影子孤独终老i 提交于 2019-12-01 07:27:59
问题 Short Version Application Verifier says there is an access violation when running the code: var shi: TShellExecuteInfo; begin shi := Default(TShellExecuteInfo); shi.cbSize := SizeOf(TShellExecuteInfo); shi.lpFile := PChar('C:\Windows'); ShellExecuteEx(@shi); end; What's wrong with it? Long Version I'm running my application under the Application Verifier, with the option to detect heap corruption enabled: Heaps : Checks the heap errors. During the call to ShellExecuteEx , an exception comes

How to use Application Verifier to find memory leaks

北战南征 提交于 2019-11-30 07:27:21
I want to find memory leaks in my application using standard utilities. Previously I used my own memory allocator, but other people (yes, you AlienFluid) suggested to use Microsoft's Application Verifier, but I can't seem to get it to report my leaks. I have the following simple application: #include <iostream> #include <conio.h> class X { public: X::X() : m_value(123) {} private: int m_value; }; void main() { X *p1 = 0; X *p2 = 0; X *p3 = 0; p1 = new X(); p2 = new X(); p3 = new X(); delete p1; delete p3; } This test clearly contains a memory leak: p2 is new'd but not deleted. I build the