Quantcast
Channel: Visual Leak Detector for Visual C++ 2008-2015
Viewing all 704 articles
Browse latest View live

Commented Unassigned: VisualLeakDetector crashes while shutdown, process is terminated [10569]

$
0
0
The problem is that the functions which are hooked by VLD are not properly unhooked at VLD shutdown.
That means the hooked functions are called even though VLD is destroyed already and this leads to the crash.

In RestoreImport the hooked function GetProcAddress is used instead of the real GetProcAddress (_RGetProcAddress) function, so the replaced function pointers
are taken and not the original function pointers.

Comments: Are you saying LPCVOID original = VisualLeakDetector::_RGetProcAddress(exportmodule, importname); instead of LPCVOID original = GetProcAddress(exportmodule, importname); ?

Created Unassigned: Limit VLD check to certain modules [10577]

$
0
0
Hello,

I'm using VLD to check a big project for memory leaks, the project consists of an executable and a bunch of other libraries in dll form.

I'm writing a new library, called A, which is loaded on run time by the exe, it also uses functions from a second library, called B.

The library B is very old, buggy with a lot of memory leaks.

When I add vld.h to my library, A, it will also trace the leaks originating from the library B.

How can I use/configure VLD to only trace the memory leaks from library A and ignore those originating from library B

Thanks,

Created Unassigned: Add a parameter to the number of output errors [10578]

$
0
0

Dear developers! vld in the case of memory leak issues in the log a lot of errors. It takes a lot of time! I ask You to add a parameter to the number of output errors (with the default value, for example 100). Thank you.

Commented Unassigned: Limit VLD check to certain modules [10577]

$
0
0
Hello,

I'm using VLD to check a big project for memory leaks, the project consists of an executable and a bunch of other libraries in dll form.

I'm writing a new library, called A, which is loaded on run time by the exe, it also uses functions from a second library, called B.

The library B is very old, buggy with a lot of memory leaks.

When I add vld.h to my library, A, it will also trace the leaks originating from the library B.

How can I use/configure VLD to only trace the memory leaks from library A and ignore those originating from library B

Thanks,
Comments: You should be able to use VLDDisable prior to calls to library B and then reactivate VLD leak detection after the call with VLDEnable. Documentation is here [Controlling Leak Detection at Runtime](https://vld.codeplex.com/wikipage?title=Controlling%20Leak%20Detection%20at%20Runtime&referringTitle=Documentation)

New Post: Silent install

$
0
0
I would like to have a completely silent install.

Adding /S to the executable prevents anything to show, but I still get a pop-up asking about adding paths to the environment variable. Is there anyway to force an answer as a parameter or any other thing to prevent the pop-up from displaying?

New Post: Some fixes checked in into the master branch by mistake...

$
0
0
Hi Arkadiy,
There are some fixes that I have by mistake checked in into the master branch instead of my fork - please excuse my lack of experience with Git... Could you please look at those and accept/amend/remove/etc as you find appropriate?

Those changes should fix issue #9859 (hanging on GetOpenFileName/GetSaveFileName, https://vld.codeplex.com/workitem/9859) and perhaps #9519 (hanging on CFileDialog, https://vld.codeplex.com/workitem/9519). Also, I have added support for non-Unicode MFC libraries for VS2013.

Thanks,
Yuri

New Post: Some fixes checked in into the master branch by mistake...

New Post: Some fixes checked in into the master branch by mistake...

$
0
0
OK, figured this out... Should be in the fork now.
Thanks,
Yuri

Source code checked in, #f3f8594c3b9a6ae9440a10c79b9ff84e05c357ea

$
0
0
Support MFC 12 MBCS https://vld.codeplex.com/workitem/10565

Commented Issue: Visual Leak Detector Crashes after loading [9099]

$
0
0
Hello,
I am new on VLD and I have started to use it (version 2.2) on Windows XP Service Pack 2.

We develop third part application to a CAD software (AutoCAD) from AutoDESK company (acad.exe built using VS2008)
It means that we create applications to customize AutoCAD and these applications are dll's loaded on AutoCAD memory space.

But, during the loading of our library, I get a crash in the application (stack overflow) and in the Visual Studio output debug I get the following information:
```
'acad.exe': Loaded 'C:\Data\ITLPlus\Win32\Debug\ITLPlusHDesk.arx', Symbols loaded.
'acad.exe': Loaded 'C:\Data\ITLPlus\Win32\Debug\GDCLibrary.dll', Symbols loaded.
'acad.exe': Loaded 'C:\Program Files\Visual Leak Detector\bin\Win32\vld_x86.dll', Binary was not built with debug information.
'acad.exe': Loaded 'C:\Program Files\Autodesk\AutoCAD Map 3D 2012\dbghelp.dll'
Visual Leak Detector Version 2.2 installed.
First-chance exception at 0x7c90e8ee in acad.exe: 0xC00000FD: Stack overflow.
Unhandled exception at 0x7c90e8ee in acad.exe: 0xC00000FD: Stack overflow.
First-chance exception at 0x7c90e8e5 in acad.exe: 0xC0000005: Access violation writing location 0x0f4f0ff0.
Unhandled exception at 0x7c90e8e5 in acad.exe: 0xC0000005: Access violation writing location 0x0f4f0ff0.
The program '[6020] acad.exe: Native' has exited with code 0 (0x0).
```

After that I have compiled VLD on Visual Studio 2008, but still the same problem.
I have debugged my application and I noticed that I get crash in the function void* vldnew (size_t size, const char *file, int line) present in vldheap.cpp.
This crash is during the call of the function RtlAllocateHeap(). (see image attached for information on the "Call Stack" windows in VStudio

Comments: This issue is marked Closed in 2.4, yet I still see it occurring using 2.4rc2. This is the case where we are trying to use VLD in a plugin for a main EXE that doesn't use it. Is the fixed issue something different? Thanks.

Created Unassigned: VLD Quit Working With Visual Studio 2013 [10579]

$
0
0
I have been using Leak Detector for a couple of years and it was working a few months ago. I am using VLD version 2.3.

I added a leak to a program with: “Int* xxx = new(int);”
I ran the program using Visual Studio 2013. It displays the messages “Visual Leak Detector Version 2.3 installed” and “No memory leaks detected”. It did NOT report the leak.

I changed the Platform Toolset (in Properties > General) to “Visual Studio 2012 (v110)”. (I had to add the preprocessor definition _VARIADIC_MAX=10 to get it to compile.) This time the leak was reported.

I changed the Platform Toolset again to “Visual Studio 2010 (v100)”. The leak was reported here also.

I changed the Platform Toolset one more time to “Visual Studio 2008 (v90)”. The leak was again reported.

I changed back to “Visual Studio 2013 (v120)” and tried one more time. It still did not work.

Update 4 was added to Visual Studio 2013 on November 12. I wonder if something was changed that caused VLD not to work. Have you tested it with Visual Studio 2013 update 4? Do you have any idea of anything else that would cause this?

Commented Unassigned: VLD Quit Working With Visual Studio 2013 [10579]

$
0
0
I have been using Leak Detector for a couple of years and it was working a few months ago. I am using VLD version 2.3.

I added a leak to a program with: “Int* xxx = new(int);”
I ran the program using Visual Studio 2013. It displays the messages “Visual Leak Detector Version 2.3 installed” and “No memory leaks detected”. It did NOT report the leak.

I changed the Platform Toolset (in Properties > General) to “Visual Studio 2012 (v110)”. (I had to add the preprocessor definition _VARIADIC_MAX=10 to get it to compile.) This time the leak was reported.

I changed the Platform Toolset again to “Visual Studio 2010 (v100)”. The leak was reported here also.

I changed the Platform Toolset one more time to “Visual Studio 2008 (v90)”. The leak was again reported.

I changed back to “Visual Studio 2013 (v120)” and tried one more time. It still did not work.

Update 4 was added to Visual Studio 2013 on November 12. I wonder if something was changed that caused VLD not to work. Have you tested it with Visual Studio 2013 update 4? Do you have any idea of anything else that would cause this?

Comments: I'm not sure that 2.3 ever worked in vs2013 (not without manual tweaks) Why don't you use 2.4rc2 ? In the release notes it says: "+ VS2013 support added."

Created Unassigned: HeapDestroy without HeapFree really leaks memory? [10580]

$
0
0
Hi VLD developers, I'm a developer of [MinHook](http://www.example.com).

A user of MinHook reported a memory leak. In short, VLD reports a leak when calling HeapDestroy without HeapFree.
Look at the test code below:
```
#include <windows.h>
#include <vld.h>

int main()
{
HANDLE hHeap = HeapCreate(0, 0, 0);
LPVOID pHeap = HeapAlloc(hHeap, 0, 1024);

// Skip HeapFree intentionally.

HeapDestroy(hHeap); // returns TRUE

return 0;
}
```
It causes an error like this:
```
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 1 at 0x010D05B8: 1024 bytes ----------
Call Stack:
d:\users\kageyu\documents\visual studio 2013\projects\heapleak\heapleak\main.cpp (10): HeapLeak.exe!main + 0x13 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (626): HeapLeak.exe!__tmainCRTStartup + 0x19 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (466): HeapLeak.exe!mainCRTStartup
0x748B7C04 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0x24 bytes
0x76FFB90F (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x8F bytes
0x76FFB8DA (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x5A bytes
Data:
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........


Visual Leak Detector detected 1 memory leak in heap 0x010D0000
```

However, according to the [HeapDestroy](http://msdn.microsoft.com/ja-jp/library/windows/desktop/aa366700%28v=vs.85%29.aspx) document:
> Processes can call HeapDestroy without first calling the HeapFree function to free memory allocated from the heap.


So I'm wondering if it is an actual memory leak or a false positive.

Commented Unassigned: HeapDestroy without HeapFree really leaks memory? [10580]

$
0
0
Hi VLD developers, I'm a developer of [MinHook](http://www.example.com).

A user of MinHook reported a memory leak. In short, VLD reports a leak when calling HeapDestroy without HeapFree.
Look at the test code below:
```
#include <windows.h>
#include <vld.h>

int main()
{
HANDLE hHeap = HeapCreate(0, 0, 0);
LPVOID pHeap = HeapAlloc(hHeap, 0, 1024);

// Skip HeapFree intentionally.

HeapDestroy(hHeap); // returns TRUE

return 0;
}
```
It causes an error like this:
```
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 1 at 0x010D05B8: 1024 bytes ----------
Call Stack:
d:\users\kageyu\documents\visual studio 2013\projects\heapleak\heapleak\main.cpp (10): HeapLeak.exe!main + 0x13 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (626): HeapLeak.exe!__tmainCRTStartup + 0x19 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (466): HeapLeak.exe!mainCRTStartup
0x748B7C04 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0x24 bytes
0x76FFB90F (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x8F bytes
0x76FFB8DA (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x5A bytes
Data:
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........


Visual Leak Detector detected 1 memory leak in heap 0x010D0000
```

However, according to the [HeapDestroy](http://msdn.microsoft.com/ja-jp/library/windows/desktop/aa366700%28v=vs.85%29.aspx) document:
> Processes can call HeapDestroy without first calling the HeapFree function to free memory allocated from the heap.


So I'm wondering if it is an actual memory leak or a false positive.

Comments: You can use the VLD_OPT_SKIP_HEAPFREE_LEAKS option to prevent those false leak reports, here's an example usage: ``` #include <windows.h> #include <vld.h> int main() { HANDLE hHeap = HeapCreate(0, 0, 0); LPVOID pHeap = HeapAlloc(hHeap, 0, 1024); // Skip HeapFree intentionally. // Fetch the current VLD options state VLD_UINT options = VLDGetOptions(); // Turn on the VLD_OPT_SKIP_HEAPFREE_LEAKS option VLDSetOptions((options | VLD_OPT_SKIP_HEAPFREE_LEAKS), 0, 0); HeapDestroy(hHeap); // returns TRUE // Restore VLD options VLDSetOptions((options), 256, 0); return 0; } ```

Commented Unassigned: HeapDestroy without HeapFree really leaks memory? [10580]

$
0
0
Hi VLD developers, I'm a developer of [MinHook](http://www.example.com).

A user of MinHook reported a memory leak. In short, VLD reports a leak when calling HeapDestroy without HeapFree.
Look at the test code below:
```
#include <windows.h>
#include <vld.h>

int main()
{
HANDLE hHeap = HeapCreate(0, 0, 0);
LPVOID pHeap = HeapAlloc(hHeap, 0, 1024);

// Skip HeapFree intentionally.

HeapDestroy(hHeap); // returns TRUE

return 0;
}
```
It causes an error like this:
```
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 1 at 0x010D05B8: 1024 bytes ----------
Call Stack:
d:\users\kageyu\documents\visual studio 2013\projects\heapleak\heapleak\main.cpp (10): HeapLeak.exe!main + 0x13 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (626): HeapLeak.exe!__tmainCRTStartup + 0x19 bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (466): HeapLeak.exe!mainCRTStartup
0x748B7C04 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0x24 bytes
0x76FFB90F (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x8F bytes
0x76FFB8DA (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x5A bytes
Data:
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........
0D F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD BA ........ ........


Visual Leak Detector detected 1 memory leak in heap 0x010D0000
```

However, according to the [HeapDestroy](http://msdn.microsoft.com/ja-jp/library/windows/desktop/aa366700%28v=vs.85%29.aspx) document:
> Processes can call HeapDestroy without first calling the HeapFree function to free memory allocated from the heap.


So I'm wondering if it is an actual memory leak or a false positive.

Comments: I see. Thank you for your advice!

New Post: Visual Studio 2013

$
0
0
Same problem as J_Morg here; new vld.lib and vld_x86.dll, but no memory leaks detected.
The 2.4RC2 source is incomplete, vldallocator.h for example is missing. I got the latest source from CodePlex, then compiled that under VS2013. I checked that I'm using the right DLL by adding a small text to the 'No memory leaks detected.' line in the source.

Using VS2013 v12.0.21005.1 REL. The code goes like this:

VLDSetReportOptions(VLD_OPT_REPORT_TO_FILE|VLD_OPT_REPORT_TO_DEBUGGER,L"d:/t/vld_report.txt");
VLDReportLeaks();
malloc(100);
VLDReportLeaks();

VLDEnable();
malloc(1000);

VLDReportLeaks();

But no leaks are detected. Hm.

New Post: Visual Studio 2013

$
0
0
I'm using 2.4RC2 with no issues in VS2013, I suspect your project is loading an old version of vld_x86.dll from somewhere else.

Double check your Debug output to see where the vld_x86.dll is actually being loaded from, should be loaded from here:
C:\Program Files (x86)\Visual Leak Detector\bin\Win32\vld_x86.dll'

New Post: Visual Studio 2013

$
0
0
I verified that by actually changing code (adding comments) in the vld_x86.dll itself, so I know it's the right DLL.
I only arrive in 'firstAllocCall' once per allocation. I think that when really allocating, the RtlAlloc call (or such) that gets called arrives back into VLD, where it should not be recorded twice, hence the 'firstcall' variable.

But when VisualLeakDetect::_calloc() calls 'pcalloc', for example, it never returns back into VLD. So I don't see where the allocation is being recorded in a heap map.

It might be a specific version of VS2013 I'm using (v12.0.21005.1 REL).

BTW Where did you get your dbghelp.dll and *.manifest from? I got those from the v2.3 install, but maybe that's not right.

EDIT: Further debugging; calloc() goes into pcalloc(), which calls VisualLeakDetector::enabled() for example. I then end up in _HeapAlloc(), which calls isModuleExcluded(), which always returns true...

New Post: Some fixes checked in into the master branch by mistake...

$
0
0
Hi Arkadiy,

Just out of curiosity - did you have a chance to look at the fix?

Thanks,
Yuri

New Post: Some fixes checked in into the master branch by mistake...

$
0
0
Hi Yury,

I tried it, fix some issues on X64 platform. Need more testing on different platforms.
Viewing all 704 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>