#1 2022-03-13 13:44:21

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Lazarus debug mode and error in mormot.core.json

I decided to give a try to FPC and lazarus as @ab favors them
I have working code in delphi and in FPC in release mode but not in debugging for FPC
In Compiler Option Debugging, I have:
Check and assertion group all ticked
Generate info for the debugger ticked (Dwarf with sets)
Display line numbers in run-time errors ticked
Use Heaprtc unit ticked
All others are unchecked
-MObjFPC, Lazarus 2.2.0 (rev lazarus_2_2_0-122-gb464aafe69) FPC 3.2.3 i386-win32-win32/win64

An unhandled exception occurred at $006B732A:
EInvalidCast: Invalid type cast
  $006B732A  SETPARSERTYPE,  line 9666 of ../../../../../DG/mORMot2/src/core/mormot.core.json.pas
  $004CE255  CREATE,  line 7328 of ../../../../../DG/mORMot2/src/core/mormot.core.rtti.pas
  $004CFBC1  DOREGISTER,  line 8096 of ../../../../../DG/mORMot2/src/core/mormot.core.rtti.pas
  $004CFC92  DOREGISTER,  line 8110 of ../../../../../DG/mORMot2/src/core/mormot.core.rtti.pas
  $004D0CFD  NEWINSTANCE,  line 8642 of ../../../../../DG/mORMot2/src/core/mormot.core.rtti.pas
  $004B980B  CREATEEX,  line 4373 of ../../../../../DG/mORMot2/src/core/mormot.core.data.pas
  $006BE229  GLOBALCRYPTALGOINIT,  line 4284 of ../../../../../DG/mORMot2/src/crypt/mormot.crypt.secure.pas
  $006BBB56  IMPLEMENTS,  line 3305 of ../../../../../DG/mORMot2/src/crypt/mormot.crypt.secure.pas
  $0073619D  INITIALIZEUNIT,  line 5338 of ../../../../../DG/mORMot2/src/crypt/mormot.crypt.ecc.pas
  $00736278  MORMOT.CRYPT.ECC_$$_init$,  line 5345 of ../../../../../DG/mORMot2/src/crypt/mormot.crypt.ecc.pas
  $0040ED44


An other problem I found is that LibLocation of mysql library dll is ignored when compiled in FPC (in Delphi it works)
I am using ZEOS 8.0-patches from marsupilami79 and Mormot2 from Github in both Delphi/FPC

Last edited by dcoun (2022-03-13 13:44:52)

Offline

#2 2022-03-14 07:32:16

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

Re: Lazarus debug mode and error in mormot.core.json

It may be a FPC bug.
Please try with stable FPC 3.2.0 or FPC 3.2.2.

I don't see this behavior with FPC 3.2.0.

Offline

#3 2022-03-14 08:47:23

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Lazarus debug mode and error in mormot.core.json

With Lazarus 2.2.0 (rev lazarus_2_2_0-0-g4d49533f10) FPC 3.2.2 i386-win32-win32/win64
It is compiled for the first time giving again the same error.

After that, without changes it can not be compiled and I am getting an error:
PCHRserver.lpr(52,1) Error: Undefined symbol: TC_$VARMAN_$$_itp_vardisp_calldesc$VARMAN$3

Varman is an wrapper unit having a class that has a variant and add/returns data using PDocVariantData and _safe(_v)^

I can not test it for linux in debug mode as I am running lazarus in windows.
It can not reproduced in your side, but are you using windows or Linux?
Should I forget fpc for windows (I already have Delphi 11 Pro) and use it only for Linux?

Concerning the ZEOS problem in linux can you reproduce the following?
My linux executable is searching for libmariadb.dll and I have tried to set the location with both ways:
a) myzurl:=TZURL.Create('zdbc:mysql://',server,port,db,rootuser,rootpass,zopts); with zopts to have "zopts.Add('LibLocation='+{$IFNDEF OSWINDOWS}'/usr/lib/x86_64-linux-gnu/libmariadb.so')"
b) myzurl.LibLocation

Thank you in advance

Offline

#4 2022-03-14 10:03:28

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

Re: Lazarus debug mode and error in mormot.core.json

I am not able to reproduce your problem.

How did you write PCHRserver.lpr?
Don't post the code here directly, but in a link -- e.g. on https://gist.github.com/

Offline

#5 2022-03-14 10:15:12

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Lazarus debug mode and error in mormot.core.json

Concerning ZEOS problem?

Offline

#6 2022-03-14 10:52:41

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

Re: Lazarus debug mode and error in mormot.core.json

If it is really a Zeos problem, you may ask on the Zeos forum.

Offline

#7 2022-03-14 11:09:36

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Lazarus debug mode and error in mormot.core.json

Thank you Arnauld, I though so about Zeos, so probably I should return back to 7.0 for the moment....
What exactly do you want to see from PCHRserver.lpr as is about 40 units. Do you wan to see the varman unit that it is in the Undefined symbol error message?

Offline

#8 2022-03-14 14:39:03

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

Re: Lazarus debug mode and error in mormot.core.json

I got the unit. Thanks!

Please see the comments I wrote in the gist.

Offline

Board footer

Powered by FluxBB