heisenbug — a defect that stops misbehaving the moment you look at it
heisenbug [--observe] [--printf] [--attach gdb] TARGET observe(bug) → ∅
heisenbug locates a fault, attaches an observer, and reports that no fault is present. The two statements are not in conflict. The fault is present when unobserved and absent when observed, and the observer is the difference. Every instrument you bring to the target — a print statement, a breakpoint, a slower clock — has mass, and the mass lands on the timing that was the whole bug.
It runs in two panels. Off the cursor the target scuttles, drifts state, and files crashes to a log no one is reading. Under the lens it aligns: still, correct, blameless. The attempt counter climbs on every invocation. The witness counter does not move, and has a note explaining why.
heisenbug never returns the defect. It returns a clean frame, a green build, and an alibi. Callers who require the defect are advised to stop looking, which is the one action the tool cannot perform on their behalf.
The -bug half descends from the moth taped into the Harvard Mark II log by Grace Hopper's team in 1947, though "bug" for a hardware fault predates it to Edison in the 1870s. The heisen- half borrows Werner Heisenberg's 1927 uncertainty principle, in which the act of measuring a quantum system perturbs the system measured. The compound circulated in hacker usage through the 1980s and was fixed in the Jargon File. Jim Gray's 1985 paper "Why Do Computers Stop and What Can Be Done About It" formalized its opposite, the solid and reproducible Bohrbug.
The witness counter has read 0 since 1985 and is believed accurate.
--observe and the defect cannot be scheduled in the same instant. This is not a limitation of the scheduler.
Closing a report as CANNOT REPRODUCE reopens it in production. Filed by everyone. Status: nominal.
livelock(1), bitrot(8), thrashing(1). The living exhibit demonstrates the word in motion:
▸ operate heisenbug