From c3114a7735c85b79771e08bd156470bde1a36950 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 26 Oct 2013 16:11:40 -0700 Subject: 31906: fix race-condition interaction of $pipestatus with job control printjob() should not reference oldjobtab for job numbers unless it is being called from bin_fg(). printjob() also must not attempt to update pipestats when called from bin_fg(). acquire_pgrp() should not loop infintely if the shell is not interactive. Update the $pipestatus stress test so that it also exercises the oldjobtab repair. --- Test/A05execution.ztst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Test') diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index 8578016ab..ba7e02cd5 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -179,17 +179,23 @@ 0:Status reset by starting a backgrounded command >0 - repeat 2048; do (: | : | while false; do + setopt MONITOR + [[ -o MONITOR ]] || print -u $ZTST_fd 'Unable to change MONITOR option' + repeat 2048; do (return 2 | + return 1 | + while true; do + false break done; print "${pipestatus[@]}") ZTST_hashmark done | sort | uniq -c | sed 's/^ *//' 0:Check whether `$pipestatus[]' behaves. ->2048 0 0 0 +>2048 2 1 0 F:This test checks for a bug in `$pipestatus[]' handling. If it breaks then F:the bug is still there or it reappeared. See workers-29973 for details. + setopt MONITOR externFunc() { awk >/dev/null 2>&1; true; } false | true | false | true | externFunc echo $pipestatus -- cgit 1.4.1