使用 WinDbg/SOS 调试托管->本机调用堆栈。我收到“无法请求 ThreadStore”
Managed.exe 中的 MyManagedFunc 调用 unmanagement.dll 中的 MyUnmanagementFunc()。我使用 Win32 在 unmanaged.dll 中生成一个小型转储。设置UnhandledExceptionFilter。我可以在调用堆栈中看到 MyUnmanagedFunc,但在托管端没有任何用处。
我应该能够使用 WinDbg 和 SOS.dll 来查看托管调用,对吗?下面是我的 WinDbg 会话。我做错了什么?
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从您的输出来看,您尚未设置正确的符号路径。使用命令 .symfix 使 WinDbg 使用默认的公共 Microsoft 符号服务器(带有本地缓存)。如果您想在会话输出中获得任何详细信息,则需要这样做。有关设置符号的更多信息,请检查 WinDbg 帮助文件(使用 .hh 从 WinDbg 命令窗口启动它)。
从当前输出来看,线程 da0.1340 上出现了被零除异常。但是,如果没有正确的设置,您的 sos 命令不会产生有用的信息。
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.
小型转储类型必须是 MiniDumpWithFullMemory。如果不是那种类型,就没有“ThreadStore”。
The minidump type has to be MiniDumpWithFullMemory. If it's not that type, there's no "ThreadStore".