Invalid memory access after key exchange

Advertisement

tehffs
Joined:
Posts:
3

Invalid memory access after key exchange

Hello,

WinSCP Version : 5.13.3 build 8565

I'm doing a PowerShell script (so with WinSCPnet.dll) to upload 1.5GB files. The transfer fails around 1GB, with this error (full session log attached) and WinSCP hangs/crashes.
It works well with files < 1GB.

Is there a way to avoid key re-exchange?
. 2018-08-08 15:05:50.151 Initiating key re-exchange (too much data sent)
. 2018-08-08 15:05:50.697 Doing Diffie-Hellman group exchange
. 2018-08-08 15:05:50.713 Doing Diffie-Hellman key exchange with hash SHA-1
. 2018-08-08 15:05:52.032 Initialised AES-256 SDCTR client->server encryption
. 2018-08-08 15:05:52.032 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2018-08-08 15:05:55.125 expected key exchange reply packet from server
. 2018-08-08 15:05:55.125 Fatal error while disposing the SFTP queue.
. 2018-08-08 15:05:55.125 Connection was lost, asking what to do.
. 2018-08-08 15:05:55.125 Asking user:
. 2018-08-08 15:05:55.125 expected key exchange reply packet from server ()
< 2018-08-08 15:05:55.125 Script: expected key exchange reply packet from server
. 2018-08-08 15:06:00.266 Connection was lost, asking what to do.
. 2018-08-08 15:06:00.266 Asking user:
. 2018-08-08 15:06:00.266 Accès mémoire invalide. (translate : invalid memory access)
. 2018-08-08 15:06:00.266 
. 2018-08-08 15:06:00.266 Aidez-nous à améliorer WinSCP en rapportant l'erreur sur le forum de support de WinSCP. ("Trace de la pile :","(003EE310) System::SysFreeMem","(008BCA5A) C5104_0","(008BEAC2) ____ExceptionHandler","(008BB87C) __ExceptionHandler","(0003EF0E) ntdll.dll.ZwWow64CallFunction64","(0003F68A) ntdll.dll.KiUserExceptionDispatcher","(008AA413) ___org_free","(0063B31F) _safefree","(0063F09F) C2484_0","(0064FAD3) _sshfwd_x11_is_local","(0073752C) TSecureShell::FreeBackend","(007321FE) TSecureShell::Open","(0077CB37) TSFTPFileSystem::Open","(007B6C8B) TTerminal::Reopen","(007B90FD) TTerminal::QueryReopen","(007AFECD) TRobustOperationLoop::TryReopen","(007CF113) TTerminal::SourceRobust","(007CEF54) TTerminal::DoCopyToRemote","(007A04C2) TSFTPFileSystem::CopyToRemote","(007CE9B9) TTerminal::CopyToRemote","(00727F93) TScript::PutProc","(00722B3F) TScriptCommands::Execute","(00723F0E) TScript::Command","(0005601F) TConsoleRunner::Run","(0005C8B6) Console","(000E2042) Execute","(000024B4) wWinMain","(008BAA91) C4972_0","(00059D2D) ntdll.dll","(00059CF5) ntdll.dll",,"(008BD0C5) C5104_0","(008BE69F) _ReThrowException","(007B554D) TTerminal::Open","(007B6C8B) TTerminal::Reopen","(007B90FD) TTerminal::QueryReopen","(007AFECD) TRobustOperationLoop::TryReopen","(007CF113) TTerminal::SourceRobust","(007CEF54) TTerminal::DoCopyToRemote","(007A04C2) TSFTPFileSystem::CopyToRemote","(007CE9B9) TTerminal::CopyToRemote","(00727F93) TScript::PutProc","(00722B3F) TScriptCommands::Execute","(00723F0E) TScript::Command","(0005601F) TConsoleRunner::Run","(0005C8B6) Console","(000E2042) Execute","(000024B4) wWinMain","(008BAA91) C4972_0","(00059D2D) ntdll.dll","(00059CF5) ntdll.dll")
< 2018-08-08 15:06:00.266 Script: Accès mémoire invalide.
< 2018-08-08 15:06:00.266 Aidez-nous à améliorer WinSCP en rapportant l'erreur sur le forum de support de WinSCP.
< 2018-08-08 15:06:00.266 Script: Trace de la pile :
< 2018-08-08 15:06:00.266 (003EE310) System::SysFreeMem
< 2018-08-08 15:06:00.266 (008BCA5A) C5104_0
< 2018-08-08 15:06:00.266 (008BEAC2) ____ExceptionHandler
< 2018-08-08 15:06:00.266 (008BB87C) __ExceptionHandler
< 2018-08-08 15:06:00.266 (0003EF0E) ntdll.dll.ZwWow64CallFunction64
< 2018-08-08 15:06:00.266 (0003F68A) ntdll.dll.KiUserExceptionDispatcher
Thanks!
  • winscpreport.txt (15.9 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: Invalid memory access after key exchange

You can disable KEX initiated by client:
https://winscp.net/eng/docs/ui_login_kex

But you cannot prevent KEX initiated by server.

In any case, I'd rather prefer fixing the bug. Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Reply with quote

tehffs
Joined:
Posts:
3

Hello,
I just sent you an email.

Thank four the workaround for KEX, but is there any way to do this in the PowerShell code (maybe in SessionOptions)? I'm not using the GUI for this script.

Thanks

Reply with quote

tehffs
Joined:
Posts:
3

Ok thanks, so that was :
$sessionOptions.AddRawSettings("RekeyBytes", "0")
$sessionOptions.AddRawSettings("RekeyTime", "0")
For now it seems to be working.

Reply with quote

Advertisement

You can post new topics in this forum