On 3 June 2013 13:23, Jason Swails <jason.swa...@gmail.com> wrote:

> Yea, I've only run into Heisenbugs with Fortran or C/C++.  Every time I've
> seen one it's been due to an uninitialized variable somewhere -- something
> valgrind is quite good at pinpointing.  (And yes, a good portion of our
> code is -still- in Fortran -- but at least it's F90+ :).
>

With the increase in use of higher-level languages, these days Heisenbugs
most often appear with multithreaded code that doesn't properly protect
critical sections, but as you say, with lower-level languages uninitialised
memory is a common source of them.

I had a fun one once (in C++, but could have happened in any language)
where a semaphore was being acquired twice on the one thread. There were 10
semaphore slots available, and very occasionally the timings would result
in one of the threads deadlocking. Fortunately, by reducing to a single
thread + single semaphore slot I was able to turn it from a Heisenbug to a
100% replicable bug.

Tim Delaney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to