Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 634594 - net-misc/openssh-7.6_p1 sftp-server stalls during transfers
Summary: net-misc/openssh-7.6_p1 sftp-server stalls during transfers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-18 00:20 UTC by Sven E.
Modified: 2023-05-06 05:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix "HPNDisabled yes" to suppress the problem (fix_HPNDisabled_yes.patch,358 bytes, patch)
2018-01-23 02:29 UTC, Zac Medico
Details | Diff
Fix the sftp stall (fix.patch,883 bytes, patch)
2018-01-23 03:11 UTC, Zac Medico
Details | Diff
Fix the sftp stall (fix.patch,633 bytes, patch)
2018-01-23 03:33 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2017-10-18 00:20:26 UTC
With net-misc/openssh-7.6_p1 I'm seeing stalls of sftp-server during transfers (server becomes unresponsive).

I'm however not seeing the problem (as far as I can tell) if the transfer speed stays below 5 MByte/s.

I'm not seeing the probmlem with older openssh versions.

With openssh-7.5_p1-r2' sftp-server I can transfer at speeds of 25+ MBytes/s continuously without any problems.

Reproducible: Always

Steps to Reproduce:
1. Install said openssh version
2. Transfer data via sftp at signifikant speeds.

Actual Results:  
sftp-server freezes/becomes unresponsive from client's perspective.

Expected Results:  
Normally running sftp transfers.
Comment 1 Todd Goodman 2017-10-19 18:42:40 UTC
Do you have the hpn use set?

I had the problem with an SSH Git push where it was hanging (always at the same spot of 31% of 'Writing objects...'.)

I disabled the hpn use flag and it works fine for me now.
Comment 2 Sven E. 2017-10-19 19:27:02 UTC
(In reply to Todd Goodman from comment #1)
> Do you have the hpn use set?
> 
> I had the problem with an SSH Git push where it was hanging (always at the
> same spot of 31% of 'Writing objects...'.)
> 
> I disabled the hpn use flag and it works fine for me now.

I did not purposefully enable it, but I think it is enabled in the profile.

I could try recompiling with -hpn and see if that changes anything. Thanks for the input.
Comment 3 Sven E. 2017-10-19 21:03:54 UTC
So, I tested 7.6_p1 again with and without USE="hpn" and now both work as expected. Unfortunately I did inbetween upgrade the client aswell.

Maybe this was some sort of incompatibility or just gremlins (Even though it seemed completely reproduceable at the time of the report).

I think we can mark this resolved then.

Sorry for the noise.
Comment 4 Alexey Shvetsov archtester gentoo-dev 2017-10-27 12:18:04 UTC
This may be related to this issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878424

Some users see this problems with winscp and new openssh 7.6p1

Downgrading to 7.5 solves issue
Comment 5 Sven E. 2017-10-27 13:57:01 UTC
(In reply to Alexey Shvetsov from comment #4)
> This may be related to this issue
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878424
> 
> Some users see this problems with winscp and new openssh 7.6p1
> 
> Downgrading to 7.5 solves issue

I was actually using WinSCP as client, when I stumbled over the problem. Can't tell which side's fault it is afterall.

When testing for a longer time, I hit this again with +gpn but not with -hpn, as far as I can tell. I'd have to conduct some more clean slate tests, to make 100% sure.
Comment 6 Yuriy Dmitriev 2017-10-29 13:17:57 UTC
Same problem. I resolve that 
# USE="-hpn" emerge -1 openssh
Comment 7 Yuriy Dmitriev 2017-10-29 13:22:44 UTC
But problem not restrict only to scp.
rsync over ssh, if sshd is window$ sshd have same problem.
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2017-11-07 13:28:59 UTC
I can confirm the problem. This is not related to WinSCP only. Seen with FileZilla 3.29.0, FlashFXP 5.4.0, Total Commander 9.1. They are all using different engines. When re-compiling without HPN, all problems are gone.

> HPNDisabled yes
in sshd_config had no effect, re-compilation without HPN patch set was required.
Comment 9 Larry the Git Cow gentoo-dev 2017-11-07 13:34:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c550123e50c1cad20d35758dfe3ba9fb29b9af3a

commit c550123e50c1cad20d35758dfe3ba9fb29b9af3a
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2017-11-07 13:34:10 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2017-11-07 13:34:34 +0000

    net-misc/openssh: Revbump to remove hpn support (breaks scp transfers)
    
    Bug: https://bugs.gentoo.org/634594
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 net-misc/openssh/Manifest                                            | 1 -
 net-misc/openssh/{openssh-7.6_p1.ebuild => openssh-7.6_p1-r1.ebuild} | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)}
Comment 10 Larry the Git Cow gentoo-dev 2017-11-07 18:42:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cd0550422415ec40e4bf7c04acca139e9dee75c

commit 9cd0550422415ec40e4bf7c04acca139e9dee75c
Author:     Patrick McLean <chutzpah@gentoo.org>
AuthorDate: 2017-11-07 18:42:10 +0000
Commit:     Patrick McLean <chutzpah@gentoo.org>
CommitDate: 2017-11-07 18:42:10 +0000

    net-misc/openssh: Restore 7.6_p1-r0 ebuild
    
    Some users aren't affected by bug #634594, rather than forcing them
    to downgrade or fork, we should keep the ebuild with hpn around.
    
    Bug: https://bugs.gentoo.org/634594
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 net-misc/openssh/Manifest              |   1 +
 net-misc/openssh/openssh-7.6_p1.ebuild | 336 +++++++++++++++++++++++++++++++++
 2 files changed, 337 insertions(+)}
Comment 11 Larry the Git Cow gentoo-dev 2018-01-22 02:22:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de02520f0c9d660af8a2cd0317648f69177f57c1

commit de02520f0c9d660af8a2cd0317648f69177f57c1
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-01-22 02:10:08 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-01-22 02:18:16 +0000

    net-misc/openssh: revbumps for net-libs/ldns dep change
    
    Since sys-apps/portage-2.3.20 defaults to --dynamic-deps=n, this revbump
    is needed in order to correct the dependencies of installed instances of
    openssh.
    
    It's not possible to revbump the 7.6_p1 ebuild to 7.6_p1-r1, since the
    7.6_p1-r1 ebuild already exists with the only difference being that
    the HPN_PATCH variable is commented out. As a compromise, make 7.6_p1-r2
    include HPN_PATCH but also remove the default IUSE setting for hpn in
    order to suppress bug 634594 by default.
    
    Fixes: a71042d76cb4 ("net-misc/openssh: Fix net-libs/ldns dependency")
    Bug: https://bugs.gentoo.org/645310
    Bug: https://bugs.gentoo.org/634594
    Package-Manager: Portage-2.3.20, Repoman-2.3.6
    RepoMan-Options: --force

 ...h-7.5_p1-r3.ebuild => openssh-7.5_p1-r4.ebuild} |   0
 net-misc/openssh/openssh-7.6_p1-r1.ebuild          | 336 ---------------------
 ...nssh-7.6_p1.ebuild => openssh-7.6_p1-r2.ebuild} |   4 +-
 3 files changed, 2 insertions(+), 338 deletions(-)}
Comment 12 Larry the Git Cow gentoo-dev 2018-01-23 01:42:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c8c40a4f54c9ec9632cf4ce424c629482541ee5

commit 4c8c40a4f54c9ec9632cf4ce424c629482541ee5
Author:     Patrick McLean <chutzpah@gentoo.org>
AuthorDate: 2018-01-23 00:19:05 +0000
Commit:     Patrick McLean <chutzpah@gentoo.org>
CommitDate: 2018-01-23 01:42:39 +0000

    net-misc/openssh: Revision bump, bump X509 patch to 11.1
    
    Also re-enable hpn USE flag (disabled by default) since it has now
    been package.use.mask-ed in the base profile.
    
    Bug: https://bugs.gentoo.org/634594
    Package-Manager: Portage-2.3.20, Repoman-2.3.6

 net-misc/openssh/Manifest                          |   1 +
 .../files/openssh-7.6_p1-hpn-x509-11.1-glue.patch  |  50 +++
 net-misc/openssh/openssh-7.6_p1-r3.ebuild          | 335 +++++++++++++++++++++
 3 files changed, 386 insertions(+)}
Comment 13 Zac Medico gentoo-dev 2018-01-23 02:29:31 UTC
Created attachment 516022 [details, diff]
fix "HPNDisabled yes" to suppress the problem

This patch fixes the channel_pre_open function so that the hpn code does not interfere with c->remote_window when "HPNDisabled yes" is set in sshd_config. This suppressed the sftp stall with net-ftp/filezilla-3.30.0 running on Linux.
Comment 14 Zac Medico gentoo-dev 2018-01-23 03:11:06 UTC
Created attachment 516024 [details, diff]
Fix the sftp stall

This reintroduces the local limit variable, in order to avoid changing the c->dynamic_window attribute.
Comment 15 Zac Medico gentoo-dev 2018-01-23 03:33:12 UTC
Created attachment 516026 [details, diff]
Fix the sftp stall

This is identical to the previous patch, but drops the last replacement of c->remote_window, in order to align the code with the behavior in the openssh-7.5p1-hpnssh14v12 patch set.
Comment 16 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2018-01-23 17:55:23 UTC
(In reply to Zac Medico from comment #15)
> Created attachment 516026 [details, diff] [details, diff]
> Fix the sftp stall
> 
> This is identical to the previous patch, but drops the last replacement of
> c->remote_window, in order to align the code with the behavior in the
> openssh-7.5p1-hpnssh14v12 patch set.

That's a very nice bug find. Can you please report it to upstream HPN as well?
Comment 17 Larry the Git Cow gentoo-dev 2018-01-23 23:54:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2803a8b211944e2f4f29c8ae92ba8eee86ba9d56

commit 2803a8b211944e2f4f29c8ae92ba8eee86ba9d56
Author:     Patrick McLean <chutzpah@gentoo.org>
AuthorDate: 2018-01-23 23:52:20 +0000
Commit:     Patrick McLean <chutzpah@gentoo.org>
CommitDate: 2018-01-23 23:52:20 +0000

    net-misc/openssh: Add fix for bug 634594 from zmedico
    
    Not revbumping since hpn has been package.use.mask-ed.
    
    Closes: https://bugs.gentoo.org/634594
    Package-Manager: Portage-2.3.20, Repoman-2.3.6

 net-misc/openssh/Manifest                                      | 1 +
 net-misc/openssh/files/openssh-7.6_p1-hpn-x509-11.1-glue.patch | 4 ++--
 net-misc/openssh/openssh-7.6_p1-r3.ebuild                      | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)