Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aplicativo fecha após erro não identificado no Windows 10 Pro versão 18363.900 #322

Closed
luizlobosysmo opened this issue Jun 16, 2020 · 4 comments

Comments

@luizlobosysmo
Copy link

Nossa empresa, Sysmo Sistemas, possui um aplicativo de frente de caixa o qual está se fechando após um processo de verificação de integridade da base de dados SQLite em alguns computadores com Windows 10 Pro versão 18363.900.

Código em Deplhi 6:

uses
  mORMot;

[...]

function TRgnSQLiteMaintenance.VerifyDatabaseIntegrity(AServerDatabase: TSQLRestServerDB): Boolean;
var
  oSQLTableJSON: TSQLTableJSON;
begin 
  try
    oSQLTableJSON := AServerDatabase.ExecuteList([], 'PRAGMA integrity_check');
    try
      Result := (oSQLTableJSON <> nil);

      if (Result) then
        Result := (LowerCase(String(oSQLTableJSON.GetS(1,0))) = 'ok');
    finally
      if (oSQLTableJSON <> nil) then
        FreeAndNil(oSQLTableJSON);
    end;
  except
    on E: Exception do
    begin
      Result := False;
      {$IFDEF VER140}
      if (Assigned(LogarErroGeral)) then
        LogarErroGeral('', 'TRgnSQLiteMaintenance.VerifyDatabaseIntegrity: Exception [' + E.Message + ']');
      {$ENDIF}
    end;
  end;
end;

Pelo que foi possível identificar pelos logs a aplicação se fechou quando executou o comando oSQLTableJSON.GetS(1,0).

Suspeitamos que ocorre alguma exceção no processo, mas não é gerada nehuma mensagem de erro e simplesmente fecha a aplicação.

Identificamos em alguns clientes com Windows 10 onde se caso dê alguma exceção no código e o mesmo não é tratado com try except a aplicação é fechada sem apresentar mensagem de erro.
Porém neste caso mesmo com o try except o erro persiste.

Não conseguimos simular internamente, somente em cliente.

Identificamos que em outros computadores com a mesma configuração e versão do Windows não acontece o problema.

Já foram adicionadas permissões de usuário para Controle total e colocado SSD, porém não obteve-se sucesso.

O erro registrado nos eventos do Windows foi:

Nome do Log:   Application
Fonte:         Application Error
Data:          11/06/2020 20:01:34
Identificação do Evento:1000
Categoria da Tarefa:(100)
Nível:         Erro
Palavras-chave:Clássico
Usuário:       N/D
Computador:    caixa01lj5
Descrição:
Nome do aplicativo com falha: pdv10.exe, versão: 3.9.20.3, carimbo de data/hora: 0x2a425e19
Nome do módulo com falha: unknown, versão: 0.0.0.0, carimbo de data/hora: 0x00000000
Código de exceção: 0xc0000005
Deslocamento da falha: 0x00000000
ID do processo com falha: 0xbe0
Hora de início do aplicativo com falha: 0x01d6402ff3dcb7b8
Caminho do aplicativo com falha: c:\pdv\pdv10.exe
Caminho do módulo com falha: unknown
ID do Relatório: 04ede662-fca9-47c6-bcc4-8882091f9ebe
Nome completo do pacote com falha: 
ID do aplicativo relativo ao pacote com falha: 
XML de Evento:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2020-06-11T23:01:34.725905000Z" />
    <EventRecordID>7199</EventRecordID>
    <Channel>Application</Channel>
    <Computer>caixa01lj5</Computer>
    <Security />
  </System>
  <EventData>
    <Data>pdv10.exe</Data>
    <Data>3.9.20.3</Data>
    <Data>2a425e19</Data>
    <Data>unknown</Data>
    <Data>0.0.0.0</Data>
    <Data>00000000</Data>
    <Data>c0000005</Data>
    <Data>00000000</Data>
    <Data>be0</Data>
    <Data>01d6402ff3dcb7b8</Data>
    <Data>c:\pdv\pdv10.exe</Data>
    <Data>unknown</Data>
    <Data>04ede662-fca9-47c6-bcc4-8882091f9ebe</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>
@synopse
Copy link
Owner

synopse commented Jun 16, 2020

Sorry, I don't understand your language.

@luizlobosysmo
Copy link
Author

Translation by Google Translate:

Our company, Sysmo Sistemas, has a cashier application which is closing after a process of verifying the integrity of the SQLite database on some computers with Windows 10 Pro version 18363.900.

Code in Deplhi 6:

uses
  mORMot;

[...]

function TRgnSQLiteMaintenance.VerifyDatabaseIntegrity(AServerDatabase: TSQLRestServerDB): Boolean;
var
  oSQLTableJSON: TSQLTableJSON;
begin 
  try
    oSQLTableJSON := AServerDatabase.ExecuteList([], 'PRAGMA integrity_check');
    try
      Result := (oSQLTableJSON <> nil);

      if (Result) then
        Result := (LowerCase(String(oSQLTableJSON.GetS(1,0))) = 'ok');
    finally
      if (oSQLTableJSON <> nil) then
        FreeAndNil(oSQLTableJSON);
    end;
  except
    on E: Exception do
    begin
      Result := False;
      {$IFDEF VER140}
      if (Assigned(LogarErroGeral)) then
        LogarErroGeral('', 'TRgnSQLiteMaintenance.VerifyDatabaseIntegrity: Exception [' + E.Message + ']');
      {$ENDIF}
    end;
  end;
end;

As far as it was possible to identify by the logs, the application closed when executing the command oSQLTableJSON.GetS (1,0).

We suspect that an exception occurs in the process, but no error message is generated and simply closes the application.

We have identified in some clients with Windows 10 where if there is any exception in the code and it is not treated with try except the application is closed without presenting an error message.
However, in this case, even with try except, the error persists.

We were unable to simulate internally, only on a client.

We found that on other computers with the same configuration and version of Windows the problem does not happen.

User permissions have already been added for Full Control and placed SSD, but it has not been successful.

The error recorded in Windows events was:

Log Name: Application
Source: Application Error
Date: 11/06/2020 20:01:34
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: classic
User: N / A
Computer: Caixa01lj5
Description:
Faulting application name: pdv10.exe, version: 3.9.20.3, timestamp: 0x2a425e19
Faulty module name: unknown, version: 0.0.0.0, timestamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00000000
Failed process ID: 0xbe0
Failed application start time: 0x01d6402ff3dcb7b8
Faulting application path: c: \ pdv \ pdv10.exe
Faulty module path: unknown
Report ID: 04ede662-fca9-47c6-bcc4-8882091f9ebe
Failed package full name:
Application ID for the failed package:
Event XML:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2020-06-11T23:01:34.725905000Z" />
    <EventRecordID>7199</EventRecordID>
    <Channel>Application</Channel>
    <Computer>caixa01lj5</Computer>
    <Security />
  </System>
  <EventData>
    <Data>pdv10.exe</Data>
    <Data>3.9.20.3</Data>
    <Data>2a425e19</Data>
    <Data>unknown</Data>
    <Data>0.0.0.0</Data>
    <Data>00000000</Data>
    <Data>c0000005</Data>
    <Data>00000000</Data>
    <Data>be0</Data>
    <Data>01d6402ff3dcb7b8</Data>
    <Data>c:\pdv\pdv10.exe</Data>
    <Data>unknown</Data>
    <Data>04ede662-fca9-47c6-bcc4-8882091f9ebe</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

@pavelmash
Copy link
Collaborator

It's impossible to identify a source of a problem from information you provide.

For tracking such "unexpected" errors on client side you can add SynLog.pas unit, enable "detailed map file information" in the project option, and enhance exception logging.
You should have the stack trace of all exceptions, in the .log text file.

But without any more context, it is not possible to give you more help.

@luizlobosysmo
Copy link
Author

This process has been removed and the problem continues.
It must be something related to Windows.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants