#1 2024-03-22 15:07:19

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

Issue: TSynLogFileView.Select

mORMot2, Commit 7264 (fedb2ee), Delphi 12, 32Bit
Unit mormot.core.log

Line 7756 should be changed. It should be checked that (fThreads[Index] > 0), otherwise the call to function GetBitPtr could run into nothing.

function TSynLogFileView.Select(aRow: integer): integer;
...
    for i := 0 to Count - 1 do
    begin
      if fLevels[i] in fEvents then
      begin
        if (fThreads = nil)
          or GetBitPtr(pointer(fThreadSelected), fThreads[i] - 1) then  // <-- here
        begin

With best regards
Thomas

Offline

#2 2024-03-22 15:29:16

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

Re: Issue: TSynLogFileView.Select

I don't see when fThreads[] could be = 0, unless the log file input is corrupted / was not generated by TSynLog.
Anyway, we should better be prepared for the worst. wink

Please try https://github.com/synopse/mORMot2/commit/6f368fe1

Offline

#3 2024-03-22 15:46:58

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

Re: Issue: TSynLogFileView.Select

ab wrote:

I don't see when fThreads[] could be = 0, unless the log file input is corrupted / was not generated by TSynLog.

If remote logging is used (TRestHttpsClient.CreateForRemoteLogging and LogView), this may be the case.

With best regards
Thomas

Offline

#4 2024-03-22 16:02:40

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

Re: Issue: TSynLogFileView.Select

Commit 7267 tested and it works. Thank you very much and have a nice weekend.

With best regards
Thomas

Offline

Board footer

Powered by FluxBB