[fpc-devel] issue in heaptrc?

Pierre Free Pascal pierre at freepascal.org
Thu Jan 26 14:56:08 CET 2012


  Yes, you are right...

I just committed a fix (together with multi-threaded windows executable
support in trunk)
If you have svn trunk, could you check that revision 20181 fixes
the problem you report?

Thanks in advance,

Pierre


> -----Message d'origine-----
> De : fpc-devel-bounces at lists.freepascal.org [mailto:fpc-devel-
> bounces at lists.freepascal.org] De la part de Martin
> Envoyé : jeudi 26 janvier 2012 06:37
> À : FPC developers' list
> Objet : [fpc-devel] issue in heaptrc?
> 
> I ve been playing around with -gc and I found something suspect in heaptrc
> 
> procedure CheckPointer(p : pointer); [public, alias : 'FPC_CHECKPOINTER'];
> 
> "p" is a pointer, that should be somewhere *inside* an allocated block
> of mem
> 
>    pp:=loc_info^.heap_mem_root;
>    while pp<>nil do
>     begin
>       { inside this block ! }
>       if
> (ptruint(p)>=ptruint(pp)+sizeof(theap_mem_info)+ptruint(extra_info_size))
> and
> 
>
(ptruint(p)<=ptruint(pp)+sizeof(theap_mem_info)+ptruint(extra_info_size)+ptr
> uint(pp^.size))
> then
> 
> 
> if this loop does not find anything then
> 
>    writeln(ptext^,'pointer $',hexstr(p),' does not point to valid memory
> block');
>    dump_error(p,ptext^);
>    runerror(204);
> 
> 
> but
>    procedure dump_error(p : pheap_mem_info;var ptext : text);
> 
> expects a pheap_mem_info, p is not a pheap_mem_info
> 
> and that is where it crashes (shortly before dump stack trace :(  )
> Did I miss something or is there a bug?
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list