[Bug 3405] New: clientloop's client_wait_until_can_do_something uses 100 % CPU with ssh 2> >({exec 1>&2})

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Mar 14 22:18:10 AEDT 2022


            Bug ID: 3405
           Summary: clientloop's client_wait_until_can_do_something uses
                    100 % CPU with ssh 2> >({exec 1>&2})
           Product: Portable OpenSSH
           Version: 8.9p1
          Hardware: amd64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: nathanmonfils at gmail.com


This is a bit of an edge-case (and I've already found a workaround
using `exec tee`), but since updating to the latest release I've had
100 % CPU usage on a script, which you can replicate with `ssh <host>
2> >({exec 1>&2})`. (I'm actually redirecting stderr to a shell
function that parses it for a while then gives up on it by doing `exec

After a few seconds, the ssh process starts using 100 % CPU. Using GDB,
I consistently get the following trace:

#1  0x0000556af8a302e1 in poll (__timeout=<optimized out>,
__nfds=<optimized out>, __fds=<optimized out>)
    at /usr/include/bits/poll2.h:39
#2  client_wait_until_can_do_something (conn_out_readyp=<synthetic
pointer>, conn_in_readyp=<synthetic pointer>, 
    rekeying=<optimized out>, npfd_activep=0x7ffe8c32d07c,
npfd_allocp=0x7ffe8c32d078, pfdp=0x7ffe8c32d080, ssh=0x556af964bf80)
    at clientloop.c:575

I'm guessing this is linked to OpenBSD-Commit
a77e16a667d5b194dcdb3b76308b8bba7fa7239c "upstream: convert ssh, sshd
mainloops from select() to poll();".

You are receiving this mail because:
You are watching the assignee of the bug.

More information about the openssh-bugs mailing list