_CrtIsValidHeapPointer crash in 64 bits

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I have an application that seems to run correctly in 32 bits, but when I run it in 64 bits, when exiting the application Visual Studio 2010 is stopping at _CrtIsValidHeapPointer.
What is strange is that my application contains an empty main.

Here is the call stack at the exit :
<pre class="prettyprint > msvcr100d.dll!_CrtIsValidHeapPointer(const void * pUserData=0x000000000227f394) Line 2036 C++
msvcr100d.dll!_free_dbg_nolock(void * pUserData=0x000000000227f394, int nBlockUse=1) Line 1322 + 0xa bytes C++
msvcr100d.dll!_free_dbg(void * pUserData=0x000000000227f394, int nBlockUse=1) Line 1265 + 0xe bytes C++
msvcr100d.dll!free(void * pUserData=0x000000000227f394) Line 50 C++
msvcp100d.dll!std::_DebugHeapDelete<std::locale::facet>(std::locale::facet * _Ptr=0x000000000227f394) Line 64 C++
msvcp100d.dll!std::locale::_Locimp::_Locimp_dtor(std::locale::_Locimp * _This=0x00000000022781f0) Line 170 C++
msvcp100d.dll!std::locale::_Locimp::~_Locimp() Line 198 + 0xa bytes C++
spectralStudio.exe!std::locale::_Locimp::`scalar deleting destructor() + 0x18 bytes C++
spectralStudio.exe!std::_DebugHeapDelete<std::locale::facet>(std::locale::facet * _Ptr=0x00000000022781f0) Line 62 C++
spectralStudio.exe!std::locale::~locale() Line 412 C++
spectralStudio.exe!`anonymous namespace::`dynamic atexit destructor for path_locale() + 0x10 bytes C++
msvcr100d.dll!doexit(int code=0, int quick=0, int retcaller=0) Line 567 C
msvcr100d.dll!exit(int code=0) Line 394 C
spectralStudio.exe!__tmainCRTStartup() Line 568 C
spectralStudio.exe!WinMainCRTStartup() Line 371 C
kernel32.dll!000000007764652d()
ntdll.dll!000000007777c521() [/code]

Notice that I never create any std::locale object myself... I have put a breakpoint in the locale constructor and it seems that it is the CRT that create this object !

<pre class="prettyprint > spectralStudio.exe!std::locale::locale() Line 316 C++
spectralStudio.exe!`anonymous namespace::`dynamic initializer for path_locale() Line 763 + 0x52 bytes C++
msvcr100d.dll!_initterm(void (void)* * pfbegin=0x000000014057ead0, void (void)* * pfend=0x0000000140584c70) Line 873 C
spectralStudio.exe!__tmainCRTStartup() Line 474 C
spectralStudio.exe!WinMainCRTStartup() Line 371 C
kernel32.dll!000000007764652d()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!000000007777c521()



> spectralStudio.exe!std::locale::locale<windows_file_codecvt>(const std::locale & _Loc={...}, const windows_file_codecvt * _Facptr=0x000000000227f394) Line 292 C++
spectralStudio.exe!`anonymous namespace::`dynamic initializer for path_locale() Line 763 + 0x77 bytes C++
msvcr100d.dll!_initterm(void (void)* * pfbegin=0x000000014057ead0, void (void)* * pfend=0x0000000140584c70) Line 873 C
spectralStudio.exe!__tmainCRTStartup() Line 474 C
spectralStudio.exe!WinMainCRTStartup() Line 371 C
kernel32.dll!000000007764652d()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!000000007777c521() [/code]
<br/>
Does someone has an idea of the problem ?

Thanks

<hr class="sig PL01

View the full article
 
Back
Top