Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2023-08

heaptrc under linux points to the wrong line

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

Hello,

as per the subject, with heaptrc enabled, output to a file and using the "view leaks and traces" feature of lazarus, I see several leaks, always on the same line.
However, under linux 64 bits, the line it points to is not where the leak is created.

Linux was reporting the leak in this function

function TSseResponse.Send(const command:TDisplayCommand):boolean;
const eventstring='event:';
       datastring='data:';
var
   cmd: TSseCommand;
begin
   if command=nil then
   begin
     cmd.event:='';
     cmd.data:='';
   end else
     cmd:=command.GetCommand;  <--- here

TSseCommand is declared as

   TSseCommand = record
     event,data:string;
   end;

I compile the same project under windows (32 bits) and there I see the real location of the leak: inside the "GetCommand" method of one of the classes derived from TDisplayCommand.

Fpc 3.2.2, lazarus 2.2.6, debug info automatic (-g) and using the external debug symbols file (-Xg).

Bye

Luca