views:

222

answers:

3

Hi,

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.

The application crashes with the exception c0000139 (of which there isn't a huge amount of documentation).

The callstack looks like this

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

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.

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.

Thanks in advance

Rich

A: 

That exception code is Entry point not found - something is trying to load a DLL and the DLL cannot find all the DLLs it needs.

Use depends.exe to show what the DLL requires.

Mark
Thanks for the reply, however how do I find the source dll? As I'm not calling LoadLibrary so I don't really know what dll it's loading.
Rich
Did you try depends.exe?
atomice
I don't think Dependes.exe is going to help me as the dll load is invoked dynamically by the ODBC framework.
Rich
I tried Depends.exe and all dlls were found.
Rich
Did you depends.exe on odbc.dll and the oracle dlls ?
Mark
I did indeed and all seemed reachable.
Rich
A: 

Enable loader snaps (gflags -i yourapp.exe +sls) and have it pinpoint the library its failing to find/load (starting the program under the debugger will spew all the loader diagnostics).

Alternatively, get the name of the library from the crash dump by examining parameters of LoadLibraryExW call.

I am unable to recreate the crash on my machine. To make matters worse the clients machine where it does crash is in New York and I'm in London. The dump only dumps the stack and memory as it wasn't an option to do a full memory dump.
Rich
Reinstall the oracle driver? Might be quicker than debugging if your access is limited. Or does the ODBC install have a test program to see if it can connect
Mark
To make matters worse the problem is intermittent which really doesn't help. It's also across several users in New York. Because the problem is intermittent I'm not sure a reinstall will help. The oracle drivers that the ODBC loader is trying to load is on a mapped network drive. The only problem I can think is that perhaps the drive mapping is failing. But again that's just guess work ...
Rich
CInstall the drivers on the local hard disk:) Windows does not like network things as much as say Unix - so you need ways of doing remote installs - etc
Mark
A: 

Hi,

Thanks for all the responses.

Turns out (at least this seems like it was the problem) that we had a configuration problem. Half of the software was set to load the 9i drivers and half of the software was expecting the 10g drivers.

It's early days yet and we need to test this, however it seems very likely that this was the cause.

Cheers Rich

Rich