failclosed
← lab

The PATH collision that made failures look like results

What happened

Inside a shell function, a local variable was named PATH. In a shell, PATH is also the variable that tells the shell where to find commands. Assigning to it inside the function shadowed the real one, and every command that ran afterwards stopped being found.

Why it was dangerous

The tool did not crash. Commands failed, the failures were captured as output, and the output looked like legitimate test responses. A broken harness was producing plausible-looking results.

What caught it

Checking the tooling itself, rather than trusting what it printed. The results did not make sense for the calls that were supposedly made, and tracing why led to the shadowed variable.

The rule it left behind

Do not trust a test harness until you have verified that it can fail correctly. A tool that reports a clean result is only as good as your evidence that it would have reported a dirty one. After this, variable names that collide with environment variables are treated as bugs.

↑↓ move · enter go · esc close