bin/58195: /bin/sh sometimes run endless loop inside dowait()
Eugene Grosbein
eugen at kuzbass.ru
Sat Oct 18 03:30:19 PDT 2003
>Number: 58195
>Category: bin
>Synopsis: /bin/sh sometimes run endless loop inside dowait()
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Oct 18 03:30:17 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Eugene Grosbein
>Release: FreeBSD 4.9-RC i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 4.9-RC FreeBSD 4.9-RC #24: Mon Oct 6 22:19:39 KRAST 2003 eu at grosbein.pp.ru:/usr/local/obj/usr/local/src/sys/DADV i386
>Description:
A function waitforjob() in src/bin/sh/jobs.c contains following code:
while (jp->state == 0)
if (dowait(1, jp) == -1)
dotrap();
This loop may be endless.
>How-To-Repeat:
This is 100% repeatable for me using the following test.sh:
#!/bin/sh
subr() {
{ sleep 3600 & sleep 1; kill $!; } &
}
set -T
trap 'subr &' USR1
while :
do
sleep 5
done
Run it:
sh -c './test.sh & for i in `jot 10 1`; do kill -USR1 $!; done; top'
Wait 5 seconds and see how /bin/sh eats CPU in this endless loop.
>Fix:
Unknown for me.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list