title: How do you debug MinGW exception handling?
body: <p>I have an utterly baffling problem with a C++ program I'm compiling with MinGW. At a certain, deterministic point in the program some exception handlers get disabled, and any future exceptions thrown are no longer handled. I can track down the precise line of source that does this, it's an inoffensive assignment to an array on the heap. The pointer isn't corrupt, nor am I writing beyond its bounds. What's more the same code is called in a bunch of different circumstances, even with most of the same arguments without triggering the bug. If I fiddle with the code to make the value it writes always zero, the bug is never triggered. I'm at a loss to know what's happening. It also only disables some exception handlers. exception handlers further down the callstack get disabled, while ones higher up stay active. It's baffling.</p>
  
  <p>So, how do should I go about debugging this? I really don't have a good grasp of how exceptions actually work in MinGW's version of GCC. What could be happening to cause this weird set of symptoms?</p>