scp and ssh 'cat' stalls at 64k bytes

Chris Roehrig croehrig@house.org
Sat Jun 24 00:19:14 GMT 2023


No worries; I imagine most people don't run sshd on cygwin.  It looks to 
me like the issue involves i/o between sshd and its sub-processes on cygwin.

Is anyone else able to successfully scp large files (>64KB) to cygwin as 
the remote receiving end (with the latest cygwin)?


On 2023-06-23 16:27, Voris, Ben wrote:
> I did not and cannot. Sorry.
>
> Fwiw, pushing from Cygwin to the remote also worked.
>
>> -----Original Message-----
>> From: Chris Roehrig <croehrig@house.org>
>> Sent: 23 June 2023 17:23
>> To: Voris, Ben <ben.voris@hpe.com>
>> Subject: Re: scp and ssh 'cat' stalls at 64k bytes
>>
>> Did you execute the scp on the remote (e.g. Linux) host?     It only
>> fails when cygwin is the remote and target end (i.e. "pushing" to a
>> cygwin host);  "pulling" works fine.
>>
>>
>> On 2023-06-23 16:07, Voris, Ben wrote:
>>> Using scp from OpenSSH_9.3p1, 30 May 2023, copied a 8317351936 byte file from
>> a remote to Cygwin. sha1sum says it arrived correctly.
>>> Windows Firewall is running.
>>>
>>>> -----Original Message-----
>>>> From: Chris Roehrig <croehrig@house.org>
>>>> Sent: 23 June 2023 13:42
>>>> To: cygwin@cygwin.com
>>>> Subject: Re: scp and ssh 'cat' stalls at 64k bytes
>>>>
>>>>
>>>> On 2023-06-23 08:28, Brian Inglis wrote:
>>>>> On 2023-06-23 00:26, Chris Roehrig via Cygwin wrote:
>>>>>> I've upgraded cygwin recently (from a much older version) and am
>>>>>> encountering a new problem on all my Win10/WIn11 machines.
>>>>>>
>>>>>> With openssh and pv installed on cygwin (3.4.7-1):
>>>>>>
>>>>>> dd if=/dev/zero bs=1 count=65536 | ssh localhost 'cat > /dev/null'
>>>>>> # works
>>>>>> dd if=/dev/zero bs=1 count=65537 | ssh localhost 'cat > /dev/null'
>>>>>> # stalls (and anything larger)
>>>>>> dd if=/dev/zero bs=1 count=65537 | ssh localhost 'pv > /dev/null'
>>>>>> # replace 'cat' with 'pv' and it works
>>>>>>
>>>>>> This happens with or without Windows Firewall enabled, with any input
>>>>>>> 64k, and also remotely from Linux.
>>>>>> It also seems to affect scp to cygwin which stalls if the file is >= 64k
>>>>> In case equivalent Windows services are running, I check for, shut
>>>>> down, and disable the following Windows services I have seen, or seen
>>>>> warnings about, before trying to start Cygwin services:
>>>>>
>>>>>       ssh ssh-agent sshbroker sshproxy sshd sshdbroker sshdproxy
>>>>>
>>>>> Do you take similar precautions on the Windows systems with issues?
>>>> The only service listed is ssh-agent which is disabled and stopped.
>>>> TaskManager did show many zombie/stuck cat.exe  and scp.exe which I
>>>> terminated, but that did not help.   Nor did rebooting.
>>>>
>>>> I use ssh, rsync, slogin frequently on these machines to/from windows
>>>> and linux and rsync (over ssh) gigabytes of stuff daily to/from Linux
>>>> and other windows machines with no issues.   It is only this case of
>>>> reading more than 64K from stdin over ssh (and scp) that is hanging.
>>>>
>>>>> Please show at least the output of `uname -srvmo`,
>>>> CYGWIN_NT-10.0-19045 3.4.7-1.x86_64 2023-06-16 14:04 UTC x86_64 Cygwin
>>>>
>>>>> and if possible provide a text attachment of the output log from
>>>>> running `cygcheck -hrsv > cygcheck.out`, as suggested under the
>>>>> Problem reports link below.
>>>> I've attached the file.
>>>>
>>>>
>>>> I take it then you can't replicate this?    Can you confirm whether this
>>>> command works successfully (i.e. exits without hanging):
>>>>
>>>> dd if=/dev/zero bs=1 count=65537 | ssh localhost 'cat > /dev/null'
>>>>
>>>> Are you able to 'scp' large files to cygwin?
>>>>
>>>>
>>>> It also hangs if I replace 'cat' with 'sed {}' or 'awk {print}', but not
>>>> with 'pv'.   Those all passthrough stdin>stdout and should behave the
>>>> same as cat.  (pv is basically cat with a progress bar which is omitted
>>>> if there's  no controlling terminal like in this case).
>>>>
>>>>
>>>> The curious fact that 'pv' works makes me think it is a Cygwin library
>>>> problem and not anything related to firewall/network/Windows.
>>>>
>>>> I've verified that cat, pv, and sshd all have the same ACLs.  e.g.
>>>> aquila[77]% icacls pv.exe
>>>> pv.exe AQUILA\croehrig:(F)
>>>>            BUILTIN\Administrators:(RX)
>>>>           Everyone:(RX)



More information about the Cygwin mailing list