nielsAD / lape

Scripting engine with Pascal-like syntax for FPC and Delphi
119 stars 28 forks source link

Double memory free? #195

Open zamtmn opened 10 months ago

zamtmn commented 10 months ago

I got this report from heaptrc. As far as I understand, something went wrong in LAPE

Y:\zcad\cad\bin\x86_64-win64\zcad.exe nosplash updatepo qleam qlcl qlm_trace 
Heap dump by heaptrc unit of "Y:\zcad\cad\bin\x86_64-win64\zcad.exe"
12666242 memory blocks allocated : 1104562911/1159942704
12666242 memory blocks freed     : 1104562911/1159942704
0 unfreed memory blocks : 0
True heap size : 2930999296 (736 used in System startup)
True free heap : 4463072
Should be : 2930998560
offset72:$0000000000000048"00"
offset73:$0000000000000049"00"
offset74:$000000000000004A"00"
offset75:$000000000000004B"00"
offset76:$000000000000004C"00"
offset77:$000000000000004D"00"
offset78:$000000000000004E"00"
offset79:$000000000000004F"00"
Marked memory at $00000000C5585360 released
Call trace for block at $00000000C5585360 size 152
  $0000000100016DCA  GETMEM,  line 286 of ../inc/heap.inc
  $0000000100013649  NEWINSTANCE,  line 512 of ../inc/objpas.inc
  $0000000100832EC2  CREATE,  line 1009 of ../lpinternalmethods.pas
  $0000000100825AF1  RESTYPE,  line 2723 of ../lptree.pas
  $0000000100825F0C  RESTYPE,  line 2782 of ../lptree.pas
  $00000001007A7DF7  RESOLVEMETHOD,  line 3238 of ../lpcompiler.pas
  $00000001007A7C9C  RESOLVE,  line 3271 of ../lpcompiler.pas
  $00000001007A7BEA  RESOLVEMETHODS,  line 3295 of ../lpcompiler.pas
 was released at 
  $00000001000253EC  TRACEFREEMEMSIZE,  line 773 of ../inc/heaptrc.pp
  $00000001000254E5  TRACEFREEMEM,  line 813 of ../inc/heaptrc.pp
  $0000000100016E43  FREEMEM,  line 326 of ../inc/heap.inc
  $000000010001368B  FREEINSTANCE,  line 522 of ../inc/objpas.inc
  $0000000100820D0E  DESTROY,  line 1787 of ../lptree.pas
  $0000000100013481  FREE,  line 407 of ../inc/objpas.inc
  $0000000100825712  fin$00000480,  line 2737 of ../lptree.pas
  $00000001007A93C1  PARSESTATEMENT,  line 3542 of ../lpcompiler.pas
freed again at
  $00000001000248A1  RELEASED_MODIFIED,  line 402 of ../inc/heaptrc.pp
  $0000000100025F75  DUMPHEAP,  line 1380 of ../inc/heaptrc.pp
  $00000001000259C4  DUMPHEAP,  line 1240 of ../inc/heaptrc.pp
  $0000000100026695  TRACEEXIT,  line 1637 of ../inc/heaptrc.pp
  $0000000100026C27  HEAPTRC_$$_finalize$,  line 1825 of ../inc/heaptrc.pp
  $0000000100016191  FINALIZEUNITS,  line 1174 of ../inc/system.inc
  $0000000100016482  INTERNALEXIT,  line 1272 of ../inc/system.inc
  $00000001000164AE  fpc_do_exit,  line 1315 of ../inc/system.inc
  $00000001000039C5  main,  line 378 of zcad.pas
  $0000000100004776  MAIN_WRAPPER
  $000000010001D890  EXE_ENTRY,  line 83 of x86_64/cpuwin.inc
  $000000010000352B  _FPC_WINMAINCRTSTARTUP,  line 118 of sysinit.pp
  $00007FF9065E257D
  $00007FF9079AAA58
offset72:$0000000000000048"00"
offset73:$0000000000000049"00"
offset74:$000000000000004A"00"
offset75:$000000000000004B"00"
offset76:$000000000000004C"00"
offset77:$000000000000004D"00"
offset78:$000000000000004E"00"
offset79:$000000000000004F"00"
Marked memory at $00000000C5584D60 released
Call trace for block at $00000000C5584D60 size 152
  $0000000100016DCA  GETMEM,  line 286 of ../inc/heap.inc
  $0000000100013649  NEWINSTANCE,  line 512 of ../inc/objpas.inc
  $0000000100832EC2  CREATE,  line 1009 of ../lpinternalmethods.pas
  $0000000100825AF1  RESTYPE,  line 2723 of ../lptree.pas
  $0000000100825F0C  RESTYPE,  line 2782 of ../lptree.pas
  $00000001007A7DF7  RESOLVEMETHOD,  line 3238 of ../lpcompiler.pas
  $00000001007A7C9C  RESOLVE,  line 3271 of ../lpcompiler.pas
  $00000001007A7BEA  RESOLVEMETHODS,  line 3295 of ../lpcompiler.pas
 was released at 
  $00000001000253EC  TRACEFREEMEMSIZE,  line 773 of ../inc/heaptrc.pp
  $00000001000254E5  TRACEFREEMEM,  line 813 of ../inc/heaptrc.pp
  $0000000100016E43  FREEMEM,  line 326 of ../inc/heap.inc
  $000000010001368B  FREEINSTANCE,  line 522 of ../inc/objpas.inc
  $0000000100820D0E  DESTROY,  line 1787 of ../lptree.pas
  $0000000100013481  FREE,  line 407 of ../inc/objpas.inc
  $0000000100825712  fin$00000480,  line 2737 of ../lptree.pas
  $00000001007A93C1  PARSESTATEMENT,  line 3542 of ../lpcompiler.pas
freed again at
  $00000001000248A1  RELEASED_MODIFIED,  line 402 of ../inc/heaptrc.pp
  $0000000100025F75  DUMPHEAP,  line 1380 of ../inc/heaptrc.pp
  $00000001000259C4  DUMPHEAP,  line 1240 of ../inc/heaptrc.pp
  $0000000100026695  TRACEEXIT,  line 1637 of ../inc/heaptrc.pp
  $0000000100026C27  HEAPTRC_$$_finalize$,  line 1825 of ../inc/heaptrc.pp
  $0000000100016191  FINALIZEUNITS,  line 1174 of ../inc/system.inc
  $0000000100016482  INTERNALEXIT,  line 1272 of ../inc/system.inc
  $00000001000164AE  fpc_do_exit,  line 1315 of ../inc/system.inc
  $00000001000039C5  main,  line 378 of zcad.pas
  $0000000100004776  MAIN_WRAPPER
  $000000010001D890  EXE_ENTRY,  line 83 of x86_64/cpuwin.inc
  $000000010000352B  _FPC_WINMAINCRTSTARTUP,  line 118 of sysinit.pp
  $00007FF9065E257D
  $00007FF9079AAA58