0

ALL,

I'm trying to develop a program in C++ using MSVC. The development is done on the laptop running Windows 8.1. During one of the run I saw that the IDE reports a bunch of memory leaks.

Googling shows that there is a tool called Visual Leak Detector (VLD). So I grabbed it and added the appropriate options, recompiled and re-run.

Apparently the application crashed. I added VLD to all DLLs that the project contains but still got the same crash. Trying to debug it, I see that the application doesn't even hit the creation of the application object.

Next step I did is I moved my code to another laptop which runs Windows 7 and has the same MSVC 2010 installed. I recompiled the application on that machine and ran it. The application started without any issues.

Next step I tried - run Dependency Walker on the binary executable on Windows 8.1 machine. The Dependency Walker found that I am missing couple of DLLs (API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL, API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL and couple more of that nature). So going back to Google I found this post: c++/cli DLL fails under Win 8.1, which says I shouldn't be using Dependency Walker at all.

So now my question is - how do I build the program with VLD on Windows 8.1 machine to see where are my leaks?

Thank you and sorry for such a long post.

[EDIT]

Here is the backtrace at the time of the crash:

ntdll.dll!77440d72()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] vld_x86.dll!00d9abf0()
vld_x86.dll!00dae9df()
vld_x86.dll!00daeb4d()
KernelBase.dll!74dd3126()
user32.dll!75cd7433()
user32.dll!75cd5ab6()
user32.dll!75cd58c4()
ntdll.dll!7744959e()
ntdll.dll!77449518()
ntdll.dll!77457685()
ntdll.dll!7745b390()
ntdll.dll!7746735f()
vld_x86.dll!00daf9b6()
vld_x86.dll!00dadd99()
msvcrt.dll!756ab0f9()
KernelBase.dll!74dd2fd3()
vld_x86.dll!00daf9b6()
vld_x86.dll!00daf9b6()
vld_x86.dll!00dade47()

[/EDIT]

Community
  • 1
  • 1
Igor
  • 5,620
  • 11
  • 51
  • 103
  • See http://stackoverflow.com/a/39515110/383779 – sergiol May 02 '17 at 23:07
  • @sergiol, why did you refer me there? I don't have the same issue. I compile OK, the binary is produced. It is a run-time issue. – Igor May 02 '17 at 23:45
  • `Apparently the application crashed` - how concrete ? – RbMm May 03 '17 at 03:48
  • @RbMm, sorry for the delay. It says "Access violation writing location 0x00000008. and points to vld.h. – Igor May 08 '17 at 04:02
  • this show that some object pointer is 0 and was reference to this object field (with offset 8). need look call stack at crash for begin – RbMm May 08 '17 at 07:20
  • @RbMm, backtrace at the time of crash added. The actual program code didn't even start executing. – Igor May 08 '17 at 10:42
  • without symbol installed very hard say what happens. however vld have symbols and [source](https://github.com/KindDragon/vld). download latest version - [v2.5.1](https://vld.codeplex.com/releases/view/630509). put *pdb* at *D:\WORK\VLD\SRC\bin\Win32\Release-v140\vld_x86.pdb* (x64 version put at *D:\WORK\VLD\SRC\bin\x64\Release-v140\vld_x64.pdb* ), src folder from src code code copy to *D:\WORK\VLD\SRC\* (if you have not disk *D:* - insert flash as disk *D:* for example - debugger will be search exactly at this path). try install system symbols too. after this try with *v2.5.1* and update – RbMm May 08 '17 at 11:26

0 Answers0