Winscp.exe hangs after Winscp.com is closed

Winscp.exe hangs after Winscp.com is closed

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

Re: Winscp.exe hangs after Winscp.com is closed

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

Correct

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.

Re: Correct

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

The thread was never closed.

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?

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