Delphi 12, 10.0.0.1571 Data Abstract - stream read error in 64 bit app, 32 bit ok

I know it is very very early with D12…

  1. I have an app that “works” when compiled in 32 or 64 bit in Delphi 11.3
  2. I am only in test mode for D12 (adding components and spot testing apps)
    -I copied the source code to my D12 environment and compiles for 32 and 64 bit.
    When I do a table ‘open’ in the 64 bit app the app generates a stream read error and closes with runtime error 216.
    I am doing more testing.

There is more to the issue than simply opening the table. There are master-detail tables and the master table has events associated with on before and on after activity.
recap = ok for 32 bit

raised exception class EROUnknownExceptionReceivedFromServer with message ‘Stream read error’.

HTH

Hi,

thanks for letting us know about this. While w have done a good amount of testing with Delphi 12 during the beta, and in dont believe we’re aware of this issue, I just wanted to for the record state that the current public build has not been tested or approved for D12.

We’ll have a new preview build with official D12 support out early next week. Now, whether this addresses/covers this issue or not I cannot say yet, but my colleague will have a look on Monday.

Does this issue show only with your specific app or also with, say, one of the sample/demo apps? From the message it sounds like the server receives a bad stream (ie bad incoming data) from the client side (and then sends this exception back – successfully, I might add). Is there any chance you could (a) provide a full stack race for the exception, server side, and (b) maybe add some debug logging to print out what data it does receive?

thanx,
marc

You can duplicate the issue with the sample DA applications:
PCTradeOffice for the client
and
DAServer for the server.

If the PCTradeOffice is 32 bit it “works”. When compiled for 64 bit the same error -stream read error-

Thanks for getting back, Hope this helps
rgds

1 Like

Excellent, thanx! that should make it easy for my college to reproduce this Monday!

Logged as bugs://D19395.

bugs://D19395 was closed as fixed.

Hi,

update uDAMemDataset.pas as

  TDABlobStream = class(TMemoryStream)
...
    {$IFDEF DELPHI29UP}
    function Read(var Buffer; Count: TNativeCount): TNativeCount; override;
    function Write(const Buffer; Count: TNativeCount): TNativeCount; override;
    {$ELSE}
    function Read(var Buffer; Count: Longint): Longint; override;
    function Write(const Buffer; Count: Longint): Longint; override;
    {$ENDIF}
...
{$IFDEF DELPHI29UP}
function TDABlobStream.Read(var Buffer; Count: TNativeCount): TNativeCount;
{$ELSE}
function TDABlobStream.Read(var Buffer; Count: Longint): Longint;
{$ENDIF}
...
{$IFDEF DELPHI29UP}
function TDABlobStream.Write(const Buffer; Count: TNativeCount): TNativeCount;
{$ELSE}
function TDABlobStream.Write(const Buffer; Count: Longint): Longint;
{$ENDIF}
1 Like

THANKS!
I will wait for the next release. I am not 100% sure about the code snippet.
Best regards!

Hi,

you should look for Longint version -

    function Read(var Buffer; Count: Longint): Longint; override;
    function Write(const Buffer; Count: Longint): Longint; override;

and replace it with

    {$IFDEF DELPHI29UP}
    function Read(var Buffer; Count: TNativeCount): TNativeCount; override;
    function Write(const Buffer; Count: TNativeCount): TNativeCount; override;
    {$ELSE}
    function Read(var Buffer; Count: Longint): Longint; override;
    function Write(const Buffer; Count: Longint): Longint; override;
    {$ENDIF}

also do similar changes in implementation section

RemObjects Data Abstract for Delphi, Server Edition - 10.0.0.1573 solves the issue…
Thank you team

1 Like