当使用压缩时,openssh会以100%的cpu挂起

当请求压缩( ssh -C )时,ansible openssh服务器挂起100%cpu,

 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 [email protected] debug3: send packet: type 80 debug1: Entering interactive session. debug1: pledge: proc 

然后客户端挂起(不再对ctrl-c做出反应),服务器有一个100%cpu的进程(但接受新的ssh连接)。

在客户端strace结束:

 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:一旦进程挂起,用strace -p连接到挂起进程不会再显示任何东西。 连接到主进程显示连接:

 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 

之后,直到下一个(悬挂)连接,再次给出相同的输出,没有进一步的输出。

似乎是在高山linux openssh 已知的bug 。