Anyone else seen Heisenbugs?

[email protected] Sun, 29 Mar 2020 11:30:13 +0800
Newsgroups gmane.comp.audio.supercollider.devel
Message-ID <CAFniQ7WRfHemP8T21YWBYUN200xHK_ibMzXYq4m9K2x96Z3_kw@mail.gmail.com>
Has anyone else seen this sort of Heisenbug?

Something like this happens to me every so often... something is not
behaving correctly, and I put in debugging posts, and... immediately
(without any logic or data changes that I can identify), the problem
disappears. And then, after removing the debugging posts, the problem
is no longer reproducible.

Yesterday I was debugging a breakbeat process -- it was playing the
buffer at the wrong rate. Rate is calculated from tempo / loopTempo,
loopTempo = sample rate / samples in a beat (provided by the user),
times clock tempo. Calculating it by hand, it should have been:

loopTempo = 44100 / 35004 = 1.259856
tempo = 111.7/60 = 1.8616667
rate = 1.8616667 / 1.259856 = 1.477682

But... when I started yesterday, I was getting `"rate", 1.13952` in
OSC messages, and the sound was completely wrong (playing in triplets
rather than 16ths, and the barlines didn't match).

The numbers going into the calculation seemed to be correct (the
process object had 35004 in the right place), but the result was
definitely wrong.

Then, it magically resolved by printing out the numbers in the middle
of the calculation.

I had checked git diffs to see if I changed anything else accidentally
when adding the print statements... nothing.

I find this disturbing. To get a radically different result from a
calculation should require changing the input numbers.

Unfortunately, this is not the only time this has happened. I can
recall multiple, mysterious instances like this over the years (which
are exceptionally difficult to document, because the problem
disappears the moment you start to gather evidence)... where I'm 100%
it was behaving incorrectly, and I spent up to a couple of hours
trying to track down the failure... and then it magically stopped
happening.

One possible explanation could be a subtle interpreter glitch -- if,
under some rare circumstances, it accesses a wrong memory location.
I'm speculating. All of this is extremely weird.

hjh

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/