views:

464

answers:

2

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

+1  A: 

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.

Brian Rasmussen
The divide by zero was intentional. I was trying to make sure I could sue the tools. I did get things to work, and although I'm not sure that the symbols were the only problem, they seemed to be part of the problem. SOS.DLL needed mscorwks.pdb to do its job.
Corey Trager
A: 

The minidump type has to be MiniDumpWithFullMemory. If it's not that type, there's no "ThreadStore".

Corey Trager