From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12812 invoked by alias); 23 Dec 2011 14:55:44 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30047 Received: (qmail 29193 invoked from network); 23 Dec 2011 14:55:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: Re: $pipestatus broken? In-Reply-To: <111210065833.ZM6198@torch.brasslantern.com> (Bart Schaefer's message of "Sat, 10 Dec 2011 06:58:33 -0800") References: <87borgzkap.fsf@ft.bewatermyfriend.org> <877h24zj69.fsf@ft.bewatermyfriend.org> <111210065833.ZM6198@torch.brasslantern.com> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Fri, 23 Dec 2011 11:49:22 +0100 Message-ID: <877h1nwojx.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Bart Schaefer wrote: [...] > With that loop, I get a single "1" 100% of the time unless I attach to > the process with GDB, in which case it becomes random. It's correct that this should output "0 0", though, right? With the right hand side of the pipe being a loop, the last return code of the loop is return code of the loop, correct? If that's correct, the following adds a new test, that checks if the problem happens on a given system (actually, if the problem appears at least once in 2048 test runs - which has been triggered every time on my test system so far). I didn't see anything about tests that are *expected* to fail in `B01cd.ztst', so this makes the test suite fail at least once. Therefore, I don't know if adding this is a good idea or not. Regards, Frank diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst index 3911b06..d349f33 100644 --- a/Test/A04redirect.ztst +++ b/Test/A04redirect.ztst @@ -441,3 +441,13 @@ 0:failed assignment on non-posix-special, POSIX_BUILTINS >output ?zsh: read-only variable: foo + + repeat 2048; do (: | while read a; do + : + done; + print "${pipestatus[@]}") + done | sort -u +0:Check whether `$pipestatus[]' behaves. +>0 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.