When running an x86_64 application including vld.h built using Visual Studio 2015 Update 2 Community Edition on Windows 10, Insider Preview build 14352.rs1 release.160522-1930, I get a crash in ntdll.dll in a call to `RtlFreeMemoryBlockLookaside`. There's nothing else present on the stack.
Attached is a simple project that reproduces the crash.
The only code is:
```
#include <vld.h>
int main() {
return 0;
}
```
The compiler options are the default on Debug x64:
```
/GS /W3 /Zc:wchar_t /I"C:\Program Files (x86)\Visual Leak Detector\include" /ZI /Gm /Od /sdl /Fd"x64\Debug\vc140.pdb" /Zc:inline /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\VLDCrash.pch"
```
The linker options are also the default on Debug x64:
```
/OUT:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.exe" /MANIFEST /NXCOMPAT /PDB:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG:FASTLINK /MACHINE:X64 /INCREMENTAL /PGD:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\VLDCrash.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files (x86)\Visual Leak Detector\lib\Win64" /TLBID:1
```
The output log is as follow:
```
'VLDCrash.exe' (Win32): Loaded 'C:\Projects\VLDCrash\x64\Debug\VLDCrash.exe'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\apphelp.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Program Files (x86)\Visual Leak Detector\bin\Win64\vld_x64.dll'. Cannot find or open the PDB file.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Program Files (x86)\Visual Leak Detector\bin\Win64\dbghelp.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols loaded.
Visual Leak Detector read settings from: C:\Program Files (x86)\Visual Leak Detector\vld.ini
Exception thrown at 0x00007FFB46F95FE7 (ntdll.dll) in VLDCrash.exe: 0xC0000005: Access violation reading location 0x00007FFB470A4D8A.
```
And the callstack:
```
> ntdll.dll!RtlFreeMemoryBlockLookaside() Unknown
```
The crash happens even if VLD is disabled by setting `VLD = off` in `vld.ini`. Let me know if there is further info you'd need. I'm very interested in a workaround for that issue.
Comments: Awesome! Looking forward to it. Thank you for investigating.
Attached is a simple project that reproduces the crash.
The only code is:
```
#include <vld.h>
int main() {
return 0;
}
```
The compiler options are the default on Debug x64:
```
/GS /W3 /Zc:wchar_t /I"C:\Program Files (x86)\Visual Leak Detector\include" /ZI /Gm /Od /sdl /Fd"x64\Debug\vc140.pdb" /Zc:inline /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\VLDCrash.pch"
```
The linker options are also the default on Debug x64:
```
/OUT:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.exe" /MANIFEST /NXCOMPAT /PDB:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG:FASTLINK /MACHINE:X64 /INCREMENTAL /PGD:"c:\Projects\VLDCrash\x64\Debug\VLDCrash.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\VLDCrash.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files (x86)\Visual Leak Detector\lib\Win64" /TLBID:1
```
The output log is as follow:
```
'VLDCrash.exe' (Win32): Loaded 'C:\Projects\VLDCrash\x64\Debug\VLDCrash.exe'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\apphelp.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Program Files (x86)\Visual Leak Detector\bin\Win64\vld_x64.dll'. Cannot find or open the PDB file.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Program Files (x86)\Visual Leak Detector\bin\Win64\dbghelp.dll'. Symbols loaded.
'VLDCrash.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols loaded.
Visual Leak Detector read settings from: C:\Program Files (x86)\Visual Leak Detector\vld.ini
Exception thrown at 0x00007FFB46F95FE7 (ntdll.dll) in VLDCrash.exe: 0xC0000005: Access violation reading location 0x00007FFB470A4D8A.
```
And the callstack:
```
> ntdll.dll!RtlFreeMemoryBlockLookaside() Unknown
```
The crash happens even if VLD is disabled by setting `VLD = off` in `vld.ini`. Let me know if there is further info you'd need. I'm very interested in a workaround for that issue.
Comments: Awesome! Looking forward to it. Thank you for investigating.