   [.net] C++/CLI Crash, Help Appreciated
  I have an application written in c++/cli, where I am linking to some native c++ libraries, which then in turn use some dlls. The native libraries are compiled with multi-threaded dll code generation setting just like the c++/cli application is. It all compiles/links, and runs fine until I start trying to call function in the dll(which is a networking library btw, ReplicaNet).I have an idle event handler that calls a function in the networking library to get the URL of any sessions that were found broadcasting on the local network.std::string found;found = m_pNetwork->SessionEnumerateFound();while(!found.empty()){ found = m_pNetwork->SessionEnumerateFound();}The function returns an std::string by value that is the session URL.The actual crash seems to be in the destructor of the std::string in the dll, here's the callstack.Quote:msvcr80d.dll!_free_dbg_nolock(void * pUserData=0x0065f978, int nBlockUse=1)  Line 1240 + 0x21 bytesC++msvcr80d.dll!_free_dbg(void * pUserData=0x0065f978, int nBlockUse=1)  Line 1194 + 0xd bytesC++msvcr80d.dll!operator delete(void * pUserData=0x0065f978)  Line 54 + 0x10 bytesC++msvcp80d.dll!std::allocator<char>::deallocate(char * _Ptr=0x0065f978, unsigned int __formal=64)  Line 147 + 0x9 bytesC++msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built=true, unsigned int _Newsize=0)  Line 2048C++msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >()  Line 878C++DLLRNXPSessionDMDLL.dll!RNReplicaNet::XPSessionPrivate::EnumerateFound()  + 0x23a bytesC++DLLRNReplicaNetDMDLL.dll!RNReplicaNet::ReplicaNetPrivate::SessionEnumerateFound()  + 0xdc bytesC++DLLRNReplicaNetDMDLL.dll!RNReplicaNet::ReplicaNet::SessionEnumerateFound()  + 0x2d bytesC++The output window has the followingQuote:HEAP[MultiTool.exe]: Invalid Address specified to RtlValidateHeap( 00660000, 0065F958 )Windows has triggered a breakpoint in MultiTool.exe.This may be due to a corruption of the heap, and indicates a bug in MultiTool.exe or any of the DLLs it has loaded.Anyone have an idea why this might happen?   
  nm figured it out.   ;  I have exactly the same problem. What was the solution?   ;  mixing debug and release versions of std string by any chance?   ;  How could it even be possible to mix those versions by chance?   ;Quote:Original post by Anonymous PosterHow could it even be possible to mix those versions by chance?Loading debug DLL from release build application, or vice versa?   