Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - SSH process launched becomes zombie and sftp session remains blocked...: (3 Items)
   
SSH process launched becomes zombie and sftp session remains blocked...  
We have multithreaded application, one of the application thread used sftp for file transfer...so it launches a "sh" 
process, which inturn launches a "sftp" process and "sftp" inturn launches a "ssh" process for communication. 

The application thread calls popen() with the following command string. 
sftp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -oNumberOfPasswordPrompts=0 -oPort=22 -oIdentityFile=FILE. 
ssh.prv userID@IP 

After it successfully launches the above commad, we see 3 processes in a normal working scenario. 

388177965 proc/boot/sh 
388177967 usr/local/bin/sftp 
388182064 usr/local/bin/ssh 

In the scenario, where we see the ssh process becomes zombie we see the following 

388177965 proc/boot/sh SIGSUSPEND 
388177967 usr/local/bin/sftp REPLY (PIPE process) 
388182064 (Zombie) 

and the application thread is
335899 App appThread reply 1 

We want to know why would the ssh process becomes zombie and this is not handled by the SFTP process that has launched 
it?? Does any network error can cause the ssh process die abruptly and make sftp unaware of it??

any help????
Re: SSH process launched becomes zombie and sftp session remains blocked...  
On Thu, Feb 25, 2010 at 07:33:53AM -0500, Aji M P wrote:
> We have multithreaded application, one of the application thread used sftp for file transfer...so it launches a "sh" 
process, which inturn launches a "sftp" process and "sftp" inturn launches a "ssh" process for communication. 
> 
> The application thread calls popen() with the following command string. 
> sftp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -oNumberOfPasswordPrompts=0 -oPort=22 -oIdentityFile=FILE.
 
> ssh.prv userID@IP 
> 
> After it successfully launches the above commad, we see 3 processes in a normal working scenario. 
> 
> 388177965 proc/boot/sh 
> 388177967 usr/local/bin/sftp 
> 388182064 usr/local/bin/ssh 
> 
> In the scenario, where we see the ssh process becomes zombie we see the following 
> 
> 388177965 proc/boot/sh SIGSUSPEND 
> 388177967 usr/local/bin/sftp REPLY (PIPE process) 
> 388182064 (Zombie) 
> 
> and the application thread is
> 335899 App appThread reply 1 
> 
> We want to know why would the ssh process becomes zombie and this is not handled by the SFTP process that has launched
 it?? Does any network error can cause the ssh process die abruptly and make sftp unaware of it??
> 

What's the server end?  What version of QNX are you running?
This sounds like it may be an issue that was fixed in 6.4.1.
If you can reproduce it with released binaries we can take a
look at it but it's hard to guess what might be going on
with /usr/local/*

Regards,

-seanb
Re: SSH process launched becomes zombie and sftp session remains blocked...  
Our QNX version is 6.3.2

We tested today slightly different way. 
1. From QNX command line, we ran the follwoing sftp command
"sftp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -oNumberOfPasswordPrompts=0 -oPort=22 -oIdentityFile=
privKey.ssh.prv login@remoteIP"

2. We see the following processes when we do pidin -faA
28151843 sftp -oPasswordAuthentication=no -oStrictHostKeyChecking=no -oNumberOfPasswordPrompts=0 -oPort=22 -
oIdentityFile=privKey.ssh.prv login@remoteIP
28155947 /usr/local/bin/ssh -oForwardX11 no -oForwardAgent no -oPermitLocalCommand no -oClearAllForwardings yes -
oPasswordAuthentication=no -oStrictHostKeyChecking=no -oNumberOfPasswordPrompts=0 -oPort=22 -oIdentityFile=privKey.ssh.
prv -l<login> -oProtocol 2 -s <remoteIP> sftp

3. Our remote server is a  linux PC 
uname -a  
"Linux LINUX01 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 i686 i686 i386 GNU/Linux"

4. When sftp client from QNX connects to this Linux PC, we see the following process on Linux side.
"/usr/libexec/openssh/sftp-server"

5. Now, when we kill the above mentioned process on linux PC, we see the process with ID "28155947 "(ssh process 
launched by sftp command) as zombie on QNX side.
6. This state remains forever until I execute a remote commands like "ls","cd", etc.

Any help regarding this problem is highly appreciated.