coroTracer: Cross-language, zero-copy coroutine observability
Why I built this: I was dealing with a really annoying bug in my M:N scheduler. Under heavy load, throughput would just flatline to zero. I ran ASAN and TSAN, but they came up empty because no memory was actually corrupted. It turned out to be a "lost wakeup"—coroutines were stuck forever waiting on a closed file descriptor. Traditional tools just can't catch these logical state machine breaks. I wrote coroTracer to track this exact issue down, and it worked.
coroTracer is an out-of-process tracer for M:N coroutine schedulers. It tracks down logical deadlocks, broken state machines, and coroutine leaks.
Architecture
+-----------------------+ +-----------------------+ | Target Application | | Go Tracer Engine | | (C++, Rust, Zig...) | | | | | [ Lock-Free SHM ] | | | +-----------------+ | +-----------------+ | +-----------------+ | | | cTP SDK Probe |=======> | StationData [N] | <=======| Harvester Loop | | | +-----------------+ | Write +-----------------+ Read | +-----------------+ | | | ^ | | | [ Socket ] |---(Wakeup)---UDS---(Listen)---| [ File I/O ] | +-----------------------+ +-----------------------+ | (Append) v +-------------------------+ [ DeepDive ] +---------------+ | Interactive HTML Portal | <--- analyzer.go --------- | trace.jsonl | +-------------------------+ (Heuristics) +---------------+
How it works
The main idea is simple: keep the tracer out of the target process's way.
Execution Plane : The C++/Rust SDK writes state changes directly into pre-allocated shared memory using lock-free data structures.
: The C++/Rust SDK writes state changes directly into pre-allocated shared memory using lock-free data structures. Observation Plane: A separate Go engine pulls this data in the background to build the topology. No network overhead, zero context switching.
The Gritty Details
... continue reading