代码之家  ›  专栏  ›  技术社区  ›  Corey Trager

使用WinDbg/SOS调试托管->本机调用堆栈。我收到“无法请求ThreadStore”

  •  1
  • Corey Trager  · 技术社区  · 15 年前

    managed.exe中的MyManagedFunc调用unmanaged.dll中的MyUnmanagedFunc()。我使用Win32在unmanaged.dll中生成一个小型转储。SetUnhandledExceptionFilter。我可以在调用堆栈中看到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
    
    
    2 回复  |  直到 15 年前
        1
  •  1
  •   Brian Rasmussen    15 年前

    从您的输出判断,您没有设置正确的符号路径。使用命令.symfix使WinDbg使用默认的公共Microsoft symbol服务器(带有本地缓存)。如果希望在会话输出中包含任何详细信息,则需要这样做。有关设置符号的更多信息,请查看WinDbg帮助文件(使用.hh从WinDbg命令窗口启动)。

    从当前输出来看,线程da0.1340上似乎有一个被零除的异常。但是,如果没有适当的设置,您的sos命令将不会产生有用的信息。

        2
  •  1
  •   Corey Trager    15 年前

    迷你转储类型必须是MiniDumpWithFullMemory。如果不是那种类型,就没有“ThreadStore”。