[SOLVED] Problem with HeapTrc lazarus / 12-Debugger ---------------------------------------------------------------------- Phoenix · 2019-07-13 13:05 Hello, I detected a problem and tried to isolate it in a minimal test application. Always reproducible error (computer restarted for clean memory) Configuration: Windows 10 64bit Lazarus 2.0.2 FPC 3.0.4 64bit The problem only occurs if the following option is active: Project options -> Debugging -> "Use Heaptrc unit (check for mem- leaks) (-gh)" I attach the source for the test and the images of the error. I could use the alternative commented code but the other one seems correct to me. Any help is welcome ---------------------------------------------------------------------- ASerge · 2019-07-13 14:30 Quote from: Phoenix on July 13, 2019, 03:05:12 pmI could use the alternative commented code but the other one seems correct to me. Code error. SizeOf(ARows) = SizeOf(Pointer). Judging by the screenshot, it is a 64-bit program, i.e. it is 8 bytes. But the length of the ARows is only 1 byte. ---------------------------------------------------------------------- totya · 2019-07-13 14:31 Your code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TEST_ERROR;Var //i: Integer;  ARows: array of Byte;begin SetLength(ARows,1); try  FillChar(ARows[0],SizeOf(ARows),0);   //for i:= Low(ARows) to High(ARows) do  // ARows[i]:= 0; finally  SetLength(ARows,0); end;end; See it: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FillChar(ARows[0], SizeOf(ARows[0]) * Length(ARows), 0); ---------------------------------------------------------------------- Phoenix · 2019-07-13 14:44 Thanks, in fact, really a big mistake. ---------------------------------------------------------------------- totya · 2019-07-13 14:48 Quote from: Phoenix on July 13, 2019, 04:44:10 pmThanks, in fact, really a big mistake.  If you use non-stardand variable operations, I mean when you use direct memory access, then you must be careful.