Tuesday, October 30, 2007

Failed to load data access DLL, 0x80004005 - hm

Me and some colleagues of mine recently all stumbled over the following error when analyzing .NET minidumps:
I opened a the minidump and typed !CLRStack. What I got was:

Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
2) the file mscordacwks.dll that matches your version of mscorwks.dll is
in the version directory
3) or, if you are debugging a dump file, verify that the file
mscordacwks___.dll is on your symbol path.
4) you are debugging on the same architecture as the dump file.
For example, an IA64 dump file must be debugged on an IA64
machine.

You can also run the debugger command .cordll to control the debugger's
load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your executable
path is pointing to mscorwks.dll as well.


OK, so I followed the step 1 through 4...
ad 1) I'm using version 6.7.5.0 for good reasons
ad 2) Don't know what that means...
ad 3) Why should a dll be in my symbol path?!?
ad 4) The architecture is x86_32 on both machines

So I tried .cordll -ve -u -l

0:000> .cordll -ve -u -l
CLRDLL: Unknown processor type in image C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
CLR DLL status: No load attempts

The following sentence finally helped me:

If you are debugging a minidump, you need to make sure that your executable
path is pointing to mscorwks.dll as well.

So I executed:

0:000> lmv m mscorwks
start end module name
79e70000 7a3d6000 mscorwks T (pdb symbols) C:\windbg\symbols\mscorwks.pdb\6D3E0DE91A284256A48A60718DC9CDEB2\mscorwks.pdb
Loaded symbol image file: mscorwks.dll
Image path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Image name: mscorwks.dll
Timestamp: Fri Apr 13 09:15:54 2007 (461F2E2A)
CheckSum: 005635C7
ImageSize: 00566000
File version: 2.0.50727.832
Product version: 2.0.50727.832
File flags: 0 (Mask 3F)
File OS: 4 Unknown Win32
File type: 2.0 Dll
File date: 00000000.00000000
Translations: 0000.04b0 0000.04e0 0409.04b0 0409.04e0

And...

0:000> .exepath+ C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\

Finally...

0:000> .reload
...................................................................................................................................................................................................................................................
CLRDLL: Loaded DLL C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscordacwks.dll

And my !CLRStack worked ;-)

11 comments:

Roman Rozinov said...

Thanks for the info.
I have the same problem as well. However, following the steps did not resolve it. I am still unable to see the CLR stack. Has anyone pointed at the actual cause of this? I am unable to find anything so far.

Volker von Einem said...

Try a !sym noisy and run .cordll -ve -u -l then again issue a CLRStack. Post what you are seeing.

arnold said...

CLRDLL: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscordacwks.dll:2.0.50727.1433 f:0
doesn't match desired version 2.0.50727.42 f:0
SYMSRV: \\symbols\symbols\mscordacwks_x86_x86_2.0.50727.42.dll\4333E7EC561000\file.ptr
SYMSRV: \\symbols\files\symwh\MP\v08\LINKS\Visual_Studio\whidbey\RTM\0D8AE217-5A9B-474C-BF05-25A508402AAA\Sub\binaries\mscordacwks_x86_x86_2.0.50727.42.dll not found
SYMSRV: C:\Dump\Symbols\mscordacwks_x86_x86_2.0.50727.42.dll\4333E7EC561000\mscordacwks_x86_x86_2.0.50727.42.dll not found
SYMSRV: \\symbols\symbols\mscordacwks_x86_x86_2.0.50727.42.dll\4333E7EC561000\mscordacwks_x86_x86_2.0.50727.42.dll not found
CLRDLL: Unable to find mscordacwks_x86_x86_2.0.50727.42.dll by mscorwks search
CLRDLL: Unable to find 'mscordacwks_x86_x86_2.0.50727.42.dll' on the path
DBGENG: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll image header does not match memory image header.
DBGHELP: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll - mismatched
DBGHELP: C:\Program Files\Debugging Tools for Windows (x86)\mscorwks.dll - file not found
DBGHELP: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll - mismatched timestamp
DBGHELP: mscorwks.dll not found in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
SYMSRV: \\symbols\symbols\mscorwks.dll\4333E7EC561000\file.ptr
SYMSRV: \\symbols\files\symwh\MP\v04\LINKS\Visual_Studio\whidbey\RTM\1B72583A-B3BA-410D-9752-64F40C506D65\Sub\binaries\mscorwks.dll not found
SYMSRV: C:\Dump\Symbols\mscorwks.dll\4333E7EC561000\mscorwks.dll not found
SYMSRV: \\symbols\symbols\mscorwks.dll\4333E7EC561000\mscorwks.dll not found
CLRDLL: Unable to find mscorwks.dll by search
CLRDLL: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.42.dll, Win32 error 0n2
CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.42.dll, Win32 error 0n2

Volker von Einem said...

Do you have the ms symbol server added (e.G.: .symfix+ c:\MySymStore)?

Anonymous said...

I am getting the same problem. When I run the command .cordll -ve -u -l I get error "CLR DLL status: No load attempts".
I am running WinDbg:6.11.0001.404 X86.
I have Windows Vista Business (SP1) on a 64 bit machine. I am trying to debug a issue in a dump file that was created on 32bit XP machine. I have download the 32 bit version of Windbg. Any idea what I may be missing

Sean Stapleton said...

Thank you. Thank you. Thank you. Thank you.

I owe you a beer.

Thank you!

Volker von Einem said...

@Sean: Tell me when and where ;-)

Anonymous said...

Thank you, you just saved my day!

HydPhani said...

This is confusing to me, could you please just tell the dumb steps to follow to resolve, I am getting similar error
"The Version of CLR.dll in the target does not match the one mscordacwks.dll was built for. "

Volker von Einem said...

@HydPhani: Could you post the detailed message?

Anonymous said...

adding the symbol path .sympath+SRV*c:\temp\symbols*http://msdl.microsoft.com/download/symbols was most helpful, and resolved my issues. I had version x of mscordacwks, while the machine from which the .dmp file came had version y; adding the symbol path allows automatic download of the necessary symbols required for !clrstack to finally work. I should get you a beer too, Volker! But you'll have to visit San Francisco - Bruce