调试使用WinDbg的!clrstack命令死锁 [英] Debugging a Deadlock with Windbg's !clrstack command

查看:857
本文介绍了调试使用WinDbg的!clrstack命令死锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发出命令clrstack,我得到了以下的输出。这是该公司拥有一个僵局,导致死锁阻塞线程调用堆栈。是它的确切目的是什么?是否有任何其他目的(不带任何参数)。我在哪里可以得到更多的信息。



  clrstack 
OS线程ID:?!0x1b2c(6956)
ESP EIP
0012f370 7c90e514 [HelperMethodFrame:0012f370] System.Threading.Thread.SleepInternal(Int32)已
0012f3c4 79299275 System.Threading.Thread.Sleep(Int32)已
0012f3c8 00e0030f testlock.LockTest.Test( )
0012f420 00e00146 testlock.Program.Main(System.String [])
0012f69c 79e71b4c [GCFrame:0012f69c]


解决方案

如何:使用WinDBG的调试死锁



WinDbg / SOS小抄




<一个HREF =htt​​p://msdn.microsoft.com/en-us/library/bb190764.aspx> CLRStack [-a] [-l] [-p] [-n]提供
A堆栈只托管代码痕迹。




  • -p选项显示的参数给
    管理功能。


  • -l选项显示在一个框架
    局部变量的信息。该SOS
    调试扩展无法检索
    本地名称,所以输出为当地
    名称格式为
    =。


  • -a(全部)选项是
    -l和-pcombined。

  • $ B $快捷方式b
  • -n选项禁用
    源文件名和行号的显示。如果
    中的调试器选项$指定b $ B SYMOPT_LOAD_LINES,SOS将
    查找符号每个托管
    帧,如果成功会显示
    相应的源文件名和
    线号。该-n(没有行号)
    参数可以被指定为禁止
    这种行为。




该SOS调试扩展没有在x64和
基于IA-64平台不
显示的过渡帧。




更新:(感谢@Liran):要查看所有线程调用堆栈在你的应用程序,运行以下命令:

 〜* E!clrstack 

(这基本上意味着遍历所有的线程,并执行他们每个人)命令!clrstack。


When I issued clrstack command, I got the following output. It is the callstack of a blocking thread which owns a deadlock and results in a deadlock. Is that its exact purpose? Does it have any other purposes (without any parameters). Where can I get more information?

!clrstack
OS Thread Id: 0x1b2c (6956)
ESP       EIP     
0012f370 7c90e514 [HelperMethodFrame: 0012f370] System.Threading.Thread.SleepInternal(Int32)
0012f3c4 79299275 System.Threading.Thread.Sleep(Int32)
0012f3c8 00e0030f testlock.LockTest.Test()
0012f420 00e00146 testlock.Program.Main(System.String[])
0012f69c 79e71b4c [GCFrame: 0012f69c] 

解决方案

How to: Debug Deadlocks Using Windbg?

WinDbg / SOS Cheat Sheet

CLRStack [-a] [-l] [-p] [-n] Provides a stack trace of managed code only.

  • The -p option shows arguments to the managed function.

  • The -l option shows information on local variables in a frame. The SOS Debugging Extension cannot retrieve local names, so the output for local names is in the format = .

  • The -a(all) option is a shortcut for -l and -pcombined.

  • The -n option disables the display of source file names and line numbers. If the debugger has the option SYMOPT_LOAD_LINES specified, SOS will look up the symbols for every managed frame and if successful will display the corresponding source file name and line number. The -n (No line numbers) parameter can be specified to disable this behavior.

The SOS Debugging Extension does not display transition frames on x64 and IA-64-based platforms.

Update: (Thanks to @Liran): To see the call stacks for all the threads in your application, run the following command:

 ~*e!clrstack 

(which basically means, "iterate over all of the threads, and execute the command '!clrstack' on every one of them").

这篇关于调试使用WinDbg的!clrstack命令死锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆