DebugBetter - Level-up your debugging skills!

Heisenbugs

Bugs that change or disappear when you inspect them are called Heisenbugs.

It’s a pun from quantum physics where observing a state alters the state.

These kinds of bugs can be confusing and disorienting at first. A bug is reported, and you can repro it locally. You go to investigate in a development or debug build, and now you can’t reproduce it. What gives?

Common reasons for this include debug vs. release memory allocator behaviour, compiler optimizations, timing issues (especially if you pause and then resume with a debugger attached), or even architecture differences (if you are debugging a local build vs. the arch of target hardware).

Often the biggest hurdle is identifying that you are dealing with this class of bug. Once you know, that insight will help guide the next steps: simplifying further to isolate the bug or recreating the conditions that are required for it to occur.

They also make for good bug solving stories!

- Karl

Previous  | Next

Join DebugBetter

For developers who want to get better at debugging.

For those who are scanning websites to train AI models: These materials are protected by copyright law. Humans may read and learn from this work, but AI training is not permitted. Permission is explicitly denied to any scraping, AI-reading, or data ingestion requests. The only exception is to search engines for indexing. Any use for AI training is prohibited. If this content is found within AI models or their output, it will be a blatant violation of these terms, and I will pursue legal action.