ash endless loop after ssh client is killed

Denis Vlasenko vda.linux at googlemail.com
Fri Apr 20 07:17:04 UTC 2007


On Friday 20 April 2007 04:37, Alexander Kriegisch wrote:
> The following problem occurs in bb 1.4.1 and, AFAIK in
> 1.5.0. In 1.3.1 it does not happen. Platform is mipsel.
> 
> How to reproduce:
>   - Dropbear interactive ssh session to router box running busybox
>   - ssh client is putty on Windows or OpenSSH on Ubuntu 6.10
>   - Action: kill client by closing window or sending kill signal
>     (no clean exit)
>   - Symptom: sh process shoots to >90% CPU permanently, sooner or later
>     making the router stall or reboot
>      PID USER     STATUS   RSS  PPID %CPU %MEM COMMAND
>     3435 root     R        472     1 30.6  1.5 sh
>   - strace transcript:
>     Process 3435 attached - interrupt to quit
>     write(2, "Cannot set tty process group (", 30) = -1 EIO (Input/output error)
>     write(2, "\n", 1)                       = -1 EIO (Input/output error)
>     ioctl(10, 0x80047476, 0x7fb969bc)       = -1 ENOTTY (Inappropriate ioctl for device)
>     write(2, "-sh", 3)                      = -1 EIO (Input/output error)
>     write(2, "Cannot set tty process group (", 30) = -1 EIO (Input/output error)
>     write(2, "\n", 1)                       = -1 EIO (Input/output error)
>     ioctl(10, 0x80047476, 0x7fb969bc)       = -1 ENOTTY (Inappropriate ioctl for device)
>     (...)
> 
> Somehow 'xtcsetpgrp' is called repeatedly, maybe because
> of the negative return value. Can you get this fixed?

Does removing this line helps?

exitshell(void)
{
...
        flush_stdout_stderr();
 out:
        setjobctl(0);          <============== REMOVE
        _exit(status);
        /* NOTREACHED */
}

--
vda



More information about the busybox mailing list