Live data from Hacker News

Heisenbug

en.wikipedia.org

31–34 of 34 posts

Re: Heisenbug

#31

Every coder at some stage has run into this, right? - A bug that disappears when you try to add some cout - Everything looks correct in debug, where (as mentioned) the variables are initialised to nice values like 0. When you compile with -O3, you get really large values instead. - A bug that is rare enough that you have to run the program for a long while before it happens. And when it does, you haven't logged the r…

> Everything looks correct in debug, where (as mentioned) the variables are initialised to nice values like 0. When you compile with -O3, you get really large values instead.

Uninitialized variable. Turn on warnings.

Re: Heisenbug

#32
I loved the heisenbug/bohrbug distinction in the zen of Erlang [1]:

> Basically, a bohrbug is a bug that is solid, observable, and easily repeatable. They tend to be fairly simple to reason about. Heisenbugs by contrast, have unreliable behaviour that manifests itself under certain conditions...

It continues talking that for some kind of heisenbugs, one smart strategy is just to restart to a known state, and forget about this one in a million failures (let it crash).

[1] https://ferd.ca/the-zen-of-erlang.html

Re: Heisenbug

#33
post #18

Reminds me of the people who couldn't send email farther than 500 miles. https://www.ibiblio.org/harris/500milemail.html

Warms my heart that ttl was the first thing i thought of when hearing the bug.

Re: Heisenbug

#34

I transitioned over from hardware design long ago. We had a similar concept where the circuit would work, but only when an oscilloscope probe is attached at the right place..

like this? https://www.eevblog.com/2018/02/15/eevblog-1057-µcurrent-mur...

I was going to say, like in this : https://xkcd.com/730/

Except even after 10 minutes staring at his circuit diagram, I can't see the "attach scope probe here" so I must have dreamed it.

Back in the day we would muse about selling a "scope probe emulator" device that had the same 10pf capacitance or so, but was much smaller than an actual oscilloscope and could therefore easily be incorporated into a production board. Of course now oscilloscopes are sufficiently small and cheap that you could simply use a real one.

Post reply on HN