Skip to content

External: SIGSEGV on use Default of record

  • Lazarus/FPC Version: Lazarus 2.3.0 (rev Unknown) FPC 3.3.1 x86_64-linux-gtk2
  • Operating System: Linux
  • CPU / Bitness: 64

What happens

An error occurs at project startup when Default(TBuffer) is called

What did you expect

Normal initialization of a variable

Steps to reproduce

error.zip

unit UFormErrorTest;

{$mode ObjFPC}{$H+}

interface

uses
  Forms, Types;

type
  TForm1 = class(TForm)
  private
  public
  end;

var
  Form1: TForm1;

type
  TBuffer = packed record
    Mask: Int64;     
    DataArray: TObjectDynArray;
  end;

var
  GlobalBuffer: TBuffer;

implementation

{$R *.lfm}

initialization  
  GlobalBuffer := Default(TBuffer);

end.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information