Subject: bin/16010: /bin/sh hangs when trapping signal in wait
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@nominum.com>
List: netbsd-bugs
Date: 03/22/2002 09:42:33
>Number: 16010
>Category: bin
>Synopsis: /bin/sh hangs when trapping signal in wait
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 22 09:43:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Andreas Gustafsson
>Release: NetBSD 1.5ZA
>Organization:
Nominum Inc
>Environment:
System: NetBSD trebuchet.engr.nominum.com 1.5ZA NetBSD 1.5ZA (TREBUCHET) #0: Sat Feb 2 15:04:55 PST 2002 gson@trebuchet.engr.nominum.com:/usr/src/sys/arch/i386/compile/TREBUCHET i386
Architecture: i386
Machine: i386
>Description:
When using the /bin/sh "trap" command to trap a signal while the shell
is executing a "wait" command, the shell does not execute the trap
action; instead it just hangs.
>How-To-Repeat:
Create a shell script "test.sh" containing the lines
sleep 1000 &
trap "echo aborted" 2
wait
Run the script with "/bin/sh test.sh" and attempt to abort it by
typing the interrupt character (control-C). Notice that this has no
effect.
The script works as expected (prints "aborted" and exits) if you use
/bin/ksh, /usr/pkg/bin/bash, or the /bin/sh of FreeBSD or Solaris 8.
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: