[fpc-devel] crash in heaptrc

Martin lazarus at mfriebe.de
Sat Sep 17 16:41:15 CEST 2011


I get a crash in heaptrc.

It happens when the lazarus IDE is compiled with both -gh and -gc.
It is triggered by an error in lazarus (most likely), but IMHO should 
probably not crash (so it could of course be corruption by Lazarus)

But first => Lazarus works fine with only -gh. As far as I know, if 
compiled with -gh, it uses no other mem manager but heaptrc. So I am 
pretty sure the result is NOT due to mixing mem managers.

It appears lazarus actually triggers the gc check.
This happens, while accessing a pointer gotten from "LockResource" => 
maybe ultimately some memory provided by the OS (w32)

#0 UPDATECRC32(1760721319, 0, 4) at ..\inc\heaptrc.pp:202
#1 CALCULATE_SIG(0x4) at ..\inc\heaptrc.pp:222
#2 DUMP_ERROR(0x4, <error reading variable: Bad debug information 
detected: Attempt to read 592 bytes from registers.>) at 
..\inc\heaptrc.pp:344
#3 CHECKPOINTER(0x68f279a7) at ..\inc\heaptrc.pp:1123
#4 LOADFROMRESOURCEHANDLE(0x163b80, 4194304, 19721916) at 
include\icon.inc:1391

So check pointer fails. => that may be ok => and I would expect an error 
to be raised (runerror 204) => but instead i get a SigSegV

Somehow "DumpError" crashes => and I am not sure, that this crash should 
happen.
Depends
- if lazarus indeed trashed structures belonging to heaptrc => well then 
it may happen
- if lazarus got memory from somewhere else (which could be the case 
here) then it shouldn't happen.

I haven't got the insight into heaptrc to quickly check what is the case.

Martin



More information about the fpc-devel mailing list