openssh connection hangs upon shell exit

Claude Robitaille clauder at accedian.com
Mon Jun 23 00:32:38 EST 2014


I am using an openSSH server on a privately built distribution. I am can
login with an interactive session, use scp and everything is fine except
that when I exit the shell of an interactive session or when the copy
transfer terminates (scp), sshd hangs forever. The shell process is in the
zombie state, which indicates that the openssh process for the connection
has not checked the child status.

I understand that using a privately built distribution (distribution may be
not the adequate terms but I have no other) is most certainly the root
cause where some files, privileges, etc. is not set correctly. But I looked
everywhere, including the FAQ on opensssh.com and can not find any useful
guidance.

Any pointers for where to look? Using debug and strace does not help. I can
see 2 errors near the end but I am not sure they are real problem or
related to my issue. Here is the end of this trace (the write \r correspond
to the enter after exit):



write(6, "\r", 1)                       = 1
select(9, [3 4 8], [], NULL, NULL)      = 1 (in [8])
rt_sigprocmask(SIG_BLOCK, [CHLD], [TERM CHLD], 8) = 0
rt_sigprocmask(SIG_SETMASK, [TERM CHLD], NULL, 8) = 0
read(8, "\r\n", 16384)                  = 2
select(9, [3 4 8], [3], NULL, NULL)     = 2 (in [8], out [3])
rt_sigprocmask(SIG_BLOCK, [CHLD], [TERM CHLD], 8) = 0
rt_sigprocmask(SIG_SETMASK, [TERM CHLD], NULL, 8) = 0
read(8, 0x7fff2c252970, 16384)          = -1 EIO (Input/output error)
write(2, "debug2: channel 0: read<=0 rfd 8"..., 41debug2: channel 0:
read<=0 rfd 8 len -1
) = 41
write(2, "debug2: channel 0: read failed\r\n", 32debug2: channel 0: read
failed
) = 32
write(2, "debug2: channel 0: close_read\r\n", 31debug2: channel 0:
close_read
) = 31
close(8)                                = 0
write(2, "debug2: channel 0: input open ->"..., 40debug2: channel 0: input
open -> drain
) = 40
write(3,
"\317\21\213\233\355\n\244`V\264\211\212\307\313\313\213aX\307\324\235\260.H\345T\330_\247\271e\266"...,
48) = 48
write(2, "debug2: channel 0: ibuf empty\r\n", 31debug2: channel 0: ibuf
empty
) = 31
write(2, "debug2: channel 0: send eof\r\n", 29debug2: channel 0: send eof
) = 29
write(2, "debug2: channel 0: input drain -"..., 42debug2: channel 0: input
drain -> closed
) = 42
select(9, [3 4], [3], NULL, NULL)       = 1 (out [3])
rt_sigprocmask(SIG_BLOCK, [CHLD], [TERM CHLD], 8) = 0
rt_sigprocmask(SIG_SETMASK, [TERM CHLD], NULL, 8) = 0
write(3,
"\323m\346\231\252\2024\235\272,<@\325\220$q\231\356\321\37\34\272\ndj\377\332\311:?j\360",
32) = 32
select(9, [3 4], [], NULL, NULLExiting on signal 2
debug1: do_cleanup
debug1: session_pty_cleanup: session 0 release /dev/pts/0
syslogin_perform_logout: logout() returned an error



The read error on fd 8 is probably Ok since I suspect it is the pipe to the
shell, which terminated so an error here is probably normal (BTW, this
shell is busybox).

-- 


Avis de confidentialité

Les informations contenues dans le présent message et dans toute pièce qui 
lui est jointe sont confidentielles et peuvent être protégées par le secret 
professionnel. Ces informations sont à l’usage exclusif de son ou de ses 
destinataires. Si vous recevez ce message par erreur, veuillez s’il vous 
plait communiquer immédiatement avec l’expéditeur et en détruire tout 
exemplaire. De plus, il vous est strictement interdit de le divulguer, de 
le distribuer ou de le reproduire sans l’autorisation de l’expéditeur. 
Merci.

Confidentiality notice

This e-mail message and any attachment hereto contain confidential 
information which may be privileged and which is intended for the exclusive 
use of its addressee(s). If you receive this message in error, please 
inform sender immediately and destroy any copy thereof. Furthermore, any 
disclosure, distribution or copying of this message and/or any attachment 
hereto without the consent of the sender is strictly prohibited. Thank you.


More information about the openssh-unix-dev mailing list