runtime error when build static - vs2010
Posted: Sun Sep 12, 2010 16:40
throwing assert:
debug output:
callstack:
using ogre, open al, lua, cegui 0.7
vs2010, win 7, 32bit
is static build app..
working as dll...
the string "buf" (or "mem") in deconstruction (end of function) is the localy created one (file: CEGUIOgreResourceProvider.cpp :: line: 71)
i can also produce this error outside of cegui [use other lib first doing string stuff - so nearly every] (in an other lib - statically linked) - just by strings (with concat) like this (localy created and after method end deleted):
(not tested without concat)
any ideas?
edit:
log just shows initialisation is finished - this was the newest one...
and so it's not with every string - the strings in the log worked - as it looks...
example code also triggering this runtime error (inside of other lib):
(also triggering at local clean up, also calling destructor)
calling constructor (i think) three times - last time comes assert.
edit2:
type: std::basic_string<char,std::char_traits<char>,std::allocator<char> > * const
edit 3:
the last function call seams to return the false -> HeapValidate( _crtheap, 0, pHdr(pUserData) );
Code: Select all
file: f:\dd\vctools\crt_bld\self_x86\crt\scr\dbgheap.c
line: 1322
exception: _CrtIsValidHeapPointer(pUserData)
debug output:
Code: Select all
...........
'projekt.exe': Loaded 'C:\Windows\System32\wrap_oal.dll', Cannot find or open the PDB file
HEAP[projekt.exe]: Invalid address specified to RtlValidateHeap( 02720000, 088A1058 )
Windows has triggered a breakpoint in se projekt.exe.
This may be due to a corruption of the heap, which indicates a bug in se projekt.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while se projekt.exe has focus.
The output window may have more diagnostic information.
callstack:
Code: Select all
> se projekt.exe!_CrtIsValidHeapPointer(const void * pUserData) Line 2036 C++
se projekt.exe!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1322 + 0x9 bytes C++
se projekt.exe!_free_dbg(void * pUserData, int nBlockUse) Line 1265 + 0xd bytes C++
se projekt.exe!operator delete(void * pUserData) Line 54 + 0x10 bytes C++
se projekt.exe!std::allocator<char>::deallocate(char * _Ptr, unsigned int __formal) Line 182 + 0x9 bytes C++
se projekt.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built, unsigned int _Newsize) Line 1998 C++
se projekt.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 755 C++
se projekt.exe!CEGUI::OgreResourceProvider::loadRawDataContainer(const CEGUI::String & filename, CEGUI::RawDataContainer & output, const CEGUI::String & resourceGroup) Line 76 + 0xf bytes C++
........
using ogre, open al, lua, cegui 0.7
vs2010, win 7, 32bit
is static build app..
working as dll...
the string "buf" (or "mem") in deconstruction (end of function) is the localy created one (file: CEGUIOgreResourceProvider.cpp :: line: 71)
i can also produce this error outside of cegui [use other lib first doing string stuff - so nearly every] (in an other lib - statically linked) - just by strings (with concat) like this (localy created and after method end deleted):
Code: Select all
"i am a" + "string"
(not tested without concat)
any ideas?
edit:
log just shows initialisation is finished - this was the newest one...
and so it's not with every string - the strings in the log worked - as it looks...
example code also triggering this runtime error (inside of other lib):
Code: Select all
Ogre::LogManager::getSingleton().logMessage("Version: " +
Ogre::StringConverter::toString(MAJOR) + "." +
Ogre::StringConverter::toString(MINOR));
(also triggering at local clean up, also calling destructor)
calling constructor (i think) three times - last time comes assert.
edit2:
type: std::basic_string<char,std::char_traits<char>,std::allocator<char> > * const
edit 3:
Code: Select all
extern "C" _CRTIMP int __cdecl _CrtIsValidHeapPointer(
const void * pUserData
)
{
if (!pUserData)
return FALSE;
if (!_CrtIsValidPointer(pHdr(pUserData), sizeof(_CrtMemBlockHeader), FALSE))
return FALSE;
return HeapValidate( _crtheap, 0, pHdr(pUserData) );
}