Jump to content
  • Advertisement
Sign in to follow this  
DrEvil

[.net] C++/CLI Crash, Help Appreciated

This topic is 4400 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 bytes C++ msvcr80d.dll!_free_dbg(void * pUserData=0x0065f978, int nBlockUse=1) Line 1194 + 0xd bytes C++ msvcr80d.dll!operator delete(void * pUserData=0x0065f978) Line 54 + 0x10 bytes C++ msvcp80d.dll!std::allocator<char>::deallocate(char * _Ptr=0x0065f978, unsigned int __formal=64) Line 147 + 0x9 bytes C++ msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built=true, unsigned int _Newsize=0) Line 2048 C++ msvcp80d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 878 C++ DLLRNXPSessionDMDLL.dll!RNReplicaNet::XPSessionPrivate::EnumerateFound() + 0x23a bytes C++ DLLRNReplicaNetDMDLL.dll!RNReplicaNet::ReplicaNetPrivate::SessionEnumerateFound() + 0xdc bytes C++ DLLRNReplicaNetDMDLL.dll!RNReplicaNet::ReplicaNet::SessionEnumerateFound() + 0x2d bytes C++
The output window has the following
Quote:
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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I have exactly the same problem. What was the solution?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How could it even be possible to mix those versions by chance?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
How could it even be possible to mix those versions by chance?


Loading debug DLL from release build application, or vice versa?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!