Azure / vld

Visual Leak Detector for Visual C++ 2008-2015
https://kinddragon.github.io/vld/
GNU Lesser General Public License v2.1
42 stars 25 forks source link

False negative result on configuration Debug|Win32 #12

Open mariohuq opened 2 years ago

mariohuq commented 2 years ago

Test code (main.cpp):

#include <vld.h>
int main()
{
    int* x = new int[20];
    x[0] = 25;
}
VS Project file (test.vcxproj) ```xml Debug Win32 Release Win32 Debug x64 Release x64 16.0 Win32Proj {a3ce2794-97ae-4c58-9d13-54d7a0b8e462} TestCyrilic 10.0 Application true v142 Unicode Application false v142 true Unicode Application true v142 Unicode Application false v142 true Unicode true false true false Level3 true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true Console true Level3 true true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true Console true true true Level3 true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true Console true Level3 true true true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true Console true true true ```

Output:

Visual Leak Detector read settings from: C:\Program Files (x86)\Visual Leak Detector\vld.ini
Visual Leak Detector Version 2.5.8 installed.
No memory leaks detected.
Visual Leak Detector is now exiting.

████████████████████████████████\test.exe (process 2100) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
VS info ``` Microsoft Visual Studio Community 2022 Version 17.0.5 VisualStudio.17.Release/17.0.5+32112.339 Microsoft .NET Framework Version 4.8.04084 Installed Version: Community Visual C++ 2022 00482-90000-00000-AA087 Microsoft Visual C++ 2022 ASP.NET and Web Tools 2019 17.0.795.42246 ASP.NET and Web Tools 2019 C# Tools 4.0.1-1.21568.1+6ab6601178d9fba8c680b56934cd1742e0816bff C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package NuGet Package Manager 6.0.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory. Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory. TypeScript Tools 17.0.1001.2002 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.0.1-1.21568.1+6ab6601178d9fba8c680b56934cd1742e0816bff Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake ```
avadae commented 2 years ago

I can confirm this issue. In Win64 this reports a leak, in Win32 it doesn't.

avadae commented 2 years ago

This pull request fixes it: https://github.com/Azure/vld/pull/16