PyWart: The problem with "print"

Tim Delaney timothy.c.delaney at gmail.com
Sun Jun 2 23:37:27 EDT 2013


On 3 June 2013 13:23, Jason Swails <jason.swails at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130603/c4d66ed4/attachment.html>


More information about the Python-list mailing list