Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 1998 12:21:20 -0400 (EDT)
From:      cao@bus.net
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/8088: short writes using ssh-1.2.*
Message-ID:  <199809291621.MAA02490@milf18.bus.net>

next in thread | raw e-mail | index | archive | help

>Number:         8088
>Category:       ports
>Synopsis:       short writes using ssh-1.2.*
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 29 09:30:00 PDT 1998
>Last-Modified:
>Originator:     Chuck O'Donnell
>Organization:
>Release:        FreeBSD 2.2.6-RELEASE i386
>Environment:

FreeBSD 2.2.6-RELEASE on Intel Pentium
SSH Version 1.2.26 [i386-unknown-freebsd2.2.6], protocol version 1.5.
Compiled with RSAREF.

>Description:

ssh as built from the ports tree seems to sometimes truncate files in
a certain size range whenever you use it to transfer data between
interfaces using a pipe or a redirect. The problem only shows up in
certain situations and seems to depend on different factors (e.g. speed
of your connection, the size of the file, compression and the choice
of block size when creating a file with dd and tar).

I originally discovered this while investigating a problem I had
transferring a file using "scp", although I have not been able to
repeat that particular problem since then.

A note back from Greg Lehey on freebsd-question@freebsd.org suggested
the following:
--
I'd guess that it's a timing problem.  Maybe the secure channel goes
away before the final data (including the dd summary) gets across.
--

>How-To-Repeat:

send data from a remote machine to the local machine using a pipe or
redirection. this can be done by cat'ing a file or creating one with
dd or something similar.

e.g. here is an example using dd, with a comparison to the same
command using rsh for reference:

--
cao@milf18$ rsh naug27 dd count=61 if=/dev/zero | wc -c
61+0 records in
61+0 records out
31232 bytes transferred in 2.557135 secs (12214 bytes/sec)
   31232
cao@milf18$ ssh naug27 dd count=61 if=/dev/zero | wc -c
   30720
cao@milf18$ 
--

Note how the statistics report that is normally written by dd to
stderr is missing too. If you drop the count by one, you will get a
good write, but the statistics report is still missing.  Drop it by
one more to 59, and everything works fine.

You can do the same thing by creating a disk file greater than 32768
bytes and then using cat:

--
cao@milf18$ ssh naug27 dd if=/dev/zero bs=1 count=33000 of=remote_file
33000+0 records in
33000+0 records out
33000 bytes transferred in 1.589069 secs (20767 bytes/sec)
You have mail in /var/mail/cao
cao@milf18$ ssh naug27 cat remote_file | wc -c
   32768
cao@milf18$ ssh naug27 cat remote_file > local_file
cao@milf18$ ls -l local_file
-rw-r--r--  1 cao  wheel  32768 Sep 29 12:13 local_file
cao@milf18$ 
--

>Fix:
	
	






>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809291621.MAA02490>