Advertisement

Debugging problems

Started by June 16, 2015 09:18 PM
1 comment, last by Azzazelus 9 years, 6 months ago

Hello. I'm making a library, compile it to a dll and then use the dll in a different application that I also compile. Both projects are build in debug mode and when I run the application via Visual Studio (compile it) it works perfectly. When I run the application alone from the Visual Studio IDE it crashes randomly. Sometimes it crashes after I close it sometimes it crashes on startup.The weird part is that I cant debug it even if when it crashes I try to select Visual Studio as the debugger. All I get is "a heap has been corrupted". Any idea how to get more information on the crash when I run the application standalone from the Visual Studio IDE ?

I also tried to run the application in WinDBG and works just fine.

Debugging can change the behaviour of the memory allocators to help flush out certain types of bugs. However, the downside is that your program can end up depending on the behaviour of a debug allocator, which could be why you're seeing that behaviour.

Is is possible to link the library statically and check for a crash? Executables and DLLs on Windows can have separate heaps, possibly you're seeing something related to this?

Yet more ideas here: http://stackoverflow.com/questions/1010106/how-to-debug-heap-corruption-errors

Good luck!
Advertisement

Solved. It crashed because I didn't had Microsoft Visual Studio C++ Redistributable installed.

LE: Or ar least thats what I thought. Seems that it works on a different directory than the one where I compile the library and the application.

This topic is closed to new replies.

Advertisement