Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Heisenbug is a very specific concept that refers to bugs that don’t reproduce because you are attempting to debug them. E.g. your debug printf statement changes the compiler output enough such that the bug no longer occurs with the same inputs. Or running the program in the debugger changes the thread scheduling, so the race condition is no longer hit. General difficulty reproducing is not what makes a heisenbug. What’s hard about heisenbugs is investigating their cause, not necessarily discovering and reproducing them.


One such instance is when debug mode causes memory allocations to be zeroed, while release mode doesn't. Always a recipe for a good time.


Or your printf changes:

- the timing of execution so nothing works => hello USB driver!

- the scheduling of your threads

- the memory layout => a memory overflow won't crash your program the same way or not at all

I feel lucky I've enough hairs to pull them out on this kind of bugs. Fun time indeed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: