From owner-freebsd-ports Tue Sep 29 09:30:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA21077 for freebsd-ports-outgoing; Tue, 29 Sep 1998 09:30:26 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA21034 for ; Tue, 29 Sep 1998 09:30:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id JAA07619; Tue, 29 Sep 1998 09:30:00 -0700 (PDT) Received: from milf18.bus.net (milf18.bus.net [207.41.25.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA19573 for ; Tue, 29 Sep 1998 09:21:36 -0700 (PDT) (envelope-from cao@milf18.bus.net) Received: (from cao@localhost) by milf18.bus.net (8.8.8/8.8.8) id MAA02490; Tue, 29 Sep 1998 12:21:20 -0400 (EDT) (envelope-from cao) Message-Id: <199809291621.MAA02490@milf18.bus.net> Date: Tue, 29 Sep 1998 12:21:20 -0400 (EDT) From: cao@bus.net Reply-To: cao@bus.net To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: ports/8088: short writes using ssh-1.2.* Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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