Recent

Author Topic: Doesn't work Heaptc unit for Linux?  (Read 810 times)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Doesn't work Heaptc unit for Linux?
« on: February 23, 2021, 02:46:58 pm »
Hi guys. Seem to be I found the bug.

I set option for checking memory leaks (Project options --> Compiler options --> Debugging --> Use Heaptrc unit). Then I create object but don't destroy it. For examle:

Code: Pascal  [Select][+][-]
  1.   TForm1 = class(TForm)
  2.     Button1: TButton;
  3.     procedure FormCreate(Sender: TObject);
  4.   private
  5.     FObj: TObject;
  6.   public
  7.  
  8.   end;
  9.  
  10. var
  11.   Form1: TForm1;
  12.  
  13. implementation
  14.  
  15. {$R *.lfm}
  16.  
  17. { TForm1 }
  18.  
  19. procedure TForm1.FormCreate(Sender: TObject);
  20. begin
  21.   FObj:= TObject.Create;
  22. end;                                        

For Windows, after closing the application, I receive expected a message with the details of the memory leak. But for Linux I don't get that warning.

Somebody check my assumptions. Screenshots and a test project in the attachment
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

bytebites

  • Hero Member
  • *****
  • Posts: 639
Re: Doesn't work Heaptc unit for Linux?
« Reply #1 on: February 23, 2021, 02:56:45 pm »
Linux output:
1 unfreed memory blocks : 8
True heap size : 1638400
True free heap : 1638176
Should be : 1638200
Call trace for block $00007FBE670E03A0 size 8
  $00000000004517D4  DOCREATE,  line 923 of include/customform.inc
  $000000000044F71F  AFTERCONSTRUCTION,  line 77 of include/customform.inc
  $0000000000457C11  CREATE,  line 3198 of include/customform.inc
  $0000000000461DCC  CREATEFORM,  line 2173 of include/application.inc
  $000000000041F0EE  $main,  line 22 of project1.lpr

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: Doesn't work Heaptc unit for Linux?
« Reply #2 on: February 23, 2021, 03:53:57 pm »
Hi bytebites.

Are you using terminal or IDE?
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: Doesn't work Heaptc unit for Linux?
« Reply #3 on: February 23, 2021, 03:59:49 pm »
A-ha
Quote
On *nix (including BSD, Linux and macOS), by default, nothing will be shown for GUI programs.
https://wiki.freepascal.org/heaptrc

The question is closed
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: Doesn't work Heaptc unit for Linux?
« Reply #4 on: February 23, 2021, 04:08:06 pm »
Menu: View > Debug Windows > Console output

zoltanleo

  • Sr. Member
  • ****
  • Posts: 488
Re: Doesn't work Heaptc unit for Linux?
« Reply #5 on: February 24, 2021, 12:48:14 pm »
Hi Martin

Thank a lot!
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

 

TinyPortal © 2005-2018