fds closed after SIGCHLD bug still in newest version

Florian Wunderlich fwunderlich at devbrain.de
Thu Nov 23 10:01:52 EST 2000


Attached is the stderr output of

    ssh -v -v -v faxdial "dd if=/dev/zero bs=1c count=1000" 2> log1 | wc
-c

which leads to

    423 (this time, it varies)

on stdout, which should obviously be


    1000

instead.


Markus Friedl wrote:
> 
> could you please try with 'ssh -v'
> 
> i cannot reproduce this on openbsd.
> 
> post the results to openssh-unix-dev at mindrot.org, please.
> 
> -markus
> 
> On Wed, Nov 22, 2000 at 02:44:17PM +0100, Florian Wunderlich wrote:
> > Markus Friedl wrote:
> > >
> > > are you using protocol 1 or 2?  how big is the tar file?
> >
> > Protocol 2, although I do not think this make a difference.
> >
> > The smallest tar locally created was just 64k (exactly, 65535c), where
> > it should be around 80k. The size of the file that is locally created
> > varies randomly; most often it is around 72k. A better check for the
> > actual size is probably this:
> >
> > main:~$ dd if=/dev/zero bs=1c count=1000 | wc -c
> > 1000+0 records in
> > 1000+0 records out
> >    1000
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=1000" | wc -c
> >     436
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=1000" | wc -c
> >     184
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=1000" | wc -c
> >     181
> >
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=200" | wc -c
> > 200+0 records in
> > 200+0 records out
> >     200
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=200" | wc -c
> >     176
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=200" | wc -c
> >     181
> > main:~$ ssh faxdial "dd if=/dev/zero bs=1c count=200" | wc -c
> > 200+0 records in
> > 200+0 records out
> >     200
> >
> > This is at home, where I also have Linux, and the same thing happens.
> >
> > main:~$ uname -r ; ssh faxdial uname -r
> > 2.2.17
> > 2.2.17
> >
> > > is it between two openssh versions? what operating systems?
> >
> > yes, both times the newest portable version, OpenSSH_2.3.0p1, on
> > Linux-2.2.x.
> >
> > > is USE_PIPE defined?
> >
> > USE_PIPES, with an S at the end, I assume.
> > After configure, no.
> > I defined it manually after having a quick look at the source, in
> > config.h, but it didn't make a difference. Just to check, I inserted a
> > #error in a #ifdef USE_PIPES block, and it showed up, so it really was
> > defined.
> >
> > > -m
> > >
> > > On Tue, Nov 21, 2000 at 07:45:24PM +0100, Florian Wunderlich wrote:
> > > > A bug which leads to exactly the same behaviour as described in
> > > >
> > > >     http://marc.theaimsgroup.com/?l=secure-shell&m=95451481631163&w=2
> > > >
> > > > still occurs in OpenSSH_2.3.0p1.
> > > >
> > > > For example, when doing
> > > >
> > > >     ssh somehost "tar cf - /usr/var" | tar tf -
> > > >
> > > > I get some data, and then "tar: Unexpected EOF on archive file".
> > > >
> > > > When I do
> > > >
> > > >     ssh somehost "tar cf - /usr/var ; sleep 1" | tar tf -
> > > >
> > > > it works fine.
> > > >
-------------- next part --------------
SSH Version OpenSSH_2.3.0p1, protocol versions 1.5/2.0.
Compiled with SSL (0x0090600f).
debug: Reading configuration data /etc/openssh/ssh_config
debug: Seeding random number generator
debug: ssh_connect: getuid 500 geteuid 0 anon 0
debug: Connecting to faxdial [192.168.1.1] port 22.
debug: Seeding random number generator
debug: Allocated local port 959.
debug: Connection established.
debug: Remote protocol version 2.0, remote software version OpenSSH_2.3.0p1
debug: no match: OpenSSH_2.3.0p1
Enabling compatibility mode for protocol 2.0
debug: Local version string SSH-2.0-OpenSSH_2.3.0p1
debug: send KEXINIT
debug: done
debug: wait KEXINIT
debug: got kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug: got kexinit: ssh-dss
debug: got kexinit: 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc at lysator.liu.se
debug: got kexinit: 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc at lysator.liu.se
debug: got kexinit: hmac-sha1,hmac-md5,hmac-ripemd160 at openssh.com
debug: got kexinit: hmac-sha1,hmac-md5,hmac-ripemd160 at openssh.com
debug: got kexinit: none,zlib
debug: got kexinit: none,zlib
debug: got kexinit: 
debug: got kexinit: 
debug: first kex follow: 0 
debug: reserved: 0 
debug: done
debug: kex: server->client 3des-cbc hmac-sha1 none
debug: kex: client->server 3des-cbc hmac-sha1 none
debug: Sending SSH2_MSG_KEX_DH_GEX_REQUEST.
debug: Wait SSH2_MSG_KEX_DH_GEX_GROUP.
debug: Got SSH2_MSG_KEX_DH_GEX_GROUP.
debug: bits set: 526/1024
debug: Sending SSH2_MSG_KEX_DH_GEX_INIT.
debug: Wait SSH2_MSG_KEX_DH_GEX_REPLY.
debug: Got SSH2_MSG_KEXDH_REPLY.
debug: Host 'faxdial' is known and matches the DSA host key.
debug: bits set: 518/1024
debug: len 55 datafellows 0
debug: dsa_verify: signature correct
debug: Wait SSH2_MSG_NEWKEYS.
debug: GOT SSH2_MSG_NEWKEYS.
debug: send SSH2_MSG_NEWKEYS.
debug: done: send SSH2_MSG_NEWKEYS.
debug: done: KEX2.
debug: send SSH2_MSG_SERVICE_REQUEST
debug: service_accept: ssh-userauth
debug: got SSH2_MSG_SERVICE_ACCEPT
debug: authentications that can continue: publickey
debug: start over, passed a different list
debug: authmethod_lookup publickey
debug: authmethod_is_enabled publickey
debug: next auth method to try is publickey
debug: try pubkey: /home/florian/.ssh/id_dsa
debug: read DSA private key done
debug: sig size 20 20
debug: we sent a publickey packet, wait for reply
debug: ssh-userauth2 successfull: method publickey
debug: fd 5 setting O_NONBLOCK
debug: fd 6 setting O_NONBLOCK
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
debug: callback start
debug: client_init id 0 arg 0
debug: Requesting X11 forwarding with authentication spoofing.
debug: Sending command: dd if=/dev/zero bs=1c count=1000
debug: client_set_session_ident: id 0
debug: callback done
debug: channel 0: open confirm rwindow 0 rmax 16384
debug: channel 0: rcvd adjust 32768
debug: callback start
debug: client_input_channel_req: rtype exit-status reply 0
debug: callback done
debug: channel 0: rcvd eof
debug: channel 0: output open -> drain
debug: channel 0: rcvd close
debug: channel 0: input open -> closed
debug: channel 0: close_read
debug: channel 0: obuf empty
debug: channel 0: output drain -> closed
debug: channel 0: close_write
debug: channel 0: send close
debug: channel 0: full closed2
debug: channel_free: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i8/0 o128/0 fd -1/-1)

debug: !channel_still_open.
debug: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug: Exit status 0


More information about the openssh-unix-dev mailing list