Atozed Forums
AV on FinalizeDataOperations - Delphi5 - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Indy (https://www.atozed.com/forums/forum-8.html)
+--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html)
+--- Thread: AV on FinalizeDataOperations - Delphi5 (/thread-796.html)



AV on FinalizeDataOperations - Delphi5 - GrahamRola - 10-31-2018

Delphi 5
Indy 10 5473

I call List in ftp component and it returns the appropriate data.
when the FinalizeDataOperation; is called I get an AV read of address 0xea5278ed.
I Put a breakpoint at the begin of GetResponse and looked at
the call stack (shown below);

What could possible be causing the AEncoding to be anything other
than Nil?  

Couple of other things of note.
When I place mouse over AAAllowedResponses   it only shows  (226) not ([226, 225, 250]);
There are 9 calls to GetResponse before this final call that all show Nil in AEncoding


Code:
procedure TIdFTP.FinalizeDataOperation;
...
  end else begin
    //ftp.marist.edu returns 250
    GetResponse([226, 225, 250]);  // call that generates AV
  end;
end;



Code:
function TIdTCPConnection.GetResponse(const AAllowedResponses: array of Int16;
 AEncoding: IIdTextEncoding = nil): Int16;
begin  // break point inserted here
  GetInternalResponse(AEncoding);
  Result := CheckResponse(LastCmdResult.NumericCode, AAllowedResponses);
end;


Call Stack
TIdTCPConnection.GetResponse((...),Pointer($55E4E3) as IIdTextEncoding)


RE: AV on FinalizeDataOperations - Delphi5 - rlebeau - 10-31-2018

(10-31-2018, 01:44 PM)GrahamRola Wrote: Delphi 5
Indy 10 5473

There are known issues with Delphi 5's compiler outputting bad codegen that corrupts the call stack in various areas of Indy, including in TIdFTP (the compiler was fixed in Delphi 6). Contact me privately, I have a workaround available for Delphi 5 that is not checked in to the public source control repositories.