At 11:57 PM -0700 5/30/99, Paul Gargan wrote:
>Issuing a 'hd 0' on the debug console gives me a heap corrupt message so it
>looks like I am trashing something somwhere. Now to try and find out what.
Tip: The last line to print from the "hd" output is the last one that had
a good header. Since most heap trashing errors occur because you write off
the end of a chunk into the next one, look at the code that writes to this
last good chunk for errors.
Occasionally, the "last good" chunk isn't actually good, and it's header
has been corrputed in a subtle way--like the size field was changed. In
that case, check out the code that writes to the chunk just before that one
for overrun problems.
Background: The chunks are all right next to each other. 'hd' finds the
start of each chunk by starting at the beginning of the heap, then stepping
forward by the size specified in each chunk header. So naturally it works
fine until it comes to a corrupt header, then it can't go any farther.
--Bob