Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14240

Bash fails to exit if parent ssh process is killed during command search

From Siteshwar Vashisht <svashisht@redhat.com>
Newsgroups gnu.bash.bug
Subject Bash fails to exit if parent ssh process is killed during command search
Date 2018-06-15 09:36 -0400
Message-ID <mailman.1965.1529069806.1292.bug-bash@gnu.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='/usr/local/bin:/usr/bin'  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -Wno-parentheses -Wno-format-security
uname output: Linux localhost.localdomain 4.16.13-200.fc27.x86_64 #1 SMP Wed May 30 15:03:53 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 4.4
Patch Level: 19
Release Status: release

Description:
	Bash fails to exit and shows 100% cpu usage if parent sshd process is killed while performing command search.

Repeat-By:

1. ssh to localhost with bash as default shell.
2. In the ssh session press 'ESC -p', this will show ':' on command line.
3. From a different terminal, check parent process id for bash running in ssh session by executing 'ps fax'. For e.g. on my machine it is 9825:

9822 ?        Ss     0:00  \_ sshd: situ [priv]
9825 ?        S      0:00      \_ sshd: situ@pts/8
9834 pts/8    Ss+    0:00          \_ -bash

4. Kill the parent process of bash by executing:

kill -hup 9825

5. Bash gets stuck in a loop and shows 100% cpu usage.

Fix:
	See attached patch. Credits to Paulo Andrade <pandrade@redhat.com> for finding and fixing the bug.


-- 
--
Siteshwar Vashisht

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Bash fails to exit if parent ssh process is killed during command search Siteshwar Vashisht <svashisht@redhat.com> - 2018-06-15 09:36 -0400

csiph-web