From: Joe Peterson <[EMAIL PROTECTED]> To: bug-bash@gnu.org Subject: stty sometimes hangs (ERESTARTSYS error) when called from .bashrc
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: i686-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -march=i686 -O2 -pipe uname output: Linux crater 2.6.26-rc6-git4 #1 SMP PREEMPT Wed Jun 18 15:24:32 MDT 2008 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux Machine Type: i686-pc-linux-gnu Bash Version: 3.2 Patch Level: 33 Release Status: release Description: Doing "su foo" (where foo is a user set to use "bash" as the shell), if the user has an "stty" command in .bashrc, and there is a slight delay before this command is reached (because of previous commands, etc. - note that a "sleep 2" often demonstrates this), the stty process will sometimes hang in state "T", having received the ERESTARTSYS error over and over. The cause seems to be that the tty->pgrp process id is not equal to the task_pgrp(current) process id when the kernel's tty_io.c:ttr_check_change() function is called, invoking the error. One process id is that of the "su", and the other is that of "bash" (child of the su). Repeat-By: Make a user "foo" with a .bashrc containing only: sleep 2 stty ixany Log into the console as root, then "su foo". It seems to often not hang the first time (the prompt appears after a couple of seconds as expected), but exiting and redoing it will often hang. There is a degree of intermittent behavior, suggesting a timing issue. The hang can be broken by then doing "killall -9 stty".