When the tool you write to debug crashes crashes. A story of advanced printf-debugging.
AccessViolationException. This part starts when, as I ran out of easy things to try, I decided to map the assembly code of the IsLockHeld method to the original C++ code to understand exactly where it crashed.
InvalidProgramException, caused by a bug in the Datadog profiler, from a memory dump sent by a customer. This is the last part of the investigation, about figuring out what is wrong with the IL code.