#1 2023-02-24 12:27:06

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

map use in linux compiled with fpc

Usually I write and debug in Delphi (windows) and after that I compile in FPC for Linux.
I am having an exception when compiled in Linux by FPC in an interface method and the result (TServiceCustomAnswer) is not returned to the client (try except end inside the interface method is used, nothing caught)
The exception error in the log with the following line of the exception:

20230224 12215901  % EXCOS      EAccessViolation (416a31) [R1pchrdv1pchrdv0] at

How a mab is created on linux compiled with FPC?  With windows I am using a sample from Tsynlog in mormot1

Offline

#2 2023-02-24 17:13:55

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

Re: map use in linux compiled with fpc

Include the DWARF 2 or DWARF 3 debug information to your project options in FPC/Lazarus.
mormot.core.log will parse it and retrieve the stack trace.

Offline

#3 2023-02-25 06:55:02

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

Re: map use in linux compiled with fpc

I have the following settings in project's properties:

Compilation and Linking:
Optimization Level 0
Nothing else checked

Debugging:
Generate info for the debugger: I tried both Dwarf2 and Dwarf3
Display line numbers checked
Use Heaptrc unit checked

Custom options
-Xm

I am still getting no more info in debug file
What else should I do to enable it?
Thank you in advance

Offline

#4 2023-02-25 10:45:56

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

Re: map use in linux compiled with fpc

I give up.... All other methods in the same interface work. I tried to rename it without any change

  TRestSys = class(TInjectableObjectRest, IRestSys)
  public
    function nicupdate(const hostname,ip4,ip6:RawUtf8):TServiceCustomAnswer;
  end;
....
function TRestSys.nicupdate(const hostname,ip4,ip6: RawUtf8): TServiceCustomAnswer;
begin Result.status:=200; result.header:=JSON_CONTENT_TYPE_HEADER; Result.content:='{"Hello": "there"}'; end; 
20230225 10383249  $  +    mormot.rest.memserver.TRestServerFullMemory(7f2a2912cf90).URI POST pchrd/v0/Restsys/nicupdate in=19 B
20230225 10383249  $ call       mormot.rest.memserver.TRestServerFullMemory(7f2a2912cf90) RestSys.nicupdate["ddd","ddd","ddd"]
20230225 10383249  $ EXCOS      EAccessViolation (416a41) [R1pchrdv1pchrdv0] at
20230225 10383254  $ debug      mormot.rest.memserver.TRestServerFullMemory(7f2a2912cf90) TRestServerRoutingRest.Error: {  "errorCode":500,  "error":  {"EAccessViolation":  {   "ClassName": "EAccessViolation",   "Address": "7f2a2790d400",   "Message": "Access violation"  }}  }
20230225 10383254  $ srvr         Interface POST pchrd/v0/Restsys/nicupdate=500 out=157 B in 86.10ms
20230225 10383254  $ ret        mormot.rest.server.TRestServerRoutingRest(7f2a266743d0) {  "errorCode":500,  "error":  {"EAccessViolation":  {   "ClassName": "EAccessViolation",   "Address": "7f2a2790d400",   "Message": "Access violation"  }}  }
20230225 10383254  $  -    00.086.132 

Offline

#5 2023-02-25 12:50:31

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

Re: map use in linux compiled with fpc

In nginx's logs I noticed now from my previous attempts where I used html content type that nginx has logged the following:

2023/02/25 12:05:40 [error] 289105#289105: *2 upstream sent invalid header: "text/html;\x20..." while reading response header from upstream, client: x.x.x.x, server: xxx.yyy.zzz, request: "POST /pchrd/v0/restsys/nicupdate HTTP/1.1", upstream: "http://127.0.0.1:10480/pchrd/v0/restsys/nicupdate", host: "xxx.yyy.zzz"

Offline

#6 2023-03-14 07:26:29

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

Re: map use in linux compiled with fpc

Offline

Board footer

Powered by FluxBB