#1 2022-04-26 11:48:10

Márcio Baroni
Member
From: Brasil
Registered: 2015-10-07
Posts: 27

Error after commit "fixed long-standing potential GPF in UpperCopy255"

Hello, after I updated the mORMot sources, I started getting the following error:

EORMBatchException {"Message":"TServidorApp.EngineBatchSend: Unknown @Licencas"}

The table is registered normally:

VirtualTableExternalRegister(fModelo, TSqlLicencas, fBD.Conexao, 'CLIFOR_LICENCAS');
fModelo.Props[TSqlLicencas].ExternalDB.MapField('ID', 'LIC_ID');


Going back to the commit works correctly.
This system has been in production for years.

Offline

#2 2022-04-26 12:19:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,959
Website

Re: Error after commit "fixed long-standing potential GPF in UpperCopy255"

mORMot 1 I guess?

Offline

#3 2022-04-26 12:23:20

Márcio Baroni
Member
From: Brasil
Registered: 2015-10-07
Posts: 27

Re: Error after commit "fixed long-standing potential GPF in UpperCopy255"

Yes, it is related to the excerpts below:

function TSQLModel.GetTableIndexPtr(SQLTableName: PUTF8Char): integer;
begin
  if (self<>nil) and (SQLTableName<>nil) then begin
    result := FastFindUpperPUTF8CharSorted( // O(log(n)) binary search
      pointer(fSortedTablesNameUpper),fTablesMax,SQLTableName,StrLen(SQLTableName));
    if result>=0 then
      result := fSortedTablesNameIndex[result];
  end else
    result := -1;
end;


function FastFindUpperPUTF8CharSorted(P: PPUTF8CharArray; R: PtrInt;
  Value: PUTF8Char; ValueLen: PtrInt): PtrInt;
var tmp: array[byte] of AnsiChar;
begin
  UpperCopy255Buf(@tmp,Value,ValueLen);
  result := FastFindPUTF8CharSorted(P,R,@tmp);
end;

Last edited by Márcio Baroni (2022-04-26 12:28:36)

Offline

#4 2022-04-26 12:35:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,959
Website

Re: Error after commit "fixed long-standing potential GPF in UpperCopy255"

I am not able to reproduce the issue.
See my test program https://github.com/synopse/mORMot2/commit/5973720f

Could you debug a little on your side and try to find out what is wrong in your case?

Offline

#5 2022-04-26 12:46:32

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,959
Website

Re: Error after commit "fixed long-standing potential GPF in UpperCopy255"

I think I have found the culprit.

Please try https://synopse.info/fossil/info/f64cd122ef

Sorry for the inconvenience, and thanks for the feedback.

Offline

#6 2022-04-26 12:55:52

Márcio Baroni
Member
From: Brasil
Registered: 2015-10-07
Posts: 27

Re: Error after commit "fixed long-standing potential GPF in UpperCopy255"

Thanks, working properly.

Offline

Board footer

Powered by FluxBB