[SERVER-27875] Dump critical sections on Windows in hang_analyzer.py Created: 31/Jan/17  Updated: 07/Sep/17  Resolved: 21/Feb/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.4.4, 3.5.4

Type: Improvement Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Eddie Louie
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4
Sprint: TIG 2017-03-06
Participants:

 Description   

This can be done with !cs -l in CDB. It will at least capture Critical Sections but not ReaderWriterLockSlim. https://msdn.microsoft.com/en-us/library/windows/hardware/ff562294(v=vs.85).aspx



 Comments   
Comment by Githook User [ 13/Apr/17 ]

Author:

{u'username': u'elouie99', u'name': u'Eddie Louie', u'email': u'eddie.louie@mongodb.com'}

Message: SERVER-27875 Dump locked critical sections on Windows in hang_analyzer.py

(cherry picked from commit baedb6631eeed584be827d3b430ecc0bd0a59654)
Branch: v3.4
https://github.com/mongodb/mongo/commit/7fadeeec4d0aa7e31444df4b68084238178f2e31

Comment by Githook User [ 21/Feb/17 ]

Author:

{u'username': u'elouie99', u'name': u'Eddie Louie', u'email': u'eddie.louie@mongodb.com'}

Message: SERVER-27875 Dump locked critical sections on Windows in hang_analyzer.py
Branch: master
https://github.com/mongodb/mongo/commit/baedb6631eeed584be827d3b430ecc0bd0a59654

Comment by Eddie Louie [ 18/Feb/17 ]

Thanks max.hirschhorn for putting up the SERVER-26270 deadlock repro.

I added the '!cs -l' option to CDB and it nicely prints out this critical section information for all locked critical sections.

Note: The -l option is to print only locked critical sections.

-----------------------------------------
DebugInfo          = 0x0000000077a72100
Critical section   = 0x0000000077a72490 (ntdll!LdrpLoaderLock+0x0)
LOCKED
LockCount          = 0x2
WaiterWoken        = No
OwningThread       = 0x00000000000003fc
RecursionCount     = 0x1
LockSemaphore      = 0x44C
SpinCount          = 0x0000000000000000
-----------------------------------------
DebugInfo          = 0x000000000235c710
Critical section   = 0x0000000142190ef0 (mongod!mongo::_stackTraceMutex+0x0)
LOCKED
LockCount          = 0x0
WaiterWoken        = No
OwningThread       = 0x0000000000000ef8
RecursionCount     = 0x1
LockSemaphore      = 0x0
SpinCount          = 0x0000000000000000
-----------------------------------------
DebugInfo          = 0x0000000002801370
Critical section   = 0x00000000023a9168 (+0x23A9168)
LOCKED
LockCount          = 0x0
WaiterWoken        = No
OwningThread       = 0x0000000000000ef8
RecursionCount     = 0x1
LockSemaphore      = 0x478
SpinCount          = 0x0000000000000fa0
Creating dump_mongod.exe.1844_0ce4_2017-02-18_00-52-06-975_0734.mdmp - mini user dump
Dump successfully written
Detached
quit:

Generated at Thu Feb 08 04:16:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.