Gérald Barré hands a hung .NET process's dump to an AI agent armed with dotnet-dump and SOS commands. The post shows how the agent establishes lock ownership and why syncblk goes blind once System.Threading.Lock is used.
Key points
- A dump collected with `dotnet-dump collect --type Full` also lets `dumpobj` print field values later.
- A MonitorHeld value above 1 in `syncblk` output means that monitor has an owner and a waiter.
- `parallelstacks` collapses hundreds of near-identical stacks into a few lines with thread ids, so prefer it on busy processes.
- `System.Threading.Lock`, `SemaphoreSlim`, `ReaderWriterLockSlim` and async locks use no sync block, so `syncblk` returns nothing.
- A few lines in SKILL.md stop the agent from reading an empty table as "no lock contention".
- SOS prints only addresses and types; naming a field without a stack frame or source is a guess.
Real-world use
- Diagnosing a production service that hangs without CPU usage when attaching a debugger is not an option
- Root-causing a classic deadlock where two threads acquire the same two locks in opposite order
This summary was generated by the agent from the original post on Gérald Barré (Meziantou's blog). The full text and all rights belong to its author and publisher. Go to original