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


Groups > gnu.bash.bug > #11444

Race condition in read -t

From Oleg Popov <dev-random@mail.ru>
Newsgroups gnu.bash.bug
Subject Race condition in read -t
Date 2015-08-29 02:52 +0300
Message-ID <mailman.117.1440827498.19560.bug-bash@gnu.org> (permalink)

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-pc-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I. -I./include -I. -I./include -I./lib  -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' -DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin' -DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT='/etc/bash/bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC -O2 -pipe -march=native -mtune=native
uname output: Linux thinkpad 4.1.6-hardened-r1 #1 SMP Wed Aug 26 04:44:35 MSK 2015 x86_64 AMD A6-3400M APU with Radeon(tm) HD Graphics AuthenticAMD GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.3
Patch Level: 42
Release Status: release

Description:
	Function reset_alarm() in read.def first resets SIGALRM handler and
	then cancels alarm. Sometimes, SIGALRM comes between those 2 calls and
	crashes (sub)shell.

Repeat-By:
	while sleep 0.00$RANDOM; do echo test; done | while true; do read -t 0.00$RANDOM; echo $REPLY; done
	(usually takes a few seconds to crash, sometimes minutes)

Fix:
	Swap the lines in reset_alarm().

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


Thread

Race condition in read -t Oleg Popov <dev-random@mail.ru> - 2015-08-29 02:52 +0300

csiph-web