Debugging one layer deeper
summary
Production crashes once per day lead to WinDbg memory dumps and SOS-assisted stacks, disassembly mapping native CLR code back to C++ and object headers, and a concrete repro built in Visual Studio that triggers the fault. Root cause is a promoted thin-lock whose syncblk stores -1 in m_holding_thread because the thread id is missing from the id->thread table after thread finalization; header space is only 26 bits, and investigation uses WinDbg and SOS to trace registers, offsets (notably 0x2c) and the sync block promotion.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:15Three steps
- 4:58Symptoms
- 5:46Memory dump
- 9:35Monitor that is entered
- 10:36Source code
- 11:38Checking source code
- 13:52Checking the calling convention
- 21:33Refining the theories
- 25:21The source code
- 27:40Checking the source code
- 30:15Checking the instruction code
- 34:39Verifying offset2c
- 36:29Guess thread owning monitor lock
- 41:05Analyzing the source code
- 47:09Unresolved questions
- 50:19Conclusion








