- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 WinDbg 和 SOS,我有以下内容:
0:011> !threads
ThreadCount: 7
UnstartedThread: 0
BackgroundThread: 4
PendingThread: 0
DeadThread: 2
PreEmptive GC Alloc Lock
ID ThreadOBJ State GC Context Domain Count APT Exception
0 618 0015b350 20 Enabled 00000000:00000000 0017b720 0 Ukn
2 624 0016f508 b220 Enabled 00000000:00000000 0017b720 0 MTA (Finalizer)
9 e48 001c13d0 1220 Enabled 00000000:00000000 0017b720 0 Ukn
10 e8c 048c6a40 1800220 Enabled 00c296a8:00c2ab44 0017b720 0 MTA (Threadpool Worker) System.NullReferenceException
XXX 0 00224138 1820 Enabled 00000000:00000000 0017b720 0 MTA
XXX 0 001d5b50 1820 Enabled 00000000:00000000 0017b720 0 Ukn
11 564 00166318 1800220 Enabled 00c2cf30:00c2eb44 0017b720 0 MTA (Threadpool Worker)
0:011> !dumpheap -type System.Threading.Thread
Address MT Size
00b16478 79bba7a4 60
00b41a7c 79bca7ac 28
00b41a98 79bba7a4 60
00b41ecc 79bba7a4 60
00bf1e20 79bca7ac 28
00bf1e3c 79bba7a4 60
00c03b34 79bca7ac 28
00c03b50 79bba7a4 60
total 8 objects
Statistics:
MT Count TotalSize Class Name
79bca7ac 3 84 System.Threading.ThreadStart
79bba7a4 5 300 System.Threading.Thread
Total 8 objects
我的问题是:如何确定堆上的哪些 System.Threading.Thread 实例对应于实际执行的托管线程。
更新:这是调试 .NET 1.1 应用程序。在此版本中,我从 !DumpObj 得到这样的输出
0:000> !dumpobj 00b16478
Name: System.Threading.Thread
MethodTable 0x79bba7a4
EEClass 0x79bba9d4
Size 60(0x3c) bytes
mdToken: 020000ec (c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll)
FieldDesc*: 79bbaa38
MT Field Offset Type Attr Value Name
79bba7a4 4000337 4 CLASS instance 00000000 m_Context
79bba7a4 4000338 8 CLASS instance 00000000 m_LogicalCallContext
79bba7a4 4000339 c CLASS instance 00000000 m_IllogicalCallContext
79bba7a4 400033a 10 CLASS instance 00000000 m_Name
79bba7a4 400033b 14 CLASS instance 00000000 m_ExceptionStateInfo
79bba7a4 400033c 18 CLASS instance 00000000 m_Delegate
79bba7a4 400033d 1c CLASS instance 00000000 m_PrincipalSlot
79bba7a4 400033e 20 CLASS instance 00000000 m_ThreadStaticsBuckets
79bba7a4 400033f 24 CLASS instance 00000000 m_ThreadStaticsBits
79bba7a4 4000340 28 CLASS instance 00000000 m_CurrentCulture
79bba7a4 4000341 2c CLASS instance 00000000 m_CurrentUICulture
79bba7a4 4000342 30 System.Int32 instance 2 m_Priority
79bba7a4 4000343 34 System.Int32 instance 1422160 DONT_USE_InternalThread
79bba7a4 4000344 0 CLASS shared static m_LocalDataStoreMgr
>> Domain:Value 0017b720:00b162e8 <<
最佳答案
托管线程有一个成员变量m_ManagedThreadId
0:000> !do 02f34b84
Name: System.Threading.Thread
MethodTable: 5259ffcc
EEClass: 522d8ed8
Size: 48(0x30) bytes
File: C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
Fields:
MT Field Offset Type VT Attr Value Name
52588a28 4000720 4 ....Contexts.Context 0 instance 02f7dc78 m_Context
5259b468 4000721 8 ....ExecutionContext 0 instance 02f3d4d4 m_ExecutionContext
5259f9ac 4000722 c System.String 0 instance 00000000 m_Name
5259fe80 4000723 10 System.Delegate 0 instance 00000000 m_Delegate
525a63a4 4000724 14 ...ation.CultureInfo 0 instance 00000000 m_CurrentCulture
525a63a4 4000725 18 ...ation.CultureInfo 0 instance 00000000 m_CurrentUICulture
5259f5e8 4000726 1c System.Object 0 instance 00000000 m_ThreadStartArg
5259aa2c 4000727 20 System.IntPtr 1 instance 4b6c18 DONT_USE_InternalThread
525a2978 4000728 24 System.Int32 1 instance 2 m_Priority
525a2978 4000729 28 System.Int32 1 instance 1 m_ManagedThreadId
m_ManagedThreadID 对应于 !threads 输出中的“ID”
0:000> !t
ThreadCount: 17
UnstartedThread: 0
BackgroundThread: 9
PendingThread: 0
DeadThread: 7
Hosted Runtime: no
PreEmptive GC Alloc Lock
ID OSID ThreadOBJ State GC Context Domain Count APT Exception
0 1 390 004b6c18 6020 Enabled 0d98d408:0d98e080 004a85c8 0 STA
4 2 790 004c5028 b220 Enabled 00000000:00000000 004a85c8 0 MTA (Finalizer)
5 3 15e4 00555fd0 b220 Enabled 00000000:00000000 004a85c8 0 MTA
XXXX 5 060c27d8 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
7 6 84c 060c41f0 200b220 Enabled 00000000:00000000 004a85c8 0 MTA
14 7 1aec 0611a760 200b220 Enabled 00000000:00000000 004a85c8 1 MTA
17 8 ea0 08c787c8 200b220 Enabled 00000000:00000000 004a85c8 0 MTA
XXXX 9 0b409580 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
XXXX a 08cee2d0 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
XXXX b 08ceebc8 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
XXXX c 0b409a78 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
XXXX d 0b40a248 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
XXXX e 0b40b218 19820 Enabled 00000000:00000000 004a85c8 0 Ukn
20 f 16d0 08cc1ad0 8009220 Enabled 00000000:00000000 004a85c8 0 MTA (Threadpool Completion Port)
21 10 1ab4 0b4163f0 1009220 Enabled 0d9601ac:0d962080 004a85c8 0 MTA (Threadpool Worker)
22 11 1924 0b40ef88 1009220 Enabled 0d9036c8:0d905554 004a85c8 0 MTA (Threadpool Worker)
23 4 14d8 0b416ce0 100a220 Enabled 00000000:00000000 004a85c8 0 MTA (Threadpool Worker)
这是一个简单的脚本,用于转储托管线程对象及其 ID
.foreach ($t {!dumpheap -mt 5259ffcc -short}) { .printf " Thread Obj ${$t} and the Thread Id is %N \n",poi(${$t}+28) }
这是上面 .foreach 的输出
0:000> .foreach ($t {!dumpheap -mt 5259ffcc -short}) { .printf " Thread Obj ${$t} and the Thread Id is %N \n",poi(${$t}+28) }
Thread Obj 02f34b84 and the Thread Id is 00000001
Thread Obj 02f3d44c and the Thread Id is 00000003
Thread Obj 02f5f180 and the Thread Id is 00000005
Thread Obj 02f5f504 and the Thread Id is 00000006
Thread Obj 02f87780 and the Thread Id is 00000007
Thread Obj 03bdf8d8 and the Thread Id is 0000000C
Thread Obj 03bdff54 and the Thread Id is 00000008
Thread Obj 03d23f48 and the Thread Id is 00000009
Thread Obj 03d2491c and the Thread Id is 0000000A
Thread Obj 03d24a5c and the Thread Id is 0000000B
Thread Obj 03d24d34 and the Thread Id is 0000000D
Thread Obj 03d24ed8 and the Thread Id is 0000000E
Thread Obj 03d2bd24 and the Thread Id is 00000010
Thread Obj 03e48300 and the Thread Id is 00000002
Thread Obj 08f12f90 and the Thread Id is 00000011
关于.net - WinDbg/SOS : How to correlate managed threads from ! 带有 System.Threading.Thread 实例的线程命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4616584/
我有一个 .NET .86 应用程序。我正在尝试从 cdb 运行 dumpdomain 但一直出现错误。 关于这个有很多问题,我尝试了几种变体: C:\Users\d.banks\Documents>
这个问题很大程度上是基于我之前找到的帖子 here . 我正在尝试使用反射重新创建 SOS.dll 的一些功能。特别是 ObjSize 和 DumpObject 命令。我使用反射来查找所有字段,然后如
我刚刚开始使用 windbg/sos,我创建了一个简单的控制台应用程序进行测试(抛出一个未处理的异常)。似乎在我加载 sos 之后,我会在下一次调用时遇到异常。 例如: ntsd consoleapp
嗨,SO 的智者。这是求救信号。 我遇到了很大的麻烦。在我的网络应用程序中有一个对象(假设它是对某事的请求)。用户提交他/她的请求。之后是可以批准/不批准该请求的人员。在从提交到批准/不批准的这段时间
我正在尝试使用 windbg 来研究在 x64 机器上为我们的 x86 进程创建的挂起转储文件。这是一个 4.0 x86 应用程序,所以为了获得非托管堆栈,我必须执行以下操作: .loadby sos
我现在正在将 SOS 调度程序从 sun solaris 迁移到 Oracle linux, SOS Berlin 调度程序是 1.5.3253 的最新版本 - Linux X64Java JDK 1
如何查看作为参数传入的日期时间? 我在互联网上找到了这个示例,但我在理解它时遇到问题?我根本看不到他们在哪里使用 clrstack 的输出,它只是说“通过向前转储 ESP 的内存来查看堆栈:” htt
如何在当前线程的 clrstack 上打印所有 System.String 对象的字符串值? 我想做的伪代码: foreach ($string in !dso -type System.String
我需要使用 WinDbg 调试 32 位托管应用程序,但是 WinDbg 顽固地拒绝加载 SOS.dll 扩展。经过许多互联网搜索和尝试后,我被难住了。我有使用 WinDbg 调试非托管代码的经验,但
我尝试在 vb.net 应用程序中加载 Visual Studio 2010 (.Net Framework 4) 中的 SOS 扩展,但没有成功。 首先我发现了以下article建议我在立即窗口中输
我使用了以下 sos 命令来枚举正在运行的 asp 应用程序(托管在 windows xp 4 GB 机器上)中特定类型的所有实例。 .foreach (obj { !dumpheap -type :
我制作了一个手电筒应用程序,现在我想添加 sos 莫尔斯电码闪烁。这是我的代码,但它工作得不太好,它闪烁得太快,所以我需要某种延迟,任何人都可以帮忙吗? public void sos(View v)
我正在通过 WinDBG 使用 SOS.dll 查看故障转储。给定一个 Dictionary 对象的地址,是否有一种简单的方法来转储它的内容,例如.. Key1 -> Value1 Key2 -> V
我正在尝试学习如何使用 Openlayers 和 SOS(传感器观察服务)服务。我在互联网上找到了几个例子,并研究了算法,但由于我对 Openlayers 库不太熟悉,而且我是 Javascript
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 7 年前。 Improve t
我有一个 ASP.net 2.0 应用程序,我正在尝试使用 Windbg 和 SOS.dll 对其进行实时调试。 当我将调试器附加到进程时,我看到它同时加载了 2.0 和 4.0 版本的 CLR。
我最近从 native 代码编程切换到托管代码编程。我正在使用.NET。 由于我使用 Windbg 已经有一段时间了,我也想将它用于托管代码调试。 我的搜索将我带到了 SOS(罢工之子)扩展程序,它似
当我在 Visual Studio 的即时窗口中使用 .load SOS 并无意中发出了导致一长串输出的命令(例如 !dumpheap -type System.String -min 100)时,即
有一个question with the same title但不幸的是它对我没有帮助。 我正在尝试解析 SOS 标记的数据。我能找到的所有文档都说在标记( 0xFFDA )之后是一个两字节的数字,它
“罢工之子”这个名字有何意义?它有什么意义还是只是听起来很酷? 最佳答案 杰森·赞德的blog post完美地解释了这一点: The original name of the CLR team (ch
我是一名优秀的程序员,十分优秀!