Initial discovery
I had a file "404.html" open in Notepad++, from directory on the remote server, when the university VPN connection was reset and the connection failed. I tried reconnecting 2 times until I noticed, then cancelled the reconnection attempts, while reconnecting to the VPN. Then I started a new session and tried saving the file I had still open in Notepad++.
WinSCP showed me a prompt that it could reconnect the old session to save the file (even though I was currently in a session), and when I confirmed the program crashed.
Reproduction steps:
I am able to reproduce it, here are the steps in short format I follwed:
- Connect to VPN that allows you to access a server that you otherwise can't
- Start an SFTP session to a server and login
- Open a file on it in a text edito, edit something but DONT save. This is
not dependent on the editor, I tried with both Notepad++ and Windows Notepad.
- Disconnect the VPN while the session is running.
- WinSCP will complain. Click on Reconnect, and you can just cancel the reconnect immediately by clicking on the X.
- Now, reconnect the VPN that allows you to access the server, and then start a new session to it using WinSCP.
- Nothing special will happen first. Now switch back to Notepad++, and save the file there.
- WinSCP will open a dialogue "Dou you want to reconnect session <NAME> to upload edited file 404.html?". Click on OK.
[img]
-> It will crash with "Invalid access to memory"
Thoughts
I believe the important step here is trying to reconnect and then aborting the reconnect using X, because when just accepting that the connection was lost with OK the crash did not happen.
Please also note, that one time these proceedings gave me another error
"Invalid access to memory - TSessionData::GetNameWithoutHiddenPrefix"
instead, but after that I could only reproduce the
"List index out of bounds(-1)"
thingy.
WinSCP 6.1.2
Error message:
List index out of bounds (-1)
Stack trace:
(001FC4A0) System::Classes::TStringList::Get
(001FC4A0) System::Classes::TStringList::Get
(000BE84C) TTerminalManager::SetActiveTerminalWithAutoReconnect
(00080B56) TEditorManager::CheckFileChange
(0007DF86) TEditorManager::Check
(0001B8BD) TCustomScpExplorerForm::Idle
(00053267) TNonVisualDataModule::DoIdle
(00053224) TNonVisualDataModule::SessionIdleTimerTimer
(0021564C) System::Classes::_18201
(0003FF49) USER32.dll
(00036EF5) USER32.dll
(00034C65) USER32.dll
(00034A2B) USER32.dll.DispatchMessageW
(01004455) C6083_0
(01005A2F) _ReThrowException
(00080DB8) TEditorManager::CheckFileChange
(0007DF86) TEditorManager::Check
(0001B8BD) TCustomScpExplorerForm::Idle
(00053267) TNonVisualDataModule::DoIdle
(00053224) TNonVisualDataModule::SessionIdleTimerTimer
(0021564C) System::Classes::_18201
(0003FF49) USER32.dll
(00036EF5) USER32.dll
(00034C65) USER32.dll
(00034A2B) USER32.dll.DispatchMessageW
I know how to reproduce the problem or the problem happens frequently enough. I wish to be contacted by the WinSCP team to help resolving the problem.