Marin
Marin

Reputation: 1331

Finding memory violations/leaks

I have an application developed in VC 2008 (C++) which uses axis dlls, which use openssl dlls. And someone in the chain corrupts heap - a situation which ends up giving me "memory access violation" in my application in places where violation shouldn't/couldn't happen. So, someone in the chain axis-ssl corrupts something, but I cannot find who or what.

I tried using DevPartner's tool for memory leaks, but it finds no leaks - no anything.

How should I approach this problem? I looked over axis and ssl documentation a number of times, and implemented and checked all possible memory management issues and fixes, but to no avail.

Thank you very much! Marin

Upvotes: 2

Views: 1422

Answers (4)

yasouser
yasouser

Reputation: 5177

May be this MSDN article might have the answers you are looking for: Finding a Memory Leak

Also you could try this LeakDiag tool. Not sure as to why there is no reference to it in MSDN?!?!? But there is a neat article in Codeproject.com

Upvotes: 1

SK-logic
SK-logic

Reputation: 9715

Why do you think a leak could be somehow responsible for a corruption? You'd need to watch out for out-of-bounds access, dead pointer access, illegal casts and things like that, not for a leak. It's a tricky thing to do. Valgrind is a great tool for chasing this sort of issues, but unfortunately it's not available for Win32. If your code is portable, you could try debugging it on Linux, otherwise you'd either need to use commercial tools like Purify, or do it the good old way, with a help of logging and assertions, and a debugger of course.

Upvotes: 3

Puppy
Puppy

Reputation: 146930

If you get the debug versions of the libraries, MSVC offers a debug malloc and free, as well as a debug new and delete. These contain things like overwrite detection.

http://msdn.microsoft.com/en-us/library/bebs9zyz.aspx

Upvotes: 2

Kyrylo Kovalenko
Kyrylo Kovalenko

Reputation: 2171

Try using MS application verifier. It integrates with Visual Studio, so you can make "verified" run directly from it.

Upvotes: 3

Related Questions