Application Crash with mixed Mode DLL

G

Guest

I have an unmanaged MFC application linked to a mixed mode MFC extension dll
(.NET 2.0/VS 2005) . I followed all the instructions correctly and ensured
that no managed code gets called from the DllMain. When I run the application
it just crashes.

Unhandled exception at 0x013f288e in ImpEDC.exe: 0xC0000005: Access violation.

Hereis the stack trace

013f288e()
ntdll.dll!_LdrpCallInitRoutine@16() + 0x14 bytes
ntdll.dll!_LdrpRunInitializeRoutines@4() + 0x1c7 bytes
ntdll.dll!_LdrpGetProcedureAddress@20() + 0x1c3 bytes
ntdll.dll!_LdrGetProcedureAddress@16() + 0x18 bytes
ntdll.dll!_LdrpCorValidateImage@8() + 0x3ec bytes
ntdll.dll!_LdrpCheckCorImage@16() + 0x25 bytes
ntdll.dll!_LdrpMapDll@24() + 0x17036 bytes
ntdll.dll!_LdrpLoadImportModule@20() + 0x783 bytes
ntdll.dll!_LdrpHandleOneOldFormatImportDescriptor@16() + 0x4c bytes
ntdll.dll!_LdrpHandleOldFormatImportDescriptors@16() + 0x2e bytes
ntdll.dll!_LdrpWalkImportDescriptor@8() + 0x11d bytes
ntdll.dll!_LdrpInitializeProcess@20() + 0x8b4 bytes
ntdll.dll!__LdrpInitialize@12() + 0x88d3 bytes
ntdll.dll!_KiUserApcDispatcher@20() + 0x7 bytes

When I delay load the same dll everything works properly? It is only this
app which has Any ideas what may be wrong or on how to trouble shoot? The
same dll works on other small test apps. When I unlink the dll from the main
app everything works fine.
 
O

Oleg Starodumov

When I delay load the same dll everything works properly? It is only this
app which has Any ideas what may be wrong or on how to trouble shoot? The
same dll works on other small test apps. When I unlink the dll from the main
app everything works fine.

Is the application linked with any other DLLs (non-system)? If it is, I would suspect
those DLLs (the code they run in DllMain and constructors of global objects).

If it does not help, try to run the application under WinDbg and post the output
of the following commands (at the moment of the exception):

r
kb
!lmi yourdll.dll
!address 0x013f288e

http://www.microsoft.com/whdc/ddk/debugging/default.mspx

Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top