kbmmemtable on linux lazarus 2.0.4

Home Forums kbmMemTable kbmmemtable on linux lazarus 2.0.4

Viewing 2 reply threads
  • Author
    Posts
    • #53982
      bpranoto
      Participant

      Hello,

      I just purchase kbmMemtable v.7.8.2.

      Installation on linux lazarus 64bits version 2.0.2 (fpc version 3.0.4) went smoothly. My o/s is ubuntu 18.04 64 bits

      Unfortunately, it fails on inserting record.

      Steps to demonstrate the problem:

      1. Create a new application
      2. Drop a kbmmemtable component to the form1
      3. Put this code on OnCreate event of the form:

      procedure TForm1.FormCreate(Sender: TObject);
      var
      F : TField;
      begin
      F := TStringField.Create( NIL);
      F.FieldName := ‘KODE’;
      F.DataSet := Self.kbmMemTable1;
      //
      Self.kbmMemTable1.CreateTable;
      Self.kbmMemTable1.Open;
      Self.kbmMemTable1.Insert;
      Self.kbmMemTable1.FieldByName( ‘KODE’).AsString := ‘XXXX’;
      Self.KbmMemTable1.Post;
      end;

      Run the application and it will fail with external:SIGSEGV

      Please help. Thank you

       

       

    • #53983
      bpranoto
      Participant

      The problem is on kbmmemtable.pas line 12870:

      DataEvent(deFieldChange, TkbmNativeInt(Field) );

      it seems the casting to TkbmNativeInt is not correct. If I change the line to:

      DataEvent(deFieldChange, int64(Field)  );

      the problem goes away.

      So the problem must be in the definition of TkbmNativeInt in KbmMemTypes.pas line 31:

       

      {$IFDEF LEVEL16}
      TkbmNativeInt = nativeint;
      TkbmNativeUInt = nativeuint;
      {$ELSE}
      TkbmNativeInt = integer;    <=== here
      TkbmNativeUInt = cardinal;
      {$ENDIF}

       

      What’s LEVEL16?

    • #53985
      kimbomadsen
      Keymaster

      Hi,

      Thank you for your bugreport and direction to the issue on your platform. I will have a look at it. LEVEL16 refers to Delphi version. What seems to be missing here, and why it didnt show as a problem in Lazarus 32 bit, is a test for FPC, in which case nativeint most likely always should be used.

      best regards

      Kim/C4D

Viewing 2 reply threads
  • You must be logged in to reply to this topic.