This project has moved. For the latest updates, please go here.

endless recursive call to VLD itself

Dec 7, 2013 at 4:09 AM
hello,

I found a bug of VLD: endless recursive call to VLD itself. The callstack is as the following.
It's just because getTls() calls TlsSetValue() API, and TlsSetValue() calls RtlAllocateHeap(), but heap allocation is hooked by VLD, so the recursion is endless.
vld_x86.dll!VisualLeakDetector::getTls()  Line 983  C++
vld_x86.dll!VisualLeakDetector::enabled()  Line 904 + 0x8 bytes C++
vld_x86.dll!VisualLeakDetector::_HeapAlloc(void * heap=0x00610000, unsigned long flags=8, unsigned long size=4096)  Line 1544 + 0x10 bytes  C++
KernelBase.dll!_TlsSetValue@8()  + 0x45f04 bytes    
vld_x86.dll!VisualLeakDetector::getTls()  Line 996 + 0x16 bytes C++
vld_x86.dll!VisualLeakDetector::enabled()  Line 904 + 0x8 bytes C++
vld_x86.dll!VisualLeakDetector::_HeapAlloc(void * heap=0x00610000, unsigned long flags=8, unsigned long size=4096)  Line 1544 + 0x10 bytes  C++
KernelBase.dll!_TlsSetValue@8()  + 0x45f04 bytes    
vld_x86.dll!VisualLeakDetector::getTls()  Line 996 + 0x16 bytes C++
vld_x86.dll!VisualLeakDetector::enabled()  Line 904 + 0x8 bytes C++
vld_x86.dll!VisualLeakDetector::_HeapAlloc(void * heap=0x00610000, unsigned long flags=8, unsigned long size=4096)  Line 1544 + 0x10 bytes  C++
KernelBase.dll!_TlsSetValue@8()  + 0x45f04 bytes    
vld_x86.dll!VisualLeakDetector::getTls()  Line 996 + 0x16 bytes C++
vld_x86.dll!VisualLeakDetector::enabled()  Line 904 + 0x8 bytes C++
vld_x86.dll!VisualLeakDetector::_HeapAlloc(void * heap=0x00610000, unsigned long flags=8, unsigned long size=4096)  Line 1544 + 0x10 bytes  C++
KernelBase.dll!_TlsSetValue@8()  + 0x45f04 bytes    
vld_x86.dll!VisualLeakDetector::getTls()  Line 996 + 0x16 bytes C++
vld_x86.dll!VisualLeakDetector::enabled()  Line 904 + 0x8 bytes C++
vld_x86.dll!VisualLeakDetector::_HeapAlloc(void * heap=0x00610000, unsigned long flags=8, unsigned long size=4096)  Line 1544 + 0x10 bytes  C++
Coordinator
Dec 20, 2013 at 5:56 PM
Can you provide more information?
OS version, VS version, static or dynamic CRT you use
Do you use Application Verifier?
Dec 23, 2013 at 4:54 AM
Edited Dec 23, 2013 at 5:02 AM
hello,

I'm using windows 8.1 enterprise edition x64(6.3.9600), visual studio 2008 team system sp1, static CRT lib linked to my 32-bit dll.
no Application Verifier.

It can be 100% re-produced.

BTW: I think the following post is just the same reason.

https://vld.codeplex.com/discussions/224047