wuping
(wuping)
October 15, 2018, 9:31pm
1
Delphi XE5,
RO SDK version 9.4.109.1377 (the latest official release).
I have the following very simple test case to replicate the crash:
RoTest.zip (117.4 KB)
The RO Server crashes at the method call GetRemoteServiceStatus.
Debugging track shows that the crash happened at the following:
Any advice why this happens?
const
__ServiceName ='NewService';
type
TRemoteServerStatus = (arsNull, arsStarting, arsRunning, arsStopping,
arsReadyToStart);
TRemoteServiceReply = class(TROComplexType)
private
FCode: Integer;
FConnectionID: string;
FDetail: string;
published
property Code: Integer read FCode write FCode;
property ConnectionID: string read FConnectionID write FConnectionID;
property Detail: string read FDetail write FDetail;
end;
[ROService(__ServiceName)]
TNewService = class(TRORemoteDataModule)
public
[ROServiceMethod]
function GetRemoteServerStatus(aConnectionID: string; out aStatus:
TRemoteServerStatus): TRemoteServiceReply;
end;
implementation
function TNewService.GetRemoteServerStatus(aConnectionID: string; out aStatus:
TRemoteServerStatus): TRemoteServiceReply;
begin
Result := TRemoteServiceReply.Create;
Result.Code := 0;
Result.ConnectionID := aConnectionID;
Result.Detail := 'N/A';
end;
{%CLASSGROUP 'System.Classes.TPersistent'}
{$R *.dfm}
initialization
RegisterCodeFirstService(TNewService);
end.
EvgenyK
(Evgeny Karpov)
October 16, 2018, 8:43am
2
Hi,
I can’t reproduce this issue:
Can you retest this issue with latest beta, pls?
wuping
(wuping)
October 16, 2018, 11:41am
3
Thank you I will check the latest beta
One thing I like to mention: the crash seems happen with XE5 only. Tokyo 10.2.3 runs ok. I don’t know why. I will check with the latest beta
EvgenyK
(Evgeny Karpov)
October 16, 2018, 11:47am
4
hmm, I’ve tested with Tokyo 10.2.3. will recheck with XE5
Thanks, logged as bugs://81240
EvgenyK
(Evgeny Karpov)
October 16, 2018, 12:54pm
6
EMBT have introduced TArray.Copy<T>
in XE7, but their compiler didn’t raise any exception in XE5 that this method isn’t found
workaround: update TRORttiClientCache.GetProperties_OriginalSort
method (uRORTTISupport.pas
) as
old:
if Length(result) > 0 then
TArray.Copy<TRttiProperty>(result, lResult, Length(result));
new:
if Length(result) > 0 then begin
{$IFDEF DELPHIXE8UP}
TArray.Copy<TRttiProperty>(result, lResult, Length(result));
{$ELSE}
System.Move(Pointer(@result[0])^, Pointer(@lResult[0])^, Length(result) * SizeOf(TRttiProperty));
{$ENDIF}
end;
bugs://81240 got closed with status fixed.
wuping
(wuping)
October 16, 2018, 1:13pm
8
Thank you. Will this fix be included in a nightly build (or some quick beta release) that I can use immediately? I don’t want to touch the source code myself.
EvgenyK
(Evgeny Karpov)
October 16, 2018, 1:31pm
9
yes, this fix will be in weekly beta.
but you can apply it manually to sources if you want to test it immediately: