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

Commented Unassigned: Visual Leak Detector not working with CppUnitTestFramework [10592]

$
0
0
Hi,

if I include the "vld.h" in a file and run unit test (with Microsofts CppUnitTestFramework) on the project
some problem occurs:

```
------ Discover test started ------
========== Discover test finished: 59 found (0:00:00,1930193) ==========
------ 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:01,9781978) ==========
```

If I "debug" the test case the test case runs after termination I see the following exceptions:

```
Visual Leak Detector: Waiting for threads to terminate...
No memory leaks detected.
First-chance exception at 0x000000001BCD7F2F (vld_x64.dll) in vstest.executionengine.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
First-chance exception at 0x00000000777AEF39 (ntdll.dll) in vstest.executionengine.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
First-chance exception at 0x00000000777AEF39 (ntdll.dll) in vstest.executionengine.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
Unhandled exception at 0x00000000777AEF39 (ntdll.dll) in vstest.executionengine.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
```


Googling this problem I found that others have similar problems, e.g.:
http://stackoverflow.com/questions/16232613/visual-leak-detector-not-working-with-unit-test-in-vs2012


I used VLD 2.4rc2.
Comments: The workaround I've been using for this issue is: 1) In VS select your UnitTest project and build in debug 2) Open the Developer Command Prompt for VS2013 or VS2015 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.

Viewing all articles
Browse latest Browse all 704

Trending Articles



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