#1 2019-10-06 23:09:20

Hafedh TRIMECHE
Member
Registered: 2016-09-18
Posts: 37

SynCommons Exception Class External:SIGSEGV

Lazarus: 2.0.4
FPC: 3.3.1

Unit SynFPCTypInfo modified

procedure FPCDynArrayClear(var a: Pointer; TypeInfo: Pointer);external name 'FPC_DYNARRAY_CLEAR';
procedure FPCFinalizeArray(p: Pointer; TypeInfo: Pointer; elemCount: PtrUInt);external name 'FPC_FINALIZE_ARRAY';
procedure FPCFinalize(Data: Pointer; TypeInfo: Pointer);external name 'FPC_FINALIZE';
procedure FPCRecordCopy(const Source; var Dest; TypeInfo: pointer);external name 'FPC_COPY';
procedure FPCRecordAddRef(var Data; TypeInfo : pointer);external name 'FPC_ADDREF';

Running a program only containing SynCommons unit generated this exception:

Project BodetWS raised exception class 'External: SIGSEGV'.

In file '..\..\..\Developer\lib\mORMot\SynCommons.pas' at line 49337

The exception code:

fElemType := PTypeInfo(aTypeInfo)^.elType;
  if fElemType<>nil then begin
    {$ifndef HASDIRECTTYPEINFO}
    // FPC compatibility: if you have a GPF here at startup, your 3.1 trunk
    // revision seems older than June 2016
    // -> enable HASDIRECTTYPEINFO conditional below $ifdef VER3_1 in Synopse.inc
    // or in your project's options
    fElemType := PPointer(fElemType)^; // inlined DeRef()
    {$endif HASDIRECTTYPEINFO}
    {$ifdef FPC}
    if not (PTypeKind(fElemType)^ in tkManagedTypes) then
      fElemType := nil; // as with Delphi
    {$endif FPC}
  end;

Last edited by Hafedh TRIMECHE (2019-10-06 23:10:52)

Offline

#2 2019-10-07 07:29:16

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 211

Re: SynCommons Exception Class External:SIGSEGV

Which FPC revision? If you're using trunk then see the following thread

Offline

#3 2020-04-01 11:22:13

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: SynCommons Exception Class External:SIGSEGV

Has this been solved? I also get the same exception when running TestSQL3 in Lazarus 2.1.0 rev 62772 / FPC 3.3.1 in Win10.
If so, what is the solution for this issue?

Thanks.


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

#4 2020-04-01 12:41:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: SynCommons Exception Class External:SIGSEGV

Did you make what the comment just above the error said:

// FPC compatibility: if you have a GPF here at startup, your 3.1 trunk
    // revision seems older than June 2016
    // -> enable HASDIRECTTYPEINFO conditional below $ifdef VER3_1 in Synopse.inc
    // or in your project's options

Offline

#5 2020-04-01 13:05:34

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: SynCommons Exception Class External:SIGSEGV

since I am working with FPC 3.3.1 I assumed it FPC is newer than 3.1.1 and that it was not necessary to add HASDIRECTTYPEINFO.
Is this a wrong assumption / understanding?


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

#6 2020-04-01 14:59:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: SynCommons Exception Class External:SIGSEGV

Did you try it?

Offline

#7 2020-04-08 08:05:28

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: SynCommons Exception Class External:SIGSEGV

I changed  in Synopse.inc

FROM:
  {$ifdef VER3_1} // trunk before 3.2
    {$define ISFPC27}
    {$define ISFPC30}
    {.$define HASDIRECTTYPEINFO}
    // define this for trunk revisions older than June 2016 - see
    // http://wiki.freepascal.org/User_Changes … mat_change
  {$endif}

TO:
  {$ifdef VER3_1} // trunk before 3.2
    {$define ISFPC27}
    {$define ISFPC30}
    {$define HASDIRECTTYPEINFO}
    // define this for trunk revisions older than June 2016 - see
    // http://wiki.freepascal.org/User_Changes … mat_change
  {$endif}

Did a rebuild but still a SIGSEV in SynCommos line 50573: fElemType:=PPointer(fElemType)^;


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

#8 2020-04-08 10:57:15

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: SynCommons Exception Class External:SIGSEGV

If you are using latest trunk, you need to enable this also:
{$define FPC_PROVIDE_ATTR_TABLE}

Offline

#9 2020-04-08 12:10:05

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: SynCommons Exception Class External:SIGSEGV

Just saw this post: https://synopse.info/forum/viewtopic.php?id=5361
So I decided to go with latest fpcupdeluxe and selected FPC fixes3.2 and Lazarus fixes2.0.
TestSQL3 passed with some errors. At least no SIGSEV's this time :-)


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

Board footer

Powered by FluxBB