I am debugging a (native) multi-threaded C++ application under VS2008. On seemingly random occasions, I get a "Windows has triggered a break point..." error with a note that this might be due to a corruption in the heap. These errors won't always crash the application right away, although it is likely to crash short after.
The big problem with these errors is that they pop up only after the corruption has actually taken place, which makes them very hard to track and debug, especially on a multi-threaded app.
So the questions are these:
What sort of things can cause these errors?
How do I debug them?
Tips, tools, methods, enlightments... are welcomed.