.NET应用程序调试—原理、工具、方法(17)
0:000> !syncblk
Index SyncBlock MonitorHeld Recursion Owning
Thread Info SyncBlock Owner
4 0021fb20 3 1
00221f98 14974c 3 01ae2394 OrderManager.ImportOrder
5
0021fb54 3 1 002234a8 149754 4 01ae23a0
OrderManager.ImportOrder
-----------------------------
Total
5
CCW 0
RCW 0
ComClassFactory
0
Free 0
这是两个锁,也就是两个对象同步块。进一步使用SOSEX.dll中的!dlk查看死锁的自动化检查信息。
0:000> !dlk
Examining SyncBlocks...
Scanning for
ReaderWriterLock instances...
Scanning for holders of ReaderWriterLock
locks...
Scanning for ReaderWriterLockSlim instances...
Scanning for
holders of ReaderWriterLockSlim locks...
Examining
CriticalSections...
Could not find symbol
ntdll!RtlCriticalSectionList.
Scanning for threads waiting on
SyncBlocks...
Scanning for threads waiting on ReaderWriterLock
locks...
Scanning for threads waiting on ReaderWriterLocksSlim
locks...
Scanning for threads waiting on
CriticalSections...
*DEADLOCK DETECTED*
CLR thread 0x3 holds the
lock on SyncBlock 0021fb20 OBJ:01ae2394[OrderManager.ImportOrder]
...and is
waiting for the lock on SyncBlock 0021fb54
OBJ:01ae23a0[OrderManager.ImportOrder]
CLR thread 0x4 holds the lock on
SyncBlock 0021fb54 OBJ:01ae23a0[OrderManager.ImportOrder]
...and is waiting
for the lock on SyncBlock 0021fb20
OBJ:01ae2394[OrderManager.ImportOrder]
CLR Thread 0x3 is waiting at
System.Threading.Monitor.Enter(System.Object, Boolean ByRef)(+0x17
Native)
CLR Thread 0x4 is waiting at
System.Threading.Monitor.Enter(System.Object, Boolean ByRef)(+0x17 Native)
1 deadlock detected.
注意我加粗的那段话,检测到死锁。
8.获取Dump文件时的重要注意事项
在获取dump文件方面我也要分享一下重要的注意事项。如果获取dump文件不正确的话是无法进行分析的,会出现任何奇怪的问题。
第一个就是使用64位机器上的任务管理获取32位进程dump文件,这通常是发生在服务器上,由于服务器IIS默认的启动进程方式是64位的,但是也有些情况下会变成32位的。
图19:
相关新闻>>
- 发表评论
-
- 最新评论 更多>>