X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0BA43857B9B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1687596377;
	bh=y2sOHipJCo3NLq84X2PGFg23cI+hyQN2SkKiGN5gdxk=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=ge1SALkeOqfkotXzZgk8TYn1RIdVQ4QLvUGbR9C77PbYS6lmO8iS1g45c8sNU/WPX
	 IAiQ9f9d19ZSeUjLnZ64z/6yarHLFxzVXG5s/GgX2do+uU9abn+NAz1SxvWgFtGeKw
	 UBctD8WnAQ7DeIB2nJytYEdem8zO4kJmJ84XDLpc=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 507583858C31
X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn
Message-ID: <63908dd8-36ab-9b18-2423-58ec0c41abb9@house.org>
Date: Sat, 24 Jun 2023 01:45:33 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Subject: Re: scp and ssh 'cat' stalls at 64k bytes
Content-Language: en-US, en-CA
To: cygwin@cygwin.com
References: <1b9482bd-2119-732f-cc49-a3930bd3328d@house.org>
 <947c6b09-c2c0-03db-a4ac-769c4f1b3783@Shaw.ca>
 <7fd038be-e163-a5d3-5e28-d79eef977ee5@house.org>
 <MW4PR84MB1684932344B153F3E4F4415AFE23A@MW4PR84MB1684.NAMPRD84.PROD.OUTLOOK.COM>
 <bced83bb-58c5-f2a8-bc03-578d6d9fd749@house.org>
 <MW4PR84MB1684E6210C73D34ED2223319FE23A@MW4PR84MB1684.NAMPRD84.PROD.OUTLOOK.COM>
 <754ed51d-ba50-5268-9150-1c6b5c86b5ca@house.org>
 <59bddbbd-f934-8a23-3589-31e6db46639d@harkless.org>
 <b6e0a7b2-ba6d-35f9-04b5-ca2e9c00ffd9@house.org>
 <1398592771.3401553.1687590748417@mail.yahoo.com>
In-Reply-To: <1398592771.3401553.1687590748417@mail.yahoo.com>
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Chris Roehrig via Cygwin <cygwin@cygwin.com>
Reply-To: Chris Roehrig <croehrig@house.org>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 35O8kf2M026007



On 2023-06-24 00:12, Kevin Schnitzius wrote:
>   On Friday, June 23, 2023 at 10:00:02 PM EDT, Chris Roehrig via Cygwin <cygwin@cygwin.com> wrote:
>
>> Thanks.  There must be some issue with my setup.   Very odd that 'pv'
>> works, but 'cat' does not.  ldd shows they use identical libs.   I guess
>> I'll start with the pv and cat source.
> Try this first:
> /usr/bin/dd if=/dev/zero bs=1 count=65536 | /usr/bin/ssh localhost '/usr/bin/cat > /dev/null'
Good thought.   No change.   NB:  65536 always works fine. Anything 
greater (e.g. 65537)  does not work.
> Also, I assume you are running Cygwin's bash in a mintty term...
Yes, same results with both mintty  (Administrator or not) or slogged in 
remotely.

I found another one that works:  tee.

So these work fine (and /dev/null can be replaced by any file or 
omitted; doesn't matter):
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'wc'  # WORKS
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'tee /dev/null | cat 
 > /dev/null'    # WORKS
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'pv | cat > 
/dev/null'    # WORKS
dd if=/dev/urandom bs=1 count=65536 | ssh localhost 'cat > /dev/null'   
# WORKS


These don't:
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'cat | wc'   # STALLS
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'cat > /dev/null'   
# STALLS
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'awk {print} > 
/dev/null'   # STALLS
dd if=/dev/urandom bs=1 count=65537 | ssh localhost 'sed {} > /dev/null' 
   # STALLS


So pv, tee, and wc work,  but cat, sed, awk get hung up.

I also tried a simple python 3.9 implementation of 'cat' which works, 
and a gcc-compiled getchar/putchar one which stalls (which gives me 
something to work with).



-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

