#1 2023-08-15 13:55:07

tbo
Member
Registered: 2015-04-20
Posts: 354

mORMot source code is broken

Delphi 11.3
mORMot2, Commit 5750 (06ac0fe)

Source code that worked all the time can no longer be executed. The problem starts with this line:

var restServer: TRestServerDB := TRestServerDB.CreateWithOwnModel([TOrmItem], dbFileName, False);

When trying to open the SQLite database, the following execution is thrown immediately when calling the Add function:

function TSqlDataBase.DBOpen: integer;
...
begin
  log := fLog.Enter('DBOpen %', [fFileNameWithoutPath], self);
  
class function TSynLog.Enter(const TextFmt: RawUtf8; const TextArgs: array of const; aInstance: TObject): ISynLog;
...
begin
  log := Add;

Execption text:

ThreadId=11820
ProcessId=6
ThreadName="Main"
ExceptionMessage="Access violation at address 004B6641. Read of address 00000020"
ExceptionName="EAccessViolation"
ExceptionDisplayName="$C0000005"
ExceptionAddress=004B6641
LineNumber=4755

It can be prevented, for example, with:

initialization
  var logFamily: TSynLogFamily := TSynLog.Family;
  logFamily.Level := LOG_VERBOSE;

This behavior is new. I have tested it on a few older examples.

With best regards
Thomas

Offline

#2 2023-08-15 14:28:57

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

Re: mORMot source code is broken

This is indeed a regression.

Please try https://github.com/synopse/mORMot2/commit/628938ff

Offline

Board footer

Powered by FluxBB