You are not logged in.
Hi everyone,
I just upgraded my services to mORMot2. Actually there isn't any problem with my services when i build them with DEBUG compiler directive. But when i make a release build, timestamp raises an EXCEPTION_ACCESS_VIOLATION inside TRestRouter.Lookup.
Any ideas?
Offline
Ok, this happens with DEBUG build too. It works on my computer (surprise lol) which is win11, it raises same error with our server win2019 Server. I will test it with an empty sample and notify you. If anything comes up your mind, please share. Thanks.
Offline
Hi ab,
I tried setting root as 'app' but it's still the same. I am using Delphi 12.3, Version 29.0.55362.2017 and MongoDB 8 for database.
Offline
I found the source of the problem. This occurs when i register my interface-based api. This is how i register my interfaces:
var i, j : Integer;
SFS: TServiceFactoryServer;
begin
SFS := TServiceFactoryServer(ServiceDefine(TAdmin, IAdmin, sicPerSession, SERVICE_CONTRACT_NONE_EXPECTED));
SFS.ResultAsJSONObjectWithoutResult := True;
SFS.SetOptions([], [optErrorOnMissingParam]);
end;
Offline
It does not make much sense, because /timestamp is a method-based service which has nothing to do with interface-based services.
The regression tests are checking /timestamp together with interface based services.
Offline
FYI you can make code simpler with
with ServiceDefine(TAdmin, [IAdmin], sicPerSession, SERVICE_CONTRACT_NONE_EXPECTED) do
begin
ResultAsJSONObjectWithoutResult := True;
SetOptions([], [optErrorOnMissingParam])
end;
Offline
I know, there is nothing wrong with mORMot2, and tests passed successfully. Either way, at least i know where to look know and keep you guys informed. Thanks to you both..
Offline
Put a breakpoint in TRestServer.Uri and try to look and debug what is happening.
There may be some unexpected bug in mORMot 2 anyway, in some conditions - but they need to be identified.
Offline
New info, it seems it's related to windows version and/or regional settings.
Windows 11, Delphi 12.3, working.
Windows Server 2019 standard, Delphi 12.3, raises an error.
Offline
Your expression in the debug window seems wrong.
You need to write fOwner.fPublishedMethod or TRestServer(fOwner).fPublishedMethod.
Writing TRestServer(@fOwner) is plain wrong because fOwner is already a pointer.
Offline
When you write TRestServer(fOwner).fPublishedMethod, debug window return "Inaccessible value", that's why i use pointer to show you the difference between 2 computers.
Offline
I know, anyway still believe this error belongs to my previous implementation. with a sample project, it works fine. I will implement my business login step by step and see where the issue is. will inform you when i found something useful.
Offline
Alright, funny enough it fixed itself
Updated mORMot2 to today's commit, getting last 3 or 4 days of commits from repo.
Updated static libraries again to be sure.
Put "{$I mormot.defines.inc}" to every pas file.
I don't know which one is responsible, but for people who may encounter this error please try these steps first.
Thanks for your patience and support.
Offline