agentsclimarketplace

Debug lockorder detection system

Skill kjuhwa/skills-hub/skills/debug/debug-lockorder-detection-system

Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.

Install
npx -y skills add kjuhwa/skills-hub --skill debug-lockorder-detection-system

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Runtime lock-order deadlock detection via a DEBUG_LOCKORDER compile flag that tracks lock acquisition order and reports circular dependencies.

SKILL.md

1.8 KB, 312 tokens by cl100k_base, as published. Nobody here has run it

Runtime Lock-Order Detection via DEBUG_LOCKORDER

When to use

Multi-threaded C++ codebases with enough locks that a human reviewer cannot prove a consistent global lock order by inspection.

Procedure

  1. Wrap all lock acquire/release sites in project-defined macros (e.g. LOCK(cs) / LOCK2(a, b)) so the instrumentation lives in one place.
  2. Gate the instrumentation behind a DEBUG_LOCKORDER compile flag, enabled in Debug and sanitizer CI builds, off in Release.
  3. On each acquire, capture {this_thread, lock_addr, call_site} into a per-thread held-lock stack and into a global (prev, next) edge set.
  4. Whenever a new edge inverts an existing edge, fail loudly (abort in Debug, log in relaxed modes) with both call sites so the user sees the offending pair.
  5. Pair with a DEBUG_LOCKCONTENTION flag that times lock waits to surface hot contention without changing release perf.

Notes

  • Store the held-lock stack in a thread_local container so no shared state is on the hot path.
  • Call-site capture via __FILE__/__LINE__ macros is enough; no stack walking required.
  • Run the instrumented build under the full functional test suite once per release — most real deadlocks surface in minutes.

Evidence

  • doc/developer-notes.md (sections "DEBUG_LOCKORDER" and "DEBUG_LOCKCONTENTION")
  • src/sync.h

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.