[lazarus] heaptrc on win98

Vincent Snijders vslist at zonnet.nl
Thu Jul 31 11:34:11 EDT 2003


On Thu, 31 Jul 2003 16:50:32 +0200
Florian Klaempfl <Florian.Klaempfl at gmx.de> wrote:

> Vincent Snijders wrote:
> > Hi,
> > 
> > I found another incompatibility between windows 98 and windows 2000.
> > When I use heaptrc on lazarus or the examples, it crashes with an
> > access violation. On windows 2000 there is no problem.
> > 
> > The crash takes place in the WindowProc function in
> > win32callback.pp. Recently a TLMInsertText variable was added. It
> > contains an ansistring, which means an exception block is added to
> > the function and also some memory from the heap is located.
> > 
> > On windows 2000, no access violation is created, but heaptrc reports
> > that not all memory is released: 
> > Heap dump by heaptrc unit
> > 146 memory blocks allocated : 592/1184
> > 146 memory blocks freed     : 584/1168
> > 0 unfreed memory blocks : 8
> > True heap size : 262144 (80 used in System startup)
> > True free heap : 261936
> > Should be : 262048
> > 
> > Shall I report this to the fpc buglist? It can be shown to happen
> > also in a slightly modified version of the winhello demo program
> > shipped with fpc.
> 
> Ansistrings deallocated in the exit code of the main program are
> handled improperly by the heaptrc unit because the check for
> unreleased blocks is done before these strings are deallocated.
> 
That is not the problem. Even allocating a longint and de-alocating it
immediately afterwards with new and dispose in the winproc function,
causes this problem. I think it has to do with creating the caller
address from this callback (I suspect it crashes in get_caller_addr).






More information about the Lazarus mailing list