heisenbug


heisenbug

(jargon)/hi:'zen-buhg/ (From Heisenberg's UncertaintyPrinciple in quantum physics) A bug that disappears or altersits behaviour when one attempts to probe or isolate it. (Thisusage is not even particularly fanciful; the use of a debuggersometimes alters a program's operating environmentsignificantly enough that buggy code, such as that whichrelies on the values of uninitialised memory, behaves quitedifferently.)

In C, nine out of ten heisenbugs result from uninitialisedauto variables, fandango on core phenomena (especiallylossage related to corruption of the malloc arena) or errorsthat smash the stack.

Opposite: Bohr bug. See also mandelbug, schroedinbug.

Heisenbug

A bug in software that cannot be duplicated while under observation in a debugger. German theoretical physicist Werner Heisenberg showed that observing quantum mechanical behavior actually alters it. A software debugger may sometimes change the operating environment just enough to perform the process without error. For example, data that might have been stored in hardware registers when the program was optimized may be stored in main memory when compiled for debugging, and the memory values may be less accurate.

Timing can also be a cause of Heisenbugs; for example, a multithreaded process may crash under normal operation but work perfectly when instructions are executed one at a time. See bug and debugger.