[fpc-pascal](no subject)

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Sep 18 13:01:31 CEST 2001


Hi all,

Question 1:
I have a nasty bug: an unknown function is overwriting some memory. The bug appears later in other functions (destroyed heap and objects). For example: the GetMem allocates memory which partly was never freed.
To find the evil function I want to check the complete heap (allocated mem) from time to time to see when the error appears. I think the heaptrc unit can add marks at the head and the tail of each allocated mem and do some little checks every time memory is allocated/freed. But how can I check ALL structures (allocated+freed memory blocks) at once?

I set: 

initialization
  HeapTrc.QuickTrace:=true;
  HeapTrc.HaltOnError:=true;
  HeapTrc.KeepReleased:=false;
  HeapTrc.add_tail:=true;
  HeapTrc.UseCRC:=true;
writeln('heap tracing ...');
end.


Question 2:
If I set 'KeepReleased:=true' I got a Segmentation fault right before the 'writeln' statement. Why that?


Mattias Gaertner




More information about the fpc-pascal mailing list