#1 2021-03-30 14:00:07

L_VV
Member
Registered: 2020-10-29
Posts: 38

AV after handling exception in intf.-based service when using TSynLog

I came across an error when using TSynLog and handling exception in the service:

There is a simple Lazarus/FPC console application under Linux, which implements interface-based rest service with one method.


If I add to the application to work with TSynLog

TSynLog.Family.Level := LOG_STACKTRACE + [sllInfo, sllServer];

and if an exception occurs in the service method processing the customer's request, then after correct handling of the exception, another exception (AV) will occur in the astrings.inc file.

If I comment out this line, the second exception does not occurs.


I created the simple reproducible test for this error, but I can not find a reason:
https://drive.google.com/file/d/1wtZEVJ … sp=sharing

Maybe I incorrectly use TSynLog?
But I just took this line from some example, and it works, the log is created.
And for some reason the described problem occurs.

Offline

#2 2021-03-30 18:07:38

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,549
Website

Re: AV after handling exception in intf.-based service when using TSynLog

IMHO Its help a lot if sources will be on github/gitlab as project or gist, this allows to read it from browser. I usually use tablet to read this forum and cant rwad a sample you provide, so cant help

Offline

#3 2021-03-30 18:58:11

L_VV
Member
Registered: 2020-10-29
Posts: 38

Re: AV after handling exception in intf.-based service when using TSynLog

Yes, I was also uncomfortable to upload files to google.disk  smile

I created a repository for tests with a project from this topic:

https://github.com/L-VV/fpc_tests.git 

Offline

#4 2021-03-30 19:49:22

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

Re: AV after handling exception in intf.-based service when using TSynLog

Which FPC revision are you using?

We currently tested and support FPC 3.2.0.

Offline

#5 2021-03-30 21:13:38

L_VV
Member
Registered: 2020-10-29
Posts: 38

Re: AV after handling exception in intf.-based service when using TSynLog

I checked this test example on Lazarus/FPC stable.

Yes, indeed, on this version the second exception does not occurs.
Then we can probably skip this error.

Thank you!

Offline

#6 2021-03-31 09:34:29

L_VV
Member
Registered: 2020-10-29
Posts: 38

Re: AV after handling exception in intf.-based service when using TSynLog

Good morning!

After today's update of mORMot2 to the trunk version, yesterday's second exception no longer occurs on the Lazarus / FPC trunk smile

Thank you very mach!

Offline

Board footer

Powered by FluxBB