Debugging 32 bit application running in 64 bit environment

风流意气都作罢 提交于 2021-02-07 10:20:57

问题


I have a 32 bit .Net 4.0 application running in a wow64 environment in a 64 bit machine.

The application encountered an error and I took a dump with 32 bit taskmanager present in C:\Windows\SysWOW64\taskmgr.exe

I am using a 32 bit Windebugger to analyze this dump. I loaded the following dlls.

1).loadby sos CLR

2).load mscordacwks ( from the client machine).

But still I am not able to use SOS commands like !clrstack,!threads etc.

I get the error: Failed to load data access DLL, 0x80004005

What did I do wrong?


回答1:


Seems that mscordacwks is not correctly loaded

One way

Try:

.cordll -u -ve -lp <absolute-path-to-directory-where-client-mscordacwks-is-placed>

The correct output should be:

CLRDLL: Loaded DLL <your-path>\mscordacwks.dll
CLR DLL status: Loaded DLL <your-path>\mscordacwks.dll

If you see:

CLR DLL status: No load attempts

rename your mscordacwks to the name suggested by .cordll:

0:000> .cordll
CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.3625.dll, Win32 error 0n87

and add the path where renamed mscordacwks resides to symbols:

.sympath+ <your-path>

and try your SOS command.

Other way

Get procdumpext.dll from Andrew Richard's skydrive : http://sdrv.ms/11C7S9c, load it into windbg (.load procdumpext.dll) and execute !loadsos.

Good luck! :)




回答2:


I had the best results in case I didn't only get mscordacwks.dll but also sos.dll from the client machine. I even had SxS issues with those files, so getting the files from the default .NET framework directory was not helpful either. Therefore I created the mscordacwks collector which gets all possible files for you.

However, you still need to find out which version to use. You can start by looking at the .NET framework version:

lm vm clr; *** .NET CLR 4
lm vm mscorwks; *** .NET CLR 2
lm vm coreclr; *** Silverlight

(In worst case, you have two different version of .NET loaded, in which case you are out of luck).

Once you know the exact version, you can load SOS of that version by full path

.load c:\mypath\SOS_AMD64_AMD64_4.0.30319.18444.dll

Note that the collected versions of SOS.dll will also be renamed to avoid file name conflicts. For more convenience, you can create a copy and just rename it to SOS.dll.

If there are still any mscordacwks.dll issues, you can proceed as proposed by @lowleveldesign. The tool should already have renamed data access files appropriately. If you find any bug, feedback is welcome.



来源:https://stackoverflow.com/questions/21852730/debugging-32-bit-application-running-in-64-bit-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!