Topic "Winscp.exe hangs after Winscp.com is closed"

Author Message
rmundkowsky
[View user's profile]

Joined: 2006-03-25
Posts: 6
Hi,

I use WinSCP with automated scripts. Winscp.exe somethings fails to close and then no more sessions of Winscp.exe can be run on the box (or at least under that user). The problem occurs intermittently. This problem has occurred with version 4.0.6 and even the 4.1.3 beta. It is not clear what happens that causes this. I have tried to create a monitor process to fix this problem, but Winscp forks or spawns and there is no way to get all of process ids.

I have noted that this problem is easy to replicate with a simple Perl script (note problem seems to occur 50% of the time this script is called. I tried /log and got no output.

O.k., so here Perl script the script file:

##script file named tt
## note this is designed to keep Winscp.exe up so it can be killed
option batch on
option batch abort
option confirm off
lcd c:\temp
lls

##Perl (ActivePerl 5.8.Cool control script
use Win32::Process;

$executable='c:\Program Files\WinSCP\WinSCP.com';
$Args='/console /script=tt /log=c:\temp\foo';
$Pid=0;

sub ErrorReport
{
print Win32::FormatMessage( Win32::GetLastError() );
}

Win32::Spawn( $executable, $Args, $Pid );

sleep 3;

Win32::Process::KillProcess($Pid, $exitcode) || die ErrorReport();
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
When you kill winscp.com, I would not expect that winscp.exe gets closed.
But from your post I've understood that winscp.exe does not close even if winscp.com closes regularly (e.g. using exit command). Is it correct?
_________________
Martin Prikryl
rmundkowsky
[View user's profile]

Joined: 2006-03-25
Posts: 6
Hi,

Not sure why this thread got closed. I think it is still an open question.

Anyways, yes the Winscp sometimes hangs when it is not killed. It is not clear if it hangs on exit or during a transfer. This problem only happens about 1 out of 100 times. I don't have any logs for this scenerio.

As for Winscp.exe not closing when Winscp.com is killed, hmm, that seems like a bug to me. I don't know how you spawn or fork Winscp.exe from Winscp.com, but proper behavior of anything started from Winscp.com is to exit when Winscp.com is killed. Think about it, if I use Winscp.com then I have the process ID for it and not for Winscp.exe. I should only have to kill the Winscp.com process. Right now I found a work around which is to kill the whole tree or at least all of the child processes I have, but this should not be required.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
rmundkowsky wrote:
Not sure why this thread got closed. I think it is still an open question.

The thread was never closed.

Quote:
Anyways, yes the Winscp sometimes hangs when it is not killed. It is not clear if it hangs on exit or during a transfer. This problem only happens about 1 out of 100 times. I don't have any logs for this scenerio.

Are you able to get the logs?

Quote:
As for Winscp.exe not closing when Winscp.com is killed, hmm, that seems like a bug to me. I don't know how you spawn or fork Winscp.exe from Winscp.com, but proper behavior of anything started from Winscp.com is to exit when Winscp.com is killed. Think about it, if I use Winscp.com then I have the process ID for it and not for Winscp.exe. I should only have to kill the Winscp.com process. Right now I found a work around which is to kill the whole tree or at least all of the child processes I have, but this should not be required.

I do not know if Windows support this mechanism at all, but I'll investigate and implement it, if possible. This issue has been added to tracker.
_________________
Martin Prikryl
rmundkowsky
[View user's profile]

Joined: 2006-03-25
Posts: 6
Thanks for your efforts.

>> Are you able to get the logs?

I'll try to get you a copy in the future when the error occurs again.

I was logging STDOUT (not /log) and if I remember correctly there was log showed either:
- Got to transfer step in script
- Log showed nothing, not even login to the server
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License