Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So I found my problem. As Mats Petersson suggested, my problem was in fact an array overrun. It turns out that I had this little gem buried in my utilities for my unit tests:</p> <pre><code>SampleArray createPredictableSamples(int count) { SampleArray samples(new Sample[100]); for (int i = 0; i &lt; count; ++i) { ... do stuff } return samples; } </code></pre> <p><em>(notice the static array creation of size 100, when the method is parameterized...)</em></p> <h2>So just remember, <strong>test code has bugs too!!</strong></h2> <p>Here's the method I used to discover this.</p> <p>When I posted my question, I had made a bunch of changes since the last time I ran the tests. The output from running</p> <pre><code>valgrind --tool=memcheck --leak-check=yes ./test </code></pre> <p>was a little overwhelming because of this. So I backed out of most of those changes (using my version control to keep them available), and then re applied them one by one as functional sets.</p> <p>Each time I introduced one change set, I re-ran the tests, and used valgrind to check for memory errors. Finally, I made one change (changing my test array size) that produced a huge amount of output. I searched through that (as valgrind suggests) for "writes" to uninitialized memory (i.e. for buffer overruns). And lo and behold, it lead me right to the problem, line-numbers and all.</p> <p>Along the way, I also found a couple of other memory leaks in my test code. Now, I still have more work to do cleaning up test code for memory leaks, but I at least have gotten rid of the buffer overrun.</p> <p>Thanks Mats, David, and vonbrand for pointing me in the right direction!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload