[Lazarus] Memory corruption investigation

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Thu Mar 22 11:28:18 CET 2012


On Thu, Mar 22, 2012 at 1:13 AM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> Have you tried the "keepreleased"?

I set it to true as the first item in my program code and also in an
offending unit but couldnt see much of a difference.

I suppose that I should look for which block contains $B73DE820 to see
who allocated the memory, but there are no blocks in the listing:

Marked memory at $B73DE820 invalid
Wrong signature $AAAAAAAA instead of 755D2E31
  $08065DEB
  $08065EA7
  $0805C898
  $0812AAEC  TLAZINTFIMAGE__DESTROY,  line 3244 of intfgraphics.pas
  $08057AE2
  $08057AE2
  $0817E53E  TCDWIDGETSET__DELETEOBJECT,  line 863 of
./customdrawn/customdrawnwinapi.inc
  $0816DF2F  DELETEOBJECT,  line 181 of ./include/winapi.inc
  $080FDC2E  TSHAREDRASTERIMAGE__FREEHANDLE,  line 40 of
./include/sharedrasterimage.inc
Heap dump by heaptrc unit
432 memory blocks allocated : 101773/102496
378 memory blocks freed     : 92141/92816
54 unfreed memory blocks : 9632
True heap size : 786432
True free heap : 769024
Should be : 773296
Call trace for block $B73DD9C0 size 2160
  $0805C898
  $080DA2C7  TRAWIMAGE__EXTRACTRECT,  line 1576 of graphtype.pp
  $08100EF3  TCUSTOMBITMAP__SETSIZE,  line 342 of ./include/custombitmap.inc
  $08100360  TRASTERIMAGE__SETWIDTH,  line 956 of ./include/rasterimage.inc
  $08080925  TCDDRAWER__SCALERASTERIMAGE,  line 561 of customdrawndrawers.pas
  $08082120  TCDDRAWERANDROID__LOADRESOURCES,  line 482 of
customdrawn_android.pas
  $08080666  TCDDRAWER__CREATE,  line 518 of customdrawndrawers.pas
  $08083265  CUSTOMDRAWN_ANDROID_init,  line 759 of customdrawn_android.pas
// ....

The closest one is this first block, but still B73DD9C0 + 2160 is
B73DE230 which is less then B73DE820

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list