Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You probably have a corrupt heap. This could be caused by invalid deallocations (deallocating unowned or already free memory), or by some random chunk of code writing outside its memory area into a place that happens to hold the heap bookeeping data structures. This most likely will be a piece of code that has nothing whatsoever to do with that dynamically allocated memory.</p> <p>Tracking down bugs like this is a real bear. They tend to appear long after the offending code has executed, and they have an annoying tendency to turn into <a href="http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug" rel="nofollow">heisenbugs</a> (bugs that move or go away when you attempt to debug them).</p> <p>My suggestion for approaching debugging would be to try to comment out portions of your code and see what causes the problem to go away. That isn't foolproof, as you could just end up moving the out-of-bounds write to somewhere else.</p> <p>Looking over the code you just posted, one thing I would <strong>highly</strong> suggest you do is verify that your <code>malloc</code> specified enough memory to hold all the data you are attempting to load into it. It looks to me like you are assuming 2 bytes for each vertex. That seems a bit suspicious to me. I don't know your code, but 4 or 8 would be much more common element sizes to see there. Regardless, industry practice is to use <code>sizeof()</code> on the target type to help ensure you have it right.</p> <p>Another option, if that debugger message of yours can show you where it is happening, would be to put a debugger watch point there (or write some watching code...or manually dump and inspect the area) when stepping in the debugger to try to figure out which is the offending line of code.</p> <p>Good luck. I hate these bugs.</p>
 

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