[Lazarus] FPC_REQUIRES_PROPER_ALIGNMENT defined on Solaris causes crash in lazarus

Ludo Brands ludo.brands at free.fr
Sat Jul 2 19:27:12 CEST 2011


Found the cause of the crash of the IDE on Solaris x86 when closing a
project: in procedure Search in TProject.UpdateUnitComponentDependencies
(ide/project.pp) some pointer arithmetic is used assuming TTypeData is
packed. This is not the case for solaris x86.
Snippet:
 
PropInfo:=PPropInfo(PByte(@TypeData^.UnitName)+Length(TypeData^.UnitName)+1)
;
      // read property count
      CurCount:=PWord(PropInfo)^;
      inc(PtrUInt(PropInfo),SizeOf(Word));
      
      // read properties
      while CurCount>0 do begin
        // point PropInfo to next propinfo record.
        // Located at Name[Length(Name)+1] !
        if (PropInfo^.PropType^.Kind=tkClass) then begin

Curcount is ok
PropInfo+SizeOf(Word) causes PropInfo^.PropType^.Kind to crash. It's 2 bytes
off.

Where should I report this bug? FPC or Lazarus. The latter I guess?

Ludo





More information about the Lazarus mailing list