For Programmers: Free Programming Magazines  


Home > Archive > VC STL > January 2006 > heap corruption when using std:string ???









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author heap corruption when using std:string ???
Frank Samuel

2006-01-09, 11:10 pm

Oops,
perhaps I should use the multithreaded CRT ;-)

Frank

"Frank Samuel" <FSamuel_nospam@misag_remove_spam.com> wrote in message
news:O3U8No7BGHA.984@tk2msftngp13.phx.gbl...
> Hi,
> I've written the attached test program.
>
> When executing it with 20 threads in parallel (parameter 1) for some
> minutes, I get GPFs in the kernel heap manager, e.g. like this call stack:
> ntdll.dll!_RtlFreeHeapSlowly@12() + 0x17f
> ntdll.dll!_RtlDebugFreeHeap@12() + 0x193
> ntdll.dll!_RtlFreeHeapSlowly@12() + 0x23d19
> ntdll.dll!_RtlFreeHeap@12() + 0x16470
> OVWSFileWrites.exe!_free_dbg(void * pUserData=0x003342e8, int
> nBlockUse=1) Line 1207 + 0x9 C
> OVWSFileWrites.exe!operator delete(void * pUserData=0x003342e8) Line 54
> + 0x10 C++
> OVWSFileWrites.exe!std::allocator<char>::deallocate(char *
> _Ptr=0x003342e8, unsigned int __formal=208) Line 132 + 0x9 C++
>
> OVWSFileWrites.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
>
> OVWSFileWrites.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
> 458 C++
> OVWSFileWrites.exe!CreateName(unsigned long idSession=1988, int
> iSequenceNumber=719, int iNumber=0, char * extension=0x004520e8) Line 41
> + 0x2d C++
> OVWSFileWrites.exe!WorkerThreadProc(void * lParam=0x00333058) Line 51 +
> 0x1b C++
>
> I'm running on Windows XP SP2 with the latest patches.
> I compile with VS 2003.
>
> What's the problem?
>
> Thanks,
> Frank
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com