Possible EAccessViolation in destructor of TScSFTPClient

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

Possible EAccessViolation in destructor of TScSFTPClient

Post by ajoschi » Tue 10 Apr 2018 15:52

Hi.

We are using TScSFTPClient in our Delphi application in order to download a file to local file system.
The used code looks like this:

Code: Select all

...
var
  lScSFTPClient: TScSFTPClient;
begin
  lScSFTPClient := TScSFTPClient.Create(nil);
  try
    lScSFTPClient.SSHClient := fScSSHClient;
    try
      lScSFTPClient.Initialize;
      lScSFTPClient.DownloadFile(pSource, pLocalPath, True);
    except
      on e: EScError do begin
        //Some exception handling here
      end;
    end;
  finally
    lScSFTPClient.Free;
  end;
end;
We have noticed that in some case, if an EScError is raised, calling the destructor of the TScSFTPClient (code line in finally-block) causes an EAccessViolation.

Here is the relevant part of the callstack of this EAccessViolation:

Code: Select all

exception class    : EAccessViolation
exception message  : Access violation at address 000000000040E305 in module 'Project.exe'. Read of address FFFFFFFFFFFFFFFF.
thread $3248:
0040e305 Project.exe   System                        TObject.Free
021de5c8 Project.exe   ScSFTPClient          631  +7 TScSFTPRequestInfo.Destroy
0040e305 Project.exe   System                        TObject.Free
020d602d Project.exe   ScTypes               647  +2 TCRObjectList.Notify
00541aff Project.exe   System.Classes                TList.SetCount
0054134d Project.exe   System.Classes                TList.Clear
005412be Project.exe   System.Classes                TList.Destroy
0040e305 Project.exe   System                        TObject.Free
021de813 Project.exe   ScSFTPClient          672  +4 TScSFTPClient.Destroy
0040e305 Project.exe   System                        TObject.Free
...
Additional Info:
SecureBridge v8.1.2
Delphi RAD Studio 10.2 (Release 3)
Applies to 32 and 64 bit builds

Is this a known issue?
Do you have any idea/fix for use?

Thx, Ajoschi!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Possible EAccessViolation in destructor of TScSFTPClient

Post by ViktorV » Wed 11 Apr 2018 07:18

Unfortunately, we cannot reproduce the issue on the latest version SecureBridge 8.1.3.
Please check whether the problem occurs on the latest version SecureBridge 8.1.3 and if yes, to investigate the specified SecureBridge behavior, please compose a full sample demonstrating the issue and send it to us via e-support form: https://www.devart.com/company/contactform.html

ajoschi
Posts: 15
Joined: Thu 14 Oct 2010 11:46

Re: Possible EAccessViolation in destructor of TScSFTPClient

Post by ajoschi » Wed 11 Apr 2018 12:05

Hi Viktor,

Thank you for your fast response!

I tried out v8.1.3 but got the same access violation.
I will try to extract code to a sample which shows this issue and send via e-support (might take some work, so don't expect this in the next few days)

Best regards,
Ajoschi

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Possible EAccessViolation in destructor of TScSFTPClient

Post by ViktorV » Fri 13 Apr 2018 06:44

Thank you for the interest in our products.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.

Post Reply