Subject: bin/35028: ksh trap broken (patch supplied)
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <j+nbsd@2006.salmi.ch>
List: netbsd-bugs
Date: 11/10/2006 09:55:00
>Number: 35028
>Category: bin
>Synopsis: ksh trap broken (patch supplied)
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 10 09:55:00 +0000 2006
>Originator: Jukka Salmi
>Release: NetBSD 4.99.3
>Environment:
System: NetBSD moray.salmi.ch 4.99.3 NetBSD 4.99.3 (MORAY.APM) #0: Thu Nov 2 20:52:22 CET 2006 build@moray.salmi.ch:/build/nbsd/i386/sys/arch/i386/compile/MORAY.APM i386
Architecture: i386
Machine: i386
>Description:
Revision 1.4 of src/bin/ksh/siglist.sh broke ksh's trap command by
generating an invalid signal list (siglist.out)
>How-To-Repeat:
Run ksh and try to trap a signal:
$ ksh
$ trap : INT
ksh: trap: bad signal INT
>Fix:
Index: bin/ksh/siglist.sh
===================================================================
RCS file: /cvsroot/src/bin/ksh/siglist.sh,v
retrieving revision 1.4
diff -u -p -r1.4 siglist.sh
--- bin/ksh/siglist.sh 16 Oct 2006 00:07:32 -0000 1.4
+++ bin/ksh/siglist.sh 3 Nov 2006 08:40:43 -0000
@@ -23,12 +23,12 @@ CPP="${1-cc -E}"
{ QwErTy .signal = SIG\1 , .name = "\1", .mess = "\2" },\
#endif/') > $in
$CPP $in > $out
-sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -k3n -k1n |
+sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -k5n -k1n |
sed 's/^[0-9]* //' |
awk 'BEGIN { last=0; nsigs=0; }
{
- if ($2 ~ /^[0-9][0-9]*$/ && $3 == ",") {
- n = $2;
+ if ($4 ~ /^[0-9][0-9]*$/ && $5 == ",") {
+ n = $4;
if (n > 0 && n != last) {
while (++last < n) {
printf "\t{ .signal = %d , .name = NULL, .mess = `Signal %d` } ,\n", last, last;