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

Commented Unassigned: VS2013: Unit tests crash [10568]

$
0
0
vld v2.4rc2

In VS2013 if I add
#include <vld.h>
the unit tests crash if run.
This is the output:
```
------ Run test started ------
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information. If the logs are not enabled, then enable the logs and try again.
========== Run test finished: 0 run (0:00:00,8760876) ==========

```

If run in debug mode I get this error:
```
Unhandled exception at 0x77CA8E19 (ntdll.dll) in vstest.executionengine.x86.exe: 0xC0000005: Access violation writing location 0x00000014.
```
and this call stack:

```
> ntdll.dll!_RtlpWaitOnCriticalSection@8() Unknown
ntdll.dll!_RtlEnterCriticalSection@4() Unknown
vld_x86.dll!0d24ea8b() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for vld_x86.dll]
vld_x86.dll!0d24b43d() Unknown
dbghelp.dll!0d2acd40() Unknown
dbghelp.dll!0d2ae7da() Unknown
dbghelp.dll!0d2acc26() Unknown
dbghelp.dll!0d2eb311() Unknown
[External Code]
Nvd3d9wrap.dll!73563da3() Unknown
Microsoft.VisualStudio.TestTools.CppUnitTestFramework.Executor.dll!0f3c6ac6() Unknown
[External Code]
```
Please note that vld is working correctly in this project. Just the unit tests have this problem.
Comments: I'm experiencing the same issue, is there any workaround to get vld working with unit tests?

Commented Unassigned: VS2013: Unit tests crash [10568]

$
0
0
vld v2.4rc2

In VS2013 if I add
#include <vld.h>
the unit tests crash if run.
This is the output:
```
------ Run test started ------
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information. If the logs are not enabled, then enable the logs and try again.
========== Run test finished: 0 run (0:00:00,8760876) ==========

```

If run in debug mode I get this error:
```
Unhandled exception at 0x77CA8E19 (ntdll.dll) in vstest.executionengine.x86.exe: 0xC0000005: Access violation writing location 0x00000014.
```
and this call stack:

```
> ntdll.dll!_RtlpWaitOnCriticalSection@8() Unknown
ntdll.dll!_RtlEnterCriticalSection@4() Unknown
vld_x86.dll!0d24ea8b() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for vld_x86.dll]
vld_x86.dll!0d24b43d() Unknown
dbghelp.dll!0d2acd40() Unknown
dbghelp.dll!0d2ae7da() Unknown
dbghelp.dll!0d2acc26() Unknown
dbghelp.dll!0d2eb311() Unknown
[External Code]
Nvd3d9wrap.dll!73563da3() Unknown
Microsoft.VisualStudio.TestTools.CppUnitTestFramework.Executor.dll!0f3c6ac6() Unknown
[External Code]
```
Please note that vld is working correctly in this project. Just the unit tests have this problem.
Comments: Further to my previous post, I have found a workaround: 1) In VS select your UnitTest project and build in debug 2) Open the Developer Command Prompt for VS2013 3) Navigate to your UnitTest Debug folder 4) Type the command: vstest.console.exe /platform:x86 [YourUnitTestName].dll 5) Your unit test should run to completion. You will see multiple "Visual Leak Detector: Waiting for threads to terminate..." Allow this to continue, eventually it will terminate and you will get your VLD report, without the Access Violation errors.

Commented Unassigned: VS2013: Unit tests crash [10568]

$
0
0
vld v2.4rc2

In VS2013 if I add
#include <vld.h>
the unit tests crash if run.
This is the output:
```
------ Run test started ------
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information. If the logs are not enabled, then enable the logs and try again.
========== Run test finished: 0 run (0:00:00,8760876) ==========

```

If run in debug mode I get this error:
```
Unhandled exception at 0x77CA8E19 (ntdll.dll) in vstest.executionengine.x86.exe: 0xC0000005: Access violation writing location 0x00000014.
```
and this call stack:

```
> ntdll.dll!_RtlpWaitOnCriticalSection@8() Unknown
ntdll.dll!_RtlEnterCriticalSection@4() Unknown
vld_x86.dll!0d24ea8b() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for vld_x86.dll]
vld_x86.dll!0d24b43d() Unknown
dbghelp.dll!0d2acd40() Unknown
dbghelp.dll!0d2ae7da() Unknown
dbghelp.dll!0d2acc26() Unknown
dbghelp.dll!0d2eb311() Unknown
[External Code]
Nvd3d9wrap.dll!73563da3() Unknown
Microsoft.VisualStudio.TestTools.CppUnitTestFramework.Executor.dll!0f3c6ac6() Unknown
[External Code]
```
Please note that vld is working correctly in this project. Just the unit tests have this problem.
Comments: scrub the previous post, although the workaround appears to allow the unit tests to complete, VLD fails to detect any memory leaks present in unit tests.

Created 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.

New Comment on "Using Visual Leak Detector"

$
0
0
Hi all, I'm new to VLD. I'm debugging an application with known memory leak (~20 M). I just installed Visual Leak Detector, configured vld with all required setting, and ran it with my program. However, I did not get any report of memory leak from Visual Studio Output; instead, I found VLD module could not function due to following warning from the Visual Studio Output: WARNING: Visual Leak Detector: A module, igdumdim32.dll, included in memory leak detection does not have any debugging symbols available, or they could not be located. Function names and/or line numbers for this module may not be available. Any thought how I can fix this problem? Thanks.

New Post: Visual Studio 2013

$
0
0
Hello, is it really fixed? I am checking the 2.4RC2, but in Visual Studio 2013 I am always getting 'No memory leaks detected.' I wonder whether it is not broken by the update of the VS. I installed VS2013 with Update 3 (so my version of the Visual Studio is 12.0.30723.00 Update 3). I checked the loaded vld.dll and the header file vld.h which was included during compilation and both are correct.

New Post: Visual Studio 2013

$
0
0
I narrowed the problem. The problem is caused by one of our 3rd party library which uses own memory management and it overwrites the global new/delete operators silently. It seems that all allocations then go to their internal storage and this storage is thrown away at the end. The VLD catches the allocation of that storage and also it catches the releasing of that storage. So everything seems ok with VLD.

New Comment on "Using Visual Leak Detector"

$
0
0
I installed without a problem. I created a dummy bare-bones 64-bit console application using VS2013 on Windows7. I added only three lines to the main program file created by the wizard. The resulting code looks like this: // TestVLD.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <vld.h> int _tmain(int argc, _TCHAR* argv[]) { char *testLeak = new char[1000000]; testLeak = nullptr; return 0; } When I run in the debugger, the PDB files for the main program load fine, but there are a bunch of "Cannot find or open the PDB file" messages pertaining to MS built-in OS files in C:\Windows\System32. After those messages, the only report I get from VLD is the following: Visual Leak Detector Version 2.3 installed. No memory leaks detected. Visual Leak Detector is now exiting. The program '[7840] TestVLD.exe' has exited with code 0 (0x0). I would have thought that VLD would have no problem detecting that blatant memory leak. What am I doing wrong?

New Post: Detecting leaks in specific files

$
0
0
Is there any way to detect memory leaks from specific source files, by using MACROs or something?

New Post: Detecting leaks in specific files

$
0
0
Every leak detected gives a detailed call stack. From the call stack one can know from where exactly in your source code is the leak being generated.

New Post: Detecting leaks in specific files

$
0
0
Sorry, I meant is there any way to enable only certain files for leak detection. Only if a leak is generated from those files it should be displayed on the console the rest of the leaks should be ignored.

New Post: error LNK2001: unresolved external symbol "__declspec(dllimport) class VisualLeakDetector g_vld" (__imp_?g_vld@@3VVisualLeakDetector@@A)

$
0
0
Hello,
I tried to use VLD with VS2010 and got the same error on existing project:
error LNK2001: unresolved external symbol "__declspec(dllimport) class VisualLeakDetector g_vld" (__imp_?g_vld@@3VVisualLeakDetector@@A)
.\Debug\Controller.exe : fatal error LNK1120: 1 unresolved externals
I have checked the path, performed the additional copying of dll`s to apps Debug and Windows folders, but the project could not be linked.

Any ideas ?

New Post: report leak when i set /MTd flag

$
0
0
use vs2012
create a console project
change /MD to /MTd
set include path and library path

include "vld.h"

f5

report lot leak, why?

use /MD everything is ok....

Commented Unassigned: COM object cannot be registered [10553]

$
0
0
I have a large solution contains many COM objects.

So, I have added vld.h to one of the COM projects to try to detect memory leaks.
After this VS2010 cannot register this COM after it is built.
I have removed include vld.h then VS successfully registered.
How I can solve this problem?
Thank you.

Comments: Has anyone solved this problem yet? If so, please share the solution. thx

Created Unassigned: How to include vld source files directly into a project [10570]

$
0
0
I would like to include vld source files into my own project rather than using vld.lib/vld.dll.

Can anyone tell me how?

thx


Commented Unassigned: COM object cannot be registered [10553]

$
0
0
I have a large solution contains many COM objects.

So, I have added vld.h to one of the COM projects to try to detect memory leaks.
After this VS2010 cannot register this COM after it is built.
I have removed include vld.h then VS successfully registered.
How I can solve this problem?
Thank you.

Comments: I want to include vld source directly into ComTest project to debug vld source directly. Can anyone modify the ComTest project including the whole vld source files? I tried myself, but got compile errors. So, I am asking help here.

Created Unassigned: Multibyte MFC Library for Visual Studio 2013 support [10571]

$
0
0
VLD doesn't work correctly with Multibyte MFC Library for Visual Studio 2013. Could you please add support of it?
See: http://www.microsoft.com/en-us/download/details.aspx?id=40770

Closed Unassigned: COM object cannot be registered [10553]

$
0
0
I have a large solution contains many COM objects.

So, I have added vld.h to one of the COM projects to try to detect memory leaks.
After this VS2010 cannot register this COM after it is built.
I have removed include vld.h then VS successfully registered.
How I can solve this problem?
Thank you.

Comments: Duplicate of issue https://vld.codeplex.com/workitem/6359

Commented Issue: Failed to register COM dll [6359]

$
0
0
When i include Visual leak detector and build the source code than it is unable to register the dll on XP and on Windows 7, regsvr32.exe crashes.
Environment : VS2008 , OS is XP
error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry.
Environment : VS2008 , OS is Windows 7
error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry and after that regsvr32 crashes to regsiter the dll.
Thanks in advance.

Comments: mmxida posted an exact way to reproduce this issue from http://vld.codeplex.com/workitem/10553 and also attached a sample project(ComTest.zip). I tried it and also got the same COM register failure. So, this sample project is a very good one to reproduce the issue.

Created Unassigned: Waiting for threads to terminate... [10572]

$
0
0
I am developing a COM dll which is CoCreateInstanced by a program.

When vld exits, it calls waitForAllVLDThreads from which WiatForSingleObject is called for each thread in m_tlsMap. In normal cases, it returns WAIT_OBJECT_0.

However, if that program is also injected with an external dll for logging purpose,
WaitForSingleObject always returns WAIT_TIMEOUT.
vld tries it for at most 9 threads (for 90 seconds) before returning from waitForAllVLDThreads.

//--------------------------------
[log from Output window]
//--------------------------------
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
No memory leaks detected.
WARNING: Visual Leak Detector: Some threads appear to have not terminated normally.
This could cause inaccurate leak detection results, including false positives.
Visual Leak Detector is now exiting.
//--------------------------------

There are two cases depening on the availability of the external dll's source code.

[case 1] external dll's source available
Adding the following line into the external dll's source file will solve this issue. I don't know why, though.
#include <vld.h>

But, isn't there any way to avoid this issue without adding vld.h to the external dll's source file?

[case 2] external dll's source not available
How can this issue be resolved?




Viewing all 704 articles
Browse latest View live


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