Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

.net - Using WinDbg/SOS to debug managed->native callstack. I get "Failed to request ThreadStore"

MyManagedFunc in managed.exe calls into MyUnmanagedFunc() in unmanaged.dll. I produce a minidump in unmanaged.dll using Win32. SetUnhandledExceptionFilter. I can see MyUnmanagedFunc in the callstack, but nothing usefull in the managed side.

I'm supposed to be able to use WinDbg and SOS.dll to see the managed calls, right? Below is my WinDbg session. What am I doing wrong?

Executable search path is: 
Windows XP Version 2600 (Service Pack 3) MP (4 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS
Machine Name:
Debug session time: Fri Sep 25 12:59:28.000 2009 (GMT-5)
System Uptime: not available
Process Uptime: 0 days 0:00:08.000
.......................................
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(da0.1340): Integer divide-by-zero - code c0000094 (first/second chance not available)
eax=03a50000 ebx=001a2578 ecx=00000007 edx=7c90e514 esi=001a2550 edi=001a25a8
eip=7c90e514 esp=0012dd24 ebp=0012dd34 iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll - 
ntdll!KiFastSystemCallRet:
7c90e514 c3              ret
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for kernel32.dll - 
0:000> .loadby sos mscorwks
0:000> !threads
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for mscorwks.dll - 
PDB symbol for mscorwks.dll not loaded
Failed to request ThreadStore
0:000> .ecxr
eax=0000000c ebx=00160c20 ecx=00000000 edx=00000000 esi=0012efb8 edi=0012eea4
eip=01201712 esp=0012edd8 ebp=0012eea4 iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010206
*** WARNING: Unable to verify checksum for NativeDLL.dll
NativeDLL!MyBad+0x22:
01201712 f77d0c          idiv    eax,dword ptr [ebp+0Ch] ss:0023:0012eeb0=00000000
*** WARNING: Unable to verify checksum for System.Windows.Forms.ni.dll
*** ERROR: Module load completed but symbols could not be loaded for System.Windows.Forms.ni.dll

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Judging from your output you have not set up a proper symbol path. Use the command .symfix to make WinDbg use the default public Microsoft symbol server (with a local cache). This is needed if you want to have any detail in your session output. For further info on setting up symbols please check the WinDbg help file (use .hh to launch it from WinDbg command window).

From the current output it looks like you have a divide-by-zero exception on the thread da0.1340. However, without a proper setup your sos commands yield no useful info.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...