Skip to content

Commit

Permalink
tests/subshell.sh: test from rhbz#1138751 reproducer (re: 4ce486a)
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Sep 25, 2020
1 parent c382cea commit 95225e1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cmd/ksh93/tests/subshell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -821,5 +821,14 @@ sleep_pid=$!
((!(e = $?))) || err_exit "backtick comsub hang (got status $e$( ((e>128)) && print -n / && kill -l "$e"))"
kill "$sleep_pid" 2>/dev/null

# Backtick command substitution with pipe hangs when filling out pipe buffer (rhbz#1138751)
"$SHELL" -c 'HANG=`dd if=/dev/zero bs=1k count=117 2>/dev/null | cat`' &
test_pid=$!
(sleep 2; kill -s KILL "$test_pid" 2>/dev/null) &
sleep_pid=$!
{ wait "$test_pid"; } 2>/dev/null
((!(e = $?))) || err_exit "backtick comsub with pipe hangs (got status $e$( ((e>128)) && print -n / && kill -l "$e"))"
kill "$sleep_pid" 2>/dev/null

# ======
exit $((Errors<125?Errors:125))

0 comments on commit 95225e1

Please sign in to comment.