I have a C/C++ multithreaded application in Microsoft Visual Studio C++ 6.0
When I run the code in debug mode, at some point it segfaults ("Unhandled exception in MyApplication.exe: 0xC0000005: Access Violation")
Normally I can narrow down why by looking at the 'Context' drop down, showing me the stack trace back to the offending function and line of code.
But with this particular crash, all I get for context stack backtrace is '63732052()' and after that a bunch of NTDLL calls.
You can see a screenshot here: http://www.telparia.com/crash1.jpg
No matter how far back I go, I just see more of those NTDLL calls, it never hits my code.
Anyways, what I imagine is happening is somewhere in my code, I am over-writing data that doesn't belong to me.
For some odd reason, this isn't causing an immediate fault. Instead some time later when either my code touches that memory, bingo crash.
I've already tried commenting out recently added code, and visually looking for potential problems and have not yet found a solution.
Under linux there are awesome tools such as efence (http://freshmeat.net/projects/efence/
) and valgrind (http://valgrind.org/
These tools are capable of detecting when any code accesses code it shouldn't and breaks execution at the right code line.
I believe this is known as 'bounds checking' ?
I can't move the application to linux because it relies on several windows specific libraries, including some custom ODBC drivers only available for Windows.
So I need some sort of tool to detect these violations and determine where in my code the problem lies.
I found something called GlowCode (http://www.glowcode.com/
) but it appears only to be a leak checker and a profilier.
I also found an app called BoundsChecker (http://www.compuware.com/products/devpartner/bounds.htm
I don't know if BoundsChecker will help me with this, but the name certainly sounds correct.
I requested a trial, but have not yet heard from them. And at a price of $1,100 that will be hard to justify to management to purchase.
So what I'm asking is if there are any free apps out there that can help me in this situation.
Or maybe there's a way to extend the stack trace to include more than 10 functions?
Or some other solution that I'm not seeing?
I'll be rewarding points to the person who's advice leads me to locating and fixing my bug.
So if someone reccomends a product that finds it, or if someone suggests a modification to visual studio, or a technique to help narrow down the problem.
I'm open to everything.