Recent

Author Topic: heaptrc output  (Read 4817 times)

Чебурашка

  • Hero Member
  • *****
  • Posts: 593
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
heaptrc output
« on: November 03, 2023, 01:45:52 pm »
Is this output from heaptrc senseful?

Code: Bash  [Select][+][-]
  1. Heap dump by heaptrc unit of /opt/mep-hub/RemotedRecordingService-x86_64-linux
  2. 69402355 memory blocks allocated : 30328582835/30569010024
  3. 69402353 memory blocks freed     : 30328583347/30569010536
  4. 2 unfreed memory blocks : 18446744073709551104
  5. True heap size : 163840
  6. True free heap : 163200
  7. Should be : 163968
  8. Call trace for block $00007F7B0F84E9C0 size 96
  9.   $000000000043C7E1
  10. Call trace for block $00007F7B0F84E880 size 112
  11.   $0000000000460C70
  12.   $0000000000481212
  13.  

This line is very strange to me:

2 unfreed memory blocks : 18446744073709551104
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: heaptrc output
« Reply #1 on: November 04, 2023, 02:36:59 pm »
Is this output from heaptrc senseful?
Depends on what you mean by senseful. Basically you have 2 unfreed memory blocks somewhere, but the offending line (or unit) is not compiled with lineinfo (-gl) on and therefore, no line information can be given.

jamie

  • Hero Member
  • *****
  • Posts: 7701
Re: heaptrc output
« Reply #2 on: November 04, 2023, 03:01:08 pm »
more than likely, you corrupted one of the memory items your code and it hit the management of the heap trace code.

 So, you most likely have a memory boundary violated somewhere in your code and it should be fixed.

The only true wisdom is knowing you know nothing

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: heaptrc output
« Reply #3 on: November 04, 2023, 04:39:13 pm »
Thanks to Olly, today I know how to install with fpcupdeluxe and make heaptrc output human readable stack traces:

https://gitlab.com/freepascal.org/fpc/source/-/issues/40487

https://gitlab.com/freepascal.org/fpc/source/uploads/cb182de9c154d9fc5351471c72cff8a7/image.png
« Last Edit: November 04, 2023, 04:41:39 pm by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

Чебурашка

  • Hero Member
  • *****
  • Posts: 593
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: heaptrc output
« Reply #4 on: November 05, 2023, 11:34:09 am »
Thanks jamie, this is hinting me. The program has a problem with memory somewhere, and also this heaptrc log (despite it messed up as well) confirms it.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 593
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: heaptrc output
« Reply #5 on: November 06, 2023, 08:34:38 am »
Thanks to Olly, today I know how to install with fpcupdeluxe and make heaptrc output human readable stack traces:

https://gitlab.com/freepascal.org/fpc/source/-/issues/40487

https://gitlab.com/freepascal.org/fpc/source/uploads/cb182de9c154d9fc5351471c72cff8a7/image.png

Thanks, now I had the chance to read this more carefully in the desktop pc.

I often struggled with no debug stack traces. Basically, I need also to recompile the FPC, because the debian package seems built without debugging flags on.

Thank you for this important suggestion.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

 

TinyPortal © 2005-2018