Skip to content

scp starts to throw "too many files" with large recursive transfer #1209

Closed
@cbookg

Description

@cbookg

Please answer the following
"OpenSSH for Windows" version

  • v7.6.1.0p1-Beta
  • also reproduced after building scp from head.

Server OperatingSystem
Linux - Ubuntu

Client OperatingSystem
Windows 10 Enterprise

What is failing
Steps:

  • Run "scp -r * targethost:/target/path" in a directory structure containing 8500 files.

Expected output

  • All files transfered properly.

Actual output

  • The last 50 files fail to transfer. The output looks something like this:
    ...
    filethatworks1 100% 6192 6.1KB/s 00:00
    filethatworks2 100% 894 0.9KB/s 00:00
    filethatfails1: eother
    filethatfails2: eother
    ...

I reproduced this by building from head and setting breakpoints to figure out more details about the failure.
The errors are coming from the win32 specific fileio_fstat() function. The call to _open_osfhandle returns 24, which appears to mean "too many open files".

It appears as though scp is leaking file handles or something. Is this a known issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions