title: c++ Debugging Exception c0000139
body: <p>I am currently trying to get to the bottom of a client crash with one of our applications. I have wrapped the app in an exception handler which creates a mini-dump when the crash occurs. </p>
  
  <p>The application crashes with the exception c0000139 (of which there isn't a huge amount of documentation).</p>
  
  <p>The callstack looks like this</p>
  
  <pre><code>ntdll.dll!_RtlRaiseStatus@4()  + 0x26 bytes 
  ntdll.dll!_LdrpSnapThunk@32()  + 0x26f48 bytes  
  ntdll.dll!_LdrpSnapIAT@16()  + 0xd9 bytes   
  ntdll.dll!_LdrpHandleOneOldFormatImportDescriptor@16()  + 0x7a bytes    
  ntdll.dll!_LdrpHandleOldFormatImportDescriptors@16()  + 0x2e bytes  
  ntdll.dll!_LdrpWalkImportDescriptor@8()  + 0x11d bytes  
  ntdll.dll!_LdrpLoadDll@24()  - 0x265 bytes  
  ntdll.dll!_LdrLoadDll@16()  + 0x110 bytes   
  kernel32.dll!_LoadLibraryExW@12()  + 0xc8 bytes 
  odbc32.dll!_ODBCLoadLibraryEx@12()  + 0x29 bytes    
  odbc32.dll!_LoadDriver@12()  + 0x119f bytes 
  odbc32.dll!_SQLDriverConnectW@32()  + 0x1be bytes   
  odbc32.dll!_SQLDriverConnect@32()  + 0x125 bytes
  </code></pre>
  
  <p>It looks like the program is trying to create a database connection (to Oracle via ODBC) and somehow failing to either find the dll or has found a dll with the wrong entry point.</p>
  
  <p>I was wondering if anyone could offer advice an how to track this problem down further, or if anyone has experienced this problem I'd be interested in hearing how you solved it.</p>
  
  <p>Thanks in advance</p>
  
  <p>Rich </p>