[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash 3.0 compiled and linked with glibc 2.3.3 hungs when executing simpl
From: |
Sergey Zalogin |
Subject: |
Bash 3.0 compiled and linked with glibc 2.3.3 hungs when executing simple disk command |
Date: |
Sat, 2 Oct 2004 04:40:05 +0300 |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/tools/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I/tools/include -I. -I./include -I./lib -g -O2
uname output: Linux build.nolimit.ru 2.6.8-zalog2 #1 Thu Sep 30 16:25:15 EEST
2004 i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 3.0
Patch Level: 14
Release Status: release
Description:
When bash 3.0 was compiled with glibc 2.3.3 (CVS on 2004-10-01) it
hungs after
executing external disk commands, like "ls". As I discovered it runs an
infinite loop
in function "waitchld (wpid, block)" in "jobs.c" file while waiting for
child exiting.
The problem is in the "waitpid_flags" argument when calling waitpid()
function - it
returns errno "EINVAL". "man waitpid" says what third argument
"options" for waitpid()
may be combination of constatnts "WNOHANG", "WUNTRACED" and some other
for Linux,
but used in "jobs.c" "WCONTINUED" is not listed in man for "waitpid"
call. After I removed
"WCONTINUED" from options passed to waitpid the problem was dissapeared.
Is this a bug?
Repeat-By:
1. Compile bash 3.00-release and link it with glibc 2.3.3 (recent CVS
tree).
2. In compiled bash execute some external command like "ls" or "ps".
3. The output of command is appearing on console, but bash does not
return
the command prompt. "ps" shows spawned bash and executed command with
<defunc> flag.
Fix:
*** jobs.c.orig 2004-10-02 03:34:31.000000000 +0300
--- jobs.c 2004-10-02 03:52:48.035215736 +0300
***************
*** 2485,2491 ****
/* We don't want to be notified about jobs stopping if job control
is not active. XXX - was interactive_shell instead of job_control */
waitpid_flags = (job_control && subshell_environment == 0)
! ? (WUNTRACED|WCONTINUED)
: 0;
if (sigchld || block == 0)
waitpid_flags |= WNOHANG;
--- 2485,2491 ----
/* We don't want to be notified about jobs stopping if job control
is not active. XXX - was interactive_shell instead of job_control */
waitpid_flags = (job_control && subshell_environment == 0)
! ? (WUNTRACED)
: 0;
if (sigchld || block == 0)
waitpid_flags |= WNOHANG;
- Bash 3.0 compiled and linked with glibc 2.3.3 hungs when executing simple disk command,
Sergey Zalogin <=