<div dir="ltr">On 3 June 2013 13:23, Jason Swails <span dir="ltr"><<a href="mailto:jason.swails@gmail.com" target="_blank">jason.swails@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style>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+ :).<br>
</div></div>
</blockquote></div><br></div><div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Tim Delaney</div></div>