bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"wait" builtin with argument stucks and eats 100% CPU after 4096th call


From: osicka
Subject: "wait" builtin with argument stucks and eats 100% CPU after 4096th call
Date: Thu, 17 May 2007 01:04:52 +0200 (CEST)

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHE
uname output: Linux no 2.6.18-4-686 #1 SMP Wed Apr 18 09:55:10 UTC 2007 i686 
GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

Description:
"wait" builtin with argument stucks and eats 100% CPU after 4096th call.

Repeat-By:
Try this shell script:
------------------------------------
#!/bin/sh
prev=
for((a=0;a<5000;a++))
do
        {
                #Spawn a child which does whatever.
                echo >/dev/null
        } &
        echo "Waiting for $a (prev=$prev)..."
        test "$prev" && wait "$prev"
        prev="$!"
done
wait
echo 'Ok, no bug found here.'
------------------------------------

After executing, it will stuck and eat 100% CPU until Ctrl+C:
------------------------------------
...
Waiting for 4094 (prev=21846)...
Waiting for 4095 (prev=21847)...
Waiting for 4096 (prev=21848)...
/root/bashtest: line 11: wait: pid 21848 is not a child of this shell
Waiting for 4097 (prev=21849)...
Waiting for 4098 (prev=21850)...
------------------------------------

Thank you for your time. Osicka.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]