#1 2020-02-22 02:00:04

mikem2343@gmail.com
Member
Registered: 2020-02-22
Posts: 3

Access Violation when WithLog is defined

Hello,

I've just started using mORMot, and it was working fine, but all of a sudden I started getting access violations when opening the SQLite database and the program just quits.

If I turn off WithLog it works fine.  The problem seems to be that the Family class function in TSynLog is returning null, and not creating a Family.  I tried putting a breakpoint, but that class function never gets called.  Then when Family.SynLog gets called, the CreateSynLog fails because self is null.

Any help would be appreciated.

Thanks,
Mike

Offline

#2 2020-02-22 10:20:57

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

Re: Access Violation when WithLog is defined

What did you do to have TSynLog.Family returning nil?
What is the stack trace?

You need to have a class assigned to the log variable globals. Don't mess with putting nil in them, e.g. in SynSQLite3Log.
Just leave the default settings.
If you don't want to have any log, tune the levels set.

Offline

#3 2020-02-28 06:30:37

mikem2343@gmail.com
Member
Registered: 2020-02-22
Posts: 3

Re: Access Violation when WithLog is defined

Hello,

Thanks for your quick reply.  I've been really busy this week.

I'm not sure what I could have done to have TSynLog.Family return nil.  I was just describing what was happening.  I'm not I did not mess with any of the settings and I am not setting anything to nil. They were all left at the default settings.

The problem happens in the second line of TSynLog.Enter.  Family.Synlog does not seem to be returning a valid value and on the next line and AV is raised.

Here is the call stack:
SynLog.TSynLog.Enter('DBOpen %',(...),$2F6E800)
SynSQLite3.TSQLDatabase.DBOpen
SynSQLite3.TSQLDatabase.Create('<PathToDB>Database..DB','',0,10000,4096)
mORMotSQLite3.TSQLRestServerDB.Create($2F25880,'<PathToDB>Database..DB',False,'',10000,4096)
mORMotSQLite3.TSQLRestServerDB.CreateWithOwnModel((...),'<PathToDB>Database..DB',False,'root','',10000,4096)
uOrmServer.TORMServer.CreateServer('<PathToDB>Database.DB')
uOrmServer.TORMServer.SetDirectory('<PathToDB>')
uOrmServer.TORMServer.CreateWithDirectory($2E71520,'<PathToDB>')


Thanks,
Mike

Offline

#4 2020-02-28 09:25:40

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

Re: Access Violation when WithLog is defined

Which version of Delphi are you using?

Offline

#5 2020-02-28 16:03:47

mikem2343@gmail.com
Member
Registered: 2020-02-22
Posts: 3

Re: Access Violation when WithLog is defined

Delphi 10.3 Update 2

Offline

Board footer

Powered by FluxBB