3

The ansible openssh server hangs with 100% cpu, when compression is requested (ssh -C)

ssh -vvv -C root@host
[...]
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (publickey).
Authenticated to host
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: proc

Then the client hangs (doesn't react to ctrl-c anymore) and the server has a process with 100% cpu (but accepts new ssh connections).

strace on the client ends with:

ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 ioctl(0, TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                                                                              clock_gettime(CLOCK_BOOTTIME, {tv_sec=337152, tv_nsec=214378998}) = 0
                                                      clock_gettime(CLOCK_BOOTTIME, {tv_sec=337152, tv_nsec=214391217}) = 0
                                                                                                                           select(9, [5], [4], NULL, {tv_sec=300, tv_usec=0}) = 1 (out [4], left {tv_sec=299, tv_usec=999998})
                                                                 clock_gettime(CLOCK_BOOTTIME, {tv_sec=337152, tv_nsec=214421550}) = 0
                                                                                                                                      write(4, "\302rv\230\347\310G\357T\204\272\3\27\1\341aE\20\317\233\374>\234\217&\0#g\241\225U\215"..., 112) = 112
                                                                                          clock_gettime(CLOCK_BOOTTIME, {tv_sec=337152, tv_nsec=214447208}) = 0
  clock_gettime(CLOCK_BOOTTIME, {tv_sec=337152, tv_nsec=214457769}) = 0
                                                                       select(9, [5], [], NULL, {tv_sec=300, tv_usec=0}

Strace on the server: once the process hangs, attaching with strace -p to the hanging process doesn't show anything anymore. Attaching to the main process shows on connect:

Process 257 attached
select(7, [3 4], NULL, NULL, NULL)      = 1 (in [3])
accept(3, {sa_family=AF_INET, sin_port=htons(43604), sin_addr=inet_addr("192.168.100.1")}, [16]) = 5
fcntl(5, F_GETFL)                       = 0x2 (flags O_RDWR)
pipe([6, 7])                            = 0
socketpair(PF_LOCAL, SOCK_STREAM, 0, [8, 9]) = 0
rt_sigprocmask(SIG_BLOCK, ~[], [], 8)   = 0
fork()                                  = 821
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
close(7)                                = 0
write(8, "\0\0\0\366\0", 5)             = 5
write(8, "\0\0\0\355\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"..., 245) = 245
close(8)                                = 0
close(9)                                = 0
close(5)                                = 0
getpid()                                = 257
getpid()                                = 257
getpid()                                = 257
select(7, [3 4 6], NULL, NULL, NULL)    = 1 (in [6])
close(6)                                = 0
select(7, [3 4], NULL, NULL, NULL

After that no further output until the next (hanging) connection, which gives the same output again.

allo
  • 1,524
  • 1
  • 19
  • 35

1 Answers1

1

Seems to be a known bug of openssh in alpine linux.

allo
  • 1,524
  • 1
  • 19
  • 35