#1 2014-03-28 21:32:52

foncci
Member
Registered: 2013-11-15
Posts: 53

If you set compiler setting Emit RunTime Information you get this erro

Hi ab,

[dcc32 Error] SynCrypto.pas(651): E2217 Published field 'OriginalLen' not a class or interface type

Last nightly build

XE5

{$A-} { packed memory structure }
  /// internal header for storing our AES data with salt and CRC
  TAESFullHeader = object
    /// Len before compression (if any)
    OriginalLen,    <<<<<<<<<<<<<<<<<<<<<<<<< Error is here
    /// Len before AES encoding
    SourceLen,
    /// Random Salt for better encryption
    SomeSalt,
    /// CRC from header
    HeaderCheck: cardinal;
    function Calc(const Key; KeySize: cardinal): cardinal;
  end;
{$A+}

And I get this exception with or without the Runtime information setting. All with the last nightly build.

I just updated to the last nightly build and now I get this exception in the client

20140328 13545509 ERROR TSQLHttpClientWinHTTP(0327C960) POST SERV_INTEGRADOR/ServiceIntegrador.Consulta returned 500 Internal Server Error with message  {  "ErrorCode":500,  "ErrorText":"Exception EAccessViolation: Access violation at address 00713EF2 in module 'TestIntegrador.exe'. Read of address 00000500"  } stack trace API 0037B334 mORMot.TSQLRestClientURI.URI (22896) 003A13A7 mORMot.TServiceFactoryClient.InternalInvoke (35145) 003A1230 mORMot.TServiceFactoryClient.Invoke (35115) 00397474 mORMot.InternalProcess (32403) 00397D2E mORMot.TInterfacedObjectFake.FakeCall (32522)

After some tests I found that the exception is due to

  TServiceIntegrador = class(TInterfacedObject, IServiceIntegrador)
    public
      function  Consulta(aComando : string; var aNav : TConsultaNav) : string;
end

type
  TConsultaNav = record
   public
     MaxRows, Row0, RowCount : int64;
     IsSQLUpdateBack, EOF : boolean;

     function Init(aMaxRows : int64) : TConsultaNav;
     function InitNull : TConsultaNav;

     Procedure Next;
     function  ToSQL : string;
     function  IsNotNull : boolean;
     Procedure SetNull;
  end;

If I remove the record parameter the exception goes away, but it was working fine in the february version I was using. What have changed in mORMot?

Last edited by foncci (2014-03-28 22:02:26)

Offline

#2 2014-03-29 09:20:32

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

Re: If you set compiler setting Emit RunTime Information you get this erro

About TAesFullHeader, it was working fine with XE4.
Sounds like a weird XE5 compiler regression...
Please try http://synopse.info/fossil/info/affcdaf718

About record parameters in services, they are tested and validated in procedure TTestServiceOrientedArchitecture.Test() - in fact, in sub-procedure TestCalculator(const I: ICalculator).
AFAIR nothing has changed in mORMot about it.
What is the exact place of the EAccessViolation? What is the exception stack trace on the server side? What you supplied here is the client-side trace, which does not mean anything but an Access Violation on the server side...

Offline

#3 2014-03-30 04:21:35

foncci
Member
Registered: 2013-11-15
Posts: 53

Re: If you set compiler setting Emit RunTime Information you get this erro

Here you have,
  IServiceIntegrador = interface(IInvokable)
    function  Echo(const s : TConsultaNav) : TConsultaNav; <<<- This is a record
  end;

I made an small app that is client and server at the same time to get this error log as simple as possible.

20140329 21181227 EXCOS EAccessViolation (C0000005) at 0031328E SynCommons.RecordClear (23260)  stack trace 0033DFFC SynCrypto.TAES.EncryptInit (2109) 003B196C mORMotHttpServer.TSQLHttpServer.Request (570) 003A8B75 SynCrtSock.THttpServerGeneric.Request (1950) 003AA4F1 SynCrtSock.THttpServer.Process (2895) 003ABFAC SynCrtSock.THttpServerSocket.GetRequest (3396) 003AAE39 SynCrtSock.HandleRequestsProcess (3066) 003AAF78 SynCrtSock.THttpServerResp.Execute (3103) 000CB484 System.Classes.Classes.ThreadProc (14561) 0000A03E System.ThreadWrapper (23409) 
20140329 21181228 ERROR TSQLHttpClientWinHTTP(016BBFA0) POST SERV_INTEGRADOR/ServiceIntegrador.Echo returned 500 Internal Server Error with message  {  "ErrorCode":500,  "ErrorText":"Exception EAccessViolation: Access violation at address 0071428E in module 'TestIntegrador.exe'. Read of address 00000500"  } stack trace API 0037CA7C mORMot.TSQLRestClientURI.URI (22896) 003A2AEF mORMot.TServiceFactoryClient.InternalInvoke (35145) 003A2978 mORMot.TServiceFactoryClient.Invoke (35115) 00398BBC mORMot.InternalProcess (32403) 00399476 mORMot.TInterfacedObjectFake.FakeCall (32522) 
20140329 21181228 EXC   EInterfaceFactoryException ("Invalid fake IServiceIntegrador.Echo interface call: : {\r\n\"ErrorCode\":500,\r\n\"ErrorText\":\"Exception EAccessViolation: Access violation at address 0071428E in module 'TestIntegrador.exe'. Read of address 00000500\"\r\n}") at 0039894A mORMot.RaiseError (32344)  stack trace API 00330BF4 SynCommons.SynRtlUnwind (37232) 0000959C System.@HandleAnyException (18528) 0039894A mORMot.RaiseError (32344) 00398BCC mORMot.InternalProcess (32405) 00399476 mORMot.TInterfacedObjectFake.FakeCall (32522) 

Offline

#4 2014-03-30 12:33:29

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

Re: If you set compiler setting Emit RunTime Information you get this erro

With Delphi 7, I'm not able to compile your record type.
It was not allowed to define an interface with a method without RTTI: the compiler stops with the error:

Type 'TConsultNav' has no type info 

So I created a regression test according to your code (exclusively for newer Delphi versions)... and found an issue in our RecordClear() optimized asm version.
Should be fixed now by http://synopse.info/fossil/info/d54556a7d1

Thanks for the feedback.

Offline

Board footer

Powered by FluxBB