You are not logged in.
First of all, to say that altoug I've never use Mormot nor lazarus in production it looks great, my sincere thanks an admiration to ab and mormot community.
Im begining with mormot and Lazarus and I'm trying to run the sample project "14 - Interface based services" under windows 7 and windows 10 (NewPacal and Lazarus 2.1rc1 fpc 3.3.1) both tested and Mormot 1.8,
the project option TargetOS was specified linux processor x86_64 I change both to default and it seems to run
fine but when i close server pressing enter I get the exception 'External: SIGSEGV'
in line 1064 of mORMotHttpServer.pas.
procedure TSQLHttpServer.HttpThreadTerminate(Sender: TThread);
var i: integer;
begin
if self=nil then
exit;
fDBServersSafe.Enter;
try
for i := 0 to high(fDBServers) do
fDBServers[i].Server.EndCurrentThread(Sender);
finally
fDBServersSafe.Leave;
end;
end;
As In SynCommons IAutoLocker interface line 16509 says
// - warning: under FPC, you should assign its result to a local variable -
// see bug http://bugs.freepascal.org/view.php?id=26602
it seems this bug only affects IAutolocker.ProtectMethod but when if I replace de previos method for:
var i: integer;
Lock: IAutoLocker;
begin
if self=nil then
exit;
Lock:= fDBServersSafe;
Lock.Enter;
try
for i := 0 to high(fDBServers) do
fDBServers[i].Server.EndCurrentThread(Sender);
finally
Lock.Leave;
end;
end;
The exceptions disappears.
I'm I wrong or this bug is affecting IAutoLocker.Leave?
Should this be done in every occurrence of fDBServersSafe in TSQLHttpServer?
pardon my ignorance, but Is it advisable to use mormot/lazarus on windows in production or it should be use with delphi or under linux?
Thanks in advance.
Last edited by fravemel (2018-10-29 19:55:12)
Offline
We use mORMot + FPC on production for hosting high-performance Linux services.
And it works great!
See https://www.livemon.com
I never saw this problem.
It is pretty weird that fDBServersSafe is reset during this method call. It should not affect other occurences of fDBServersSafe for sure.
But on multi-threading, such weird things happens...
Perhaps a local variable could be used to let this work as expected, but I doubt this is the root cause of the problem.
Offline
Lazarus 2.1.0 r59308 FPC 3.3.1 x86_64-win64-win32/win64
Free Pascal Compiler version 3.3.1-r39946 [2018/10/16] for x86_64
and
Newpacal:
Lazarus 1.9.0 re61a6e98658a657348e26974b930483b8f2b87c2 FPC 3.1.1 x86_64-win64-win32/win64
Free Pascal Compiler version 3.1.1-r18972f561935ea1317692f81bbc5f476a8852a3f [2018/08/13] for x86_64
I isntalled them via fpcupdeluxe
In both cases I got the same exception.
Offline