Sign in Join

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

Mailing lists / lazarus / 2008-12

Leakview+lazarus 0.9.26+WinXP

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Raistware

Hello
I'm trying to use under WinXP (with leakview
downloaded from svn) But when I try to launch the application with the environment variable set:

C:\ > set HEAPTRC="log=myheap.log"
C:\ > application.exe

It fails to run with this:
---------------------------
Error
---------------------------
Runtime error 123 at $00411F28

$00411F28

$0040FC90

---------------------------
Ok
---------------------------

If I run without the environment variable it runs normally. Any advice ?

Reply by email

dmitry boyarintsev
to Raistware

Seems like some bug with file access.

As a temporary solution you can specify the heaptrc output at the run-time, rather than using environment variable.

if you're using Lazarus projects you can do it in the following way:
* remove Linking option "Use heaptrc unit (-gh)". You'll use the unit manually.
* Open your projects source (Project->Source) add 'heaptrc' to your uses section.
* Add SetHeapTraceOutput(outputfilename) call as the first line of the program. After your application is closed, the specified file, will be filled with debug data.
* do NOT SET envirnoment variable. Run the application.

It's also good to delete the file, otherwise information will be appended to the file, and leakview might double-read the leaks

program test;
{$mode objfpc}{$H+}

uses
heaptrc, {1 heaptrc must be used}

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { you can add units after this }, mainform, SysUtils, LResources;
{$IFDEF WINDOWS}{$R test.rc}{$ENDIF}
begin
  // this is optional file cleaning, uncomment next line to delete the file
  // if FileExists('test.txt') then DeleteFile('test.txt');
  SetHeapTraceOutput('test.txt');
  {$I test.lrs}
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

Reply by email

Raistware
to dmitry boyarintsev

dmitry boyarintsev escribi?:

Show quoted text 7 lines
The solution is even simplier: heaptrc doesn't handle quoted parameters correctly. You can solve the problem by specifying file log parameter WITHOUT quotes, i.e.: C:\ > set HEAPTRC=log=myheap.log C:\ > application.exe

Thanks you a lot, exactly without the quotes it works like a charm.

Reply by email