2.9p?: connection hangs with agent forwarding

Lutz Jaenicke Lutz.Jaenicke at aet.TU-Cottbus.DE
Wed Jul 4 01:46:09 EST 2001


Hi!

when using agent forwarding, the connection hangs on exit, if the agent has
been accessed.
Symptoms:
- On the client side, when the agent is accessed, the following output
  is being logged:
debug1: channel 1: new [authentication agent connection]
debug1: confirm auth-agent at openssh.com
debug1: channel 1: rcvd eof
debug1: channel 1: output open -> drain
debug1: channel 1: obuf empty
debug1: channel 1: output drain -> closed
debug1: channel 1: close_write
- On the server side, the following steps are logged:
debug1: channel 3: new [accepted auth socket]
debug1: channel 3: open confirm rwindow 4096 rmax 32768
debug1: channel 3: read<=0 rfd 11 len 0
debug1: channel 3: read failed
debug1: channel 3: input open -> drain
debug1: channel 3: close_read
debug1: channel 3: ibuf empty
debug1: channel 3: input drain -> closed
debug1: channel 3: send eof

This seems to be consistent by itself, however the channel doesn't seem
to be closed. When the session is shutdown (type "exit" in shell),
it is hanging:
- Server:
...
debug1: channel 0: is dead
debug1: channel_free: channel 0: server-session, nchannels 4
- Client:
debug1: channel_free: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i8/0 o128/0 fd -1/-1)
  #1 authentication agent connection (t4 r3 i1/0 o128/0 fd 7/7)

debug1: channel_free: channel 0: dettaching channel user
^CKilled by signal 2.
debug1: Calling cleanup 0x4000f70a(0x0)
debug1: Calling cleanup 0x4000f892(0x0)

Only when the client is shutdown with ^C, the connection will be closed
as seen.
Server:
Connection closed by remote host.
debug1: channel_free: channel 1: X11 inet listener, nchannels 3
debug1: channel_free: channel 2: auth socket, nchannels 2
debug1: channel_free: channel 3: accepted auth socket, nchannels 1
debug1: session_have_children: no more children
debug1: temporarily_use_uid: 11019/11000 (e=0)
debug1: restore_uid
Closing connection to 127.0.0.1

The platform is HP-UX 10.20 (hanging on "sleep 20 &" test, maybe this is
related!?).
This is true with 2.9p1 (and older versions, if memory serves me right)
up to the latest portable-CVS.
I can fire up the debugger to help track it down, but by digging through
the source I didn't find, who should close the channel (server or client).
Shooting into the dark: HP-UX 10.20 needs USE_PIPES and must call close(),
as shutdown() in just one direction does seem to work as on other
platforms (see serverloop.c).

Best regards,
	Lutz
-- 
Lutz Jaenicke                             Lutz.Jaenicke at aet.TU-Cottbus.DE
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153



More information about the openssh-unix-dev mailing list