title: Help postmorten debugging of a mixed mode Win32 application
body: <p>Here's the situation:</p>
  
  <p><strong>Background</strong></p>
  
  <p>I have a mixed mode .NET/Native application developed in Visual Studio 2008. </p>
  
  <p>What I mean by mixed mode is that the front end is written in C++ .NET which calls into a native C++ library. The native code does the bulk of the work in the app, including kicking off new threads as it requires. The .NET code is just for UI purposes (win forms).</p>
  
  <p>I have a release build of application running on a tester's computer.</p>
  
  <p>The native libraries were compiled with full optimisations but also with debugging enabled (the "Debug Information Format" was set to "Program Database").</p>
  
  <p>What this means is that I have the debugging symbols for the application in a PDB file.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>So anyway, one of the testers is having a problem with the app where it occasionally crashes on XP. I've been able to get the minidump of the crash using Dr Watson for several runs.</p>
  
  <p>When I debug into it (using the minidump - I'm not actually debugging the real app), all the debugging symbols are loaded correctly: I can see the full stack trace of all of the native threads correctly. Other threads (which are presumably the .NET threads) don't have a stack trace, but they all at least show me which dll the thread was started on (i.e. ntdll.dll).</p>
  
  <p>It correctly reports the thread which fails ("Unhandled exception at 0x0563d652 in user(5).dmp: 0xC0000005: Access violation reading location 0x00000000).</p>
  
  <p>However when I go into the thread it shows nothing useful. In the stack trace there is a single entry which just has the memory address "0563d652()" (not even "ntldll.dll").</p>
  
  <p>When I go into dissasembly it just shows a random section of about 30 instructions. Either side of the memory address is just "???". It almost looks like it is not part of my source code (isn't your binary loaded sequentially into memory? is it normal to have a random set of assembly statements in the middle of nowhere?).</p>
  
  <p><strong>My questions</strong></p>
  
  <p>So basically my questions are threfold.</p>
  
  <p>1) Can anyone explain the debugger's lack of information?</p>
  
  <p>2) Bearing in mind, I can't show the error occurred in my code, can anyone suggest a reason for the failure</p>
  
  <p>3) Can I do anything else to help me diagnose this current problem in the future?</p>
  
  <p>Help!</p>
  
  <p>John</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Here is the stack dump for the failing thread from WinDBG</p>
  
  <pre><code> # ChildEBP RetAddr  
  WARNING: Frame IP not in any known module. Following frames may be wrong.
  00 099bf414 02d0e7fc 0x563d652
  01 00000000 00000000 0x2d0e7fc
  </code></pre>
  
  <p>Weird huh? Doesn't even show a DLL.</p>
  
  <p>Is it possible that I've corrupted the stack/heap somehow which has caused a thread to just get corrupted...?</p>