The Fix That Passed Review and Crashed in Release A developer at MonkeyCode recounts a debugging saga where a C++ worker pool crashed in release builds due to a stack-use-after-scope bug, despite passing both human and AI code review. The root cause was a lambda capturing a local variable by reference, fixed by changing to capture-by-value. The developer emphasizes that reviews are opinions while tests are evidence, and recommends using sanitizers and clean environments for verification. The fix passed review. It still crashed in release. The reviewer was never tested. The reviewer was me. And an AI model. We both approved the same wrong patch. This is the retrospective. Symptom, root cause, fix. Plus the debugging loop that actually caught it. A small C++ worker pool returned garbage. Not always. Only with -O2 . Only after a few thousand tasks. That is the classic undefined behavior profile. The code looks innocent. The compiler does something legal. Your program does something insane. Here is the minimal shape of the code: include