diff --git a/src/cmd/ksh93/tests/functions.sh b/src/cmd/ksh93/tests/functions.sh index 535985f1576a..721ba58abee2 100755 --- a/src/cmd/ksh93/tests/functions.sh +++ b/src/cmd/ksh93/tests/functions.sh @@ -1306,5 +1306,22 @@ actual=$( [[ $actual == "$expect" ]] || err_exit "wrong exit status from function invoked by command substitution" \ "(expected $(printf %q "$expect"), got $(printf %q "$actual"))" +# ====== +# https://bugzilla.redhat.com/1117404 + +cat >$tmp/crash_rhbz1117404.ksh <<-'EOF' + trap "" HUP # trigger part 1: signal ignored in main shell + function ksh_fun + { + trap ": foo" HUP # trigger part 2: any local trap (empty or not) on same signal in ksh function + } + for((i=0; i<2500; i++)) + do ksh_fun + done +EOF +got=$( { "$SHELL" "$tmp/crash_rhbz1117404.ksh"; } 2>&1) +((!(e = $?))) || err_exit 'crash while handling function-local trap' \ + "(got status $e$( ((e>128)) && print -n / && kill -l "$e"), $(printf %q "$got"))" + # ====== exit $((Errors<125?Errors:125)) diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh index 56d4115d39cb..d24122aa194e 100755 --- a/src/cmd/ksh93/tests/subshell.sh +++ b/src/cmd/ksh93/tests/subshell.sh @@ -852,7 +852,6 @@ actual=`get_value` cat >$tmp/crash_rhbz1117404.ksh <<-'EOF' trap "" HUP # trigger part 1: signal ignored in main shell - i=0 for((i=0; i<2500; i++)) do (trap ": foo" HUP) # trigger part 2: any trap (empty or not) on same signal in subshell done