1

在我们基于窗体的 Windows 应用程序中,当导航到 WPF 屏幕选项卡之一(其他是普通屏幕)时,整个系统挂起并且必须重新启动机器。当系统挂起并在 WinDBG 中打开转储时,我们对该问题进行了内核转储。下面给出了给定的命令和我们在 WinDBG 中得到的结果。我们发现发生了死锁,但无法找到导致确切问题的原因。请帮助我们分析结果。

3: kd> !locks
**** DUMP OF ALL RESOURCE OBJECTS ****
KD: Scanning for held locks...........................................................................................................

Resource @ 0x852878d0    Exclusively owned
    Contention Count = 46437
    NumberOfExclusiveWaiters = 34
     Threads: 8584ad48-01<*> 
     Threads Waiting On Exclusive Access:
              85387d48       857aed48       8577a4d0       8577a1e8       
              858de748       857feac8       854527d0       859b7030       
              85808d48       8583dd48       858db678       857fe7e0       
              8588a030       871103c0       87eb6d48       8645aa88       
              85a38b20       859bfb08       857a9b80       85805618       
              87ea2a90       853b8b80       85a61970       86a83520       
              8776ad48       857df970       85440030       854407f0       
              857df688       8749d030       87e25350       864c3d48       
              8645a380       86efd2e8       

KD: Scanning for held locks.

Resource @ 0x86ec5f28    Shared 3 owning threads
    Contention Count = 20
     Threads: 85f2b030-01<*> 8584ad48-01<*> 86efcd48-01<*> 

Resource @ 0x86ec5ed8    Shared 1 owning threads
    Contention Count = 273
     Threads: 85f2b030-01<*> 
KD: Scanning for held locks.

Resource @ 0x86ec5de8    Exclusively owned
    Contention Count = 53
    NumberOfSharedWaiters = 2
     Threads: 85f2b030-01<*> 8584ad48-01    86efcd48-01    
KD: Scanning for held locks....

Resource @ 0x86edfe88    Exclusively owned
    Contention Count = 5
     Threads: 86efcd48-01<*> 
KD: Scanning for held locks........................................................................................................................................................................................................................................................................
11983 total locks, 5 locks currently held


3: kd> !thread 8584ad48
THREAD 8584ad48  Cid 164c.1654  Teb: 7ffdf000 Win32Thread: fd816c28 WAIT: (WrResource) KernelMode Non-Alertable
    86f403a8  Semaphore Limit 0x7fffffff
IRP List:
    85f45008: (0006,01d8) Flags: 00060000  Mdl: 00000000
Not impersonating
DeviceMap                 b24698e8
Owning Process            856a7bd0       Image:         ICEProLauncher.exe
Attached Process          N/A            Image:         N/A
Wait Start TickCount      24324          Ticks: 2 (0:00:00:00.031)
Context Switch Count      16352             
UserTime                  00:00:11.575
KernelTime                00:00:03.900
Win32 Start Address 0x1016479e
Stack Init c6c47fd0 Current c6c47628 Base c6c48000 Limit c6c45000 Call 0
Priority 14 BasePriority 8 UnusualBoost 3 ForegroundBoost 2 IoPriority 2 PagePriority 5
ChildEBP RetAddr  Args to Child              
c6c47640 82ab0c65 8584ad48 00000000 807c8120 nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
c6c47678 82aaf563 8584ae08 8584ad48 86f403a8 nt!KiSwapThread+0x266
c6c476a0 82aa940f 8584ad48 8584ae08 00000005 nt!KiCommitThreadWait+0x1df
c6c4771c 82ae12e5 86f403a8 0000001b 00000000 nt!KeWaitForSingleObject+0x393
c6c47774 82a7f8d4 86f403a8 00000001 8584ad48 nt!ExpWaitForResource+0x16f
c6c477b4 82acc714 86ec5de8 00000001 82acae87 nt!ExAcquireResourceSharedLite+0x22c
c6c477c8 8250dcbc 86ec5de8 8250fe3f c6c47a80 nt!ExEnterPriorityRegionAndAcquireResourceShared+0x24
WARNING: Stack unwind information not available. Following frames may be wrong.
c6c4780c 825107a3 ffb808e0 00000000 c6c47b9c win32k+0xbdcbc
c6c47a94 8252e2f0 ffb808e0 fdacedc0 00000000 win32k+0xc07a3
c6c47ac8 8252eb42 ffb808e0 fdacedc0 00000000 win32k+0xde2f0
c6c47bb0 8254ef82 ffbbd550 826694f8 ffbbd550 win32k+0xdeb42
c6c47c00 825162d2 2b010eab fd816c28 fea00618 win32k+0xfef82
c6c47c20 825162fa fea53a50 fd816c28 00000030 win32k+0xc62d2
c6c47c44 8251708c fea00618 fd816c28 00000030 win32k+0xc62fa
c6c47c60 8250b830 00000000 c6c47ce4 44a1c376 win32k+0xc708c
c6c47cb4 82503ba9 c6c47ce4 000025ff 00000000 win32k+0xbb830
c6c47d18 82a8544a 0027eeb4 00000000 00000000 win32k+0xb3ba9
c6c47d18 771e6194 0027eeb4 00000000 00000000 nt!KiFastCallEntry+0x12a (FPO: [0,3] TrapFrame @ c6c47d34)
0027eddc 00000000 00000000 00000000 00000000 0x771e6194


3: kd> !thread 85f2b030
THREAD 85f2b030  Cid 164c.1038  Teb: 7ff4c000 Win32Thread: fde81dd8 WAIT: (UserRequest) KernelMode Non-Alertable
    86f5c030  Mutant - owning thread 8584ad48
Not impersonating
DeviceMap                 b24698e8
Owning Process            856a7bd0       Image:         ICEProLauncher.exe
Attached Process          N/A            Image:         N/A
Wait Start TickCount      23777          Ticks: 549 (0:00:00:08.564)
Context Switch Count      1040             
UserTime                  00:00:00.109
KernelTime                00:00:00.530
Win32 Start Address 0x613cb684
Stack Init c363bfd0 Current c363baa0 Base c363c000 Limit c3639000 Call 0
Priority 14 BasePriority 8 UnusualBoost 4 ForegroundBoost 2 IoPriority 2 PagePriority 5
ChildEBP RetAddr  Args to Child              
c363bab8 82ab0c65 85f2b030 00000000 807c8120 nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
c363baf0 82aaf563 85f2b0f0 85f2b030 86f5c030 nt!KiSwapThread+0x266
c363bb18 82aa940f 85f2b030 85f2b0f0 00000000 nt!KiCommitThreadWait+0x1df
c363bb90 82510c3e 86f5c030 00000006 00000000 nt!KeWaitForSingleObject+0x393
WARNING: Stack unwind information not available. Following frames may be wrong.
c363bbd0 8252dddc c363bc38 c363bbfc 8252ed0f win32k+0xc0c3e
c363bbdc 8252ed0f c363bc38 c363bc10 8252df22 win32k+0xddddc
c363bbfc 8252ebd2 500107c0 82516caf 06ebf9fc win32k+0xded0f
c363bccc 82516cde fd7cf320 ffaa18f8 ffbbd550 win32k+0xdebd2
c363bd00 82a8544a 500107c0 00000000 00000000 win32k+0xc6cde
c363bd00 771e6194 500107c0 00000000 00000000 nt!KiFastCallEntry+0x12a (FPO: [0,3] TrapFrame @ c363bd34)
06ebfa0c 00000000 00000000 00000000 00000000 0x771e6194


3: kd> !thread 86efcd48
THREAD 86efcd48  Cid 01ac.01fc  Teb: 7ffd8000 Win32Thread: ffb1a3b8 WAIT: (WrResource) KernelMode Non-Alertable
    86f403a8  Semaphore Limit 0x7fffffff
IRP List:
    868ec990: (0006,0100) Flags: 00060970  Mdl: 00000000
Not impersonating
DeviceMap                 8ce050a8
Owning Process            86ec5348       Image:         csrss.exe
Attached Process          N/A            Image:         N/A
Wait Start TickCount      24077          Ticks: 249 (0:00:00:03.884)
Context Switch Count      11243             
UserTime                  00:00:00.000
KernelTime                00:00:01.201
Win32 Start Address 0x75313146
Stack Init af886fd0 Current af8865c8 Base af887000 Limit af884000 Call 0
Priority 13 BasePriority 13 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5
ChildEBP RetAddr  Args to Child              
af8865e0 82ab0c65 86efcd48 00000000 807c8120 nt!KiSwapContext+0x26 (FPO: [Uses EBP] [0,0,4])
af886618 82aaf563 86efce08 86efcd48 86f403a8 nt!KiSwapThread+0x266
af886640 82aa940f 86efcd48 86efce08 0000000e nt!KiCommitThreadWait+0x1df
af8866bc 82ae12e5 86f403a8 0000001b 00000000 nt!KeWaitForSingleObject+0x393
af886714 82ae0361 86f403a8 00000098 86ec5de8 nt!ExpWaitForResource+0x16f
af886750 825a2607 86ec5de8 00000001 ffb83050 nt!ExAcquireSharedStarveExclusive+0x18d
WARNING: Stack unwind information not available. Following frames may be wrong.
af8868f4 825a2a07 ffb808e0 000000f1 00000098 win32k+0x152607
af88694c 8249adf1 ffb808e0 000000f1 00000098 win32k+0x152a07
af886974 8249e7af ffb83008 000000f1 00000098 win32k+0x4adf1
af8869b4 8256fc98 00b83008 000000f1 00000098 win32k+0x4e7af
af8869f4 8253e849 000000f1 00000098 00000000 win32k+0x11fc98
af886a2c 8253e6ca 00000000 86467e18 af886a84 win32k+0xee849
af886a3c 82aea163 ffb22aa0 ffb22ac8 00000000 win32k+0xee6ca
af886a84 82ab0c4d 00000000 00000000 00000000 nt!KiDeliverApc+0x17f
af886ac8 82aaf563 86ef13f8 86efcd48 86efce44 nt!KiSwapThread+0x24e
af886af0 82aab82f 86efcd48 86efce08 00000000 nt!KiCommitThreadWait+0x1df
af886c68 824ef74d 00000002 865544d0 00000001 nt!KeWaitForMultipleObjects+0x535
af886cc0 82459008 00000001 865544d0 82463048 win32k+0x9f74d
af886d04 82458599 865544d0 00000001 82672ce0 win32k+0x9008
af886d18 8251e170 00000004 00cafd3c af886d34 win32k+0x8599
af886d28 82a8544a 00000004 00cafd7c 771e6194 win32k+0xce170
af886d28 771e6194 00000004 00cafd7c 771e6194 nt!KiFastCallEntry+0x12a (FPO: [0,3] TrapFrame @ af886d34)
00cafd7c 00000000 00000000 00000000 00000000 0x771e6194
4

2 回答 2

2

您有 2 个线程在等待同一事件:

8584ad48
c6c4771c 82ae12e5 86f403a8 0000001b 00000000 nt!KeWaitForSingleObject+0x393

and
86efcd48
af8866bc 82ae12e5 86f403a8 0000001b 00000000 nt!KeWaitForSingleObject+0x393

您可以看到86f403a8两个线程都在等待它,找出谁拥有这个事件对象,它应该指出可能是您的问题的根源。

于 2012-08-30T08:23:37.907 回答
-2

如果应用程序在 .NET 4.0 中,请在 Visual Studio 2010 中打开转储,如果链接正确的 PDB 文件,则可以毫无问题地进入代码。比 WinDBG 容易得多。

您可以通过单击按钮来查看应用程序在何处中止,Debug with mixed然后将应用程序的所有正确符号设置到正确的位置。更多信息

于 2012-08-30T06:46:38.177 回答