From unknown Mon Aug 18 11:10:51 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#10465 <10465@debbugs.gnu.org> To: bug#10465 <10465@debbugs.gnu.org> Subject: Status: MSYS read-only file trouble Reply-To: bug#10465 <10465@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:10:51 +0000 retitle 10465 MSYS read-only file trouble reassign 10465 automake submitter 10465 Peter Rosin severity 10465 normal tag 10465 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 05:59:40 2012 Received: (at submit) by debbugs.gnu.org; 9 Jan 2012 10:59:40 +0000 Received: from localhost ([127.0.0.1]:50717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkCwx-0003KC-Ti for submit@debbugs.gnu.org; Mon, 09 Jan 2012 05:59:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33666) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkCws-0003Jw-4X for submit@debbugs.gnu.org; Mon, 09 Jan 2012 05:59:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkCwV-0002Tm-Eo for submit@debbugs.gnu.org; Mon, 09 Jan 2012 05:59:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:49392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkCwV-0002Ti-DM for submit@debbugs.gnu.org; Mon, 09 Jan 2012 05:59:07 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkCwP-0002qg-P4 for bug-automake@gnu.org; Mon, 09 Jan 2012 05:59:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkCwH-0002Kh-7C for bug-automake@gnu.org; Mon, 09 Jan 2012 05:59:01 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:52655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkCwG-0002Gj-P4 for bug-automake@gnu.org; Mon, 09 Jan 2012 05:58:53 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 3F12B40006 for ; Mon, 9 Jan 2012 11:58:48 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 1475740005 for ; Mon, 9 Jan 2012 11:58:47 +0100 (CET) Message-ID: <4F0AC868.3060001@lysator.liu.se> Date: Mon, 09 Jan 2012 11:58:48 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: bug-automake@gnu.org Subject: MSYS read-only file trouble Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Hi! MSYS will not allow redirecting on top of an existing r/o file, even if the dir is r/w, like this: $ mkdir foo $ ls -do foo drwxr-xr-x 2 peda 0 Jan 9 11:02 foo $ cd foo $ touch bar $ chmod a-w bar $ ls > bar bash: bar: Permission denied $ cat bar $ I think the above causes a testsuite failure for tap-driver-stderr.test. Cheers, Peter For reference, tap-driver-stderr.log: Running from installcheck: no Using TAP: no PATH = /home/peda/automake/tests:/c/Program Files (x86)/Microsoft F#/v4.0/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VSTSDB/Deploy:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools/:/c/Windows/Microsoft.NET/Framework/v4.0.30319:/c/Windows/Microsoft.NET/Framework/v3.5:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Team Tools/Performance Tools:/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ ./defs: line 805: priv-check.11388: Permission denied ++ pwd /home/peda/automake/tests/tap-driver-stderr.dir + fetch_tap_driver + case $am_tap_implementation in + sed '1s|#!.*|#! /bin/sh|' /home/peda/automake/lib/tap-driver.sh + chmod a+x tap-driver + sed 10q tap-driver #! /bin/sh # Copyright (C) 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of + tst=zardoz + for suf in trs log + rm -f zardoz.log zardoz.trs + touch zardoz.trs + chmod a-w zardoz.trs + st=0 + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' + cat stdout PASS: zardoz 1 + cat stderr awk: cmd. line:324: (FILENAME=- FNR=4) fatal: can't redirect to `zardoz.trs' (Permission denied) tap-driver.sh: fatal: I/O or internal error + cat zardoz.log 1..1 ok 1 PASS: zardoz 1 Hello, World! + cat zardoz.trs + test 0 -eq 0 + /bin/grep -F 'Hello, World!' stderr stdout + /bin/grep -F zardoz.trs stderr awk: cmd. line:324: (FILENAME=- FNR=4) fatal: can't redirect to `zardoz.trs' (Permission denied) + for suf in trs log + rm -f zardoz.log zardoz.trs + touch zardoz.log + chmod a-w zardoz.log + st=0 + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' + st=1 + cat stdout + cat stderr ./tap-driver: line 637: zardoz.log: Permission denied + cat zardoz.log + cat zardoz.trs cat: zardoz.trs: No such file or directory + : + test 1 -eq 0 + exit_status=1 + set +e + cd /home/peda/automake/tests + test no = yes + case $am_explicit_skips in + test 1 -eq 0 + keep_testdirs=yes + am_keeping_testdirs + case $keep_testdirs in + return 0 + set +x tap-driver-stderr: exit 1 Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:04:12 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 19:04:12 +0000 Received: from localhost ([127.0.0.1]:51287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKVv-000783-IP for submit@debbugs.gnu.org; Mon, 09 Jan 2012 14:04:12 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:41794) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKVt-00077p-Lh for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 14:04:10 -0500 Received: by wibhj6 with SMTP id hj6so3297155wib.3 for <10465@debbugs.gnu.org>; Mon, 09 Jan 2012 11:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+TIzJeJK9srbjx2grWNF5sKHnVgA8m9rJuNLkakLPoY=; b=xnCToZQwd+hQjOmTSxUd+ESYyw/IWsSIWEVrJL4Z42PClbcbgWhLaq94x+l/T3Ozcd VcypA1NmIwcL0bIG15RFAaf1vJluTyp23l4khiYmDZlDSe3AzsUJs0kG+V5H9UnnuArx AfhDBO/CmY0xclJdoijvyzyU02D5iFr1L8Ix0= Received: by 10.180.86.5 with SMTP id l5mr6873352wiz.17.1326135828781; Mon, 09 Jan 2012 11:03:48 -0800 (PST) Received: from [87.4.94.3] (host3-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.3]) by mx.google.com with ESMTPS id f36sm36925581wbo.10.2012.01.09.11.03.46 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 11:03:47 -0800 (PST) Message-ID: <4F0B3A11.4040001@gmail.com> Date: Mon, 09 Jan 2012 20:03:45 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> In-Reply-To: <4F0AC868.3060001@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 01/09/2012 11:58 AM, Peter Rosin wrote: > Hi! > Hi Peter. > MSYS will not allow redirecting on top of an existing r/o file, > even if the dir is r/w, like this: > > $ mkdir foo > $ ls -do foo > drwxr-xr-x 2 peda 0 Jan 9 11:02 foo > $ cd foo > $ touch bar > $ chmod a-w bar > $ ls > bar > bash: bar: Permission denied > $ cat bar > $ > Which is good and POSIX-ish, no? > I think the above causes a testsuite failure for tap-driver-stderr.test. > Unlikely: the test is expected to see a failure in the `tap-driver' script, since that script is trying to write to a read-only file (an action which should rightfully trigger an error); what we are actually checking is that this failure is accompanied by a meaningful error message *which does not get redirected to the test logs*. Let's see what's happening ... > Cheers, > Peter > > For reference, tap-driver-stderr.log: > > Running from installcheck: no > Using TAP: no > PATH = /home/peda/automake/tests:/c/Program Files (x86)/Microsoft F#/v4.0/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VSTSDB/Deploy:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools/:/c/Windows/Microsoft.NET/Framework/v4.0.30319:/c/Windows/Microsoft.NET/Framework/v3.5:/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files (x86)/Microsoft Visual Studio 10.0/Team Tools/Performance Tools:/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:.:/usr/local/bin:/mingw/bin:/bin:/c/Program Files/Common Files/Microsoft Shared/Windows Live:/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ > ./defs: line 805: priv-check.11388: Permission denied > ++ pwd > /home/peda/automake/tests/tap-driver-stderr.dir > + fetch_tap_driver > + case $am_tap_implementation in > + sed '1s|#!.*|#! /bin/sh|' /home/peda/automake/lib/tap-driver.sh > + chmod a+x tap-driver > + sed 10q tap-driver > #! /bin/sh > # Copyright (C) 2011 Free Software Foundation, Inc. > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > # the Free Software Foundation; either version 2, or (at your option) > # any later version. > # > # This program is distributed in the hope that it will be useful, > # but WITHOUT ANY WARRANTY; without even the implied warranty of > + tst=zardoz > + for suf in trs log > + rm -f zardoz.log zardoz.trs > + touch zardoz.trs > + chmod a-w zardoz.trs > + st=0 > + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' > + cat stdout > PASS: zardoz 1 > + cat stderr > awk: cmd. line:324: (FILENAME=- FNR=4) fatal: can't redirect to `zardoz.trs' (Permission denied) > tap-driver.sh: fatal: I/O or internal error > So far so good: the error goes to stderr ... > + cat zardoz.log > 1..1 > ok 1 > PASS: zardoz 1 > Hello, World! > + cat zardoz.trs > + test 0 -eq 0 > + /bin/grep -F 'Hello, World!' stderr stdout > + /bin/grep -F zardoz.trs stderr > awk: cmd. line:324: (FILENAME=- FNR=4) fatal: can't redirect to `zardoz.trs' (Permission denied) > + for suf in trs log > + rm -f zardoz.log zardoz.trs > + touch zardoz.log > + chmod a-w zardoz.log > + st=0 > + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' > + st=1 > Hmmm... looks like the shell is not returning a non-zero exit status in face of a I/O redirection failure. Could you try what happens doing the following? $ > foo; chmod a-w foo; sh -c ': > foo; echo one: $?'; echo two: $? > + cat stdout > + cat stderr > ./tap-driver: line 637: zardoz.log: Permission denied > (This is good as well BTW, this error goes to stderr too). Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:11:53 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 19:11:53 +0000 Received: from localhost ([127.0.0.1]:51291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKdM-0007IM-V0 for submit@debbugs.gnu.org; Mon, 09 Jan 2012 14:11:53 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:47940) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKdK-0007IE-7o for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 14:11:51 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 8C33840007; Mon, 9 Jan 2012 20:11:33 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 511ED40005; Mon, 9 Jan 2012 20:11:33 +0100 (CET) Message-ID: <4F0B3BE7.6080606@lysator.liu.se> Date: Mon, 09 Jan 2012 20:11:35 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> In-Reply-To: <4F0B3A11.4040001@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Stefano Lattarini skrev 2012-01-09 20:03: >> + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' >> + st=1 >> > Hmmm... looks like the shell is not returning a non-zero exit status in > face of a I/O redirection failure. > > Could you try what happens doing the following? > > $ > foo; chmod a-w foo; sh -c ': > foo; echo one: $?'; echo two: $? sh: foo: Permission denied two: 1 Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:53:15 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 19:53:15 +0000 Received: from localhost ([127.0.0.1]:51316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkLHO-0008Gp-MH for submit@debbugs.gnu.org; Mon, 09 Jan 2012 14:53:14 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:44114) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkLHM-0008Gc-T2 for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 14:53:13 -0500 Received: by wibhj6 with SMTP id hj6so3337297wib.3 for <10465@debbugs.gnu.org>; Mon, 09 Jan 2012 11:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=9bVzkchc4l1eN2XkrT6vnifg59u24C+YoA8xE5l47A8=; b=mEc4v6ThjHO9w6yNfoj8b88keTut45ZygG9tsWBQSD9BUOCeCoukFaUGLrZ9JGFdaJ IZD96qZ6X5jLEQpbDwicfxanGkY3hllt6+vAg099fO+DfGRpWt+gKFE6+UrcGj4EVlRa DNk4ggqqUJBRAeHsogt9qpVS/0wr/czvdAZ+k= Received: by 10.180.77.200 with SMTP id u8mr7129166wiw.18.1326138771571; Mon, 09 Jan 2012 11:52:51 -0800 (PST) Received: from [87.4.94.3] (host3-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.3]) by mx.google.com with ESMTPS id eu3sm58360604wib.6.2012.01.09.11.52.50 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 11:52:51 -0800 (PST) Message-ID: <4F0B4591.3070105@gmail.com> Date: Mon, 09 Jan 2012 20:52:49 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> In-Reply-To: <4F0B3BE7.6080606@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 01/09/2012 08:11 PM, Peter Rosin wrote: > Stefano Lattarini skrev 2012-01-09 20:03: >>> + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' >>> + st=1 >>> >> Hmmm... looks like the shell is not returning a non-zero exit status in >> face of a I/O redirection failure. >> >> Could you try what happens doing the following? >> >> $ > foo; chmod a-w foo; sh -c ': > foo; echo one: $?'; echo two: $? > > sh: foo: Permission denied > two: 1 > So the shell catches the redirection error correctly after all. Hmmm. Is the failure of tap-driver-stderr.test reproducible? Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 17:14:49 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 22:14:49 +0000 Received: from localhost ([127.0.0.1]:51409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkNUP-0003kI-HN for submit@debbugs.gnu.org; Mon, 09 Jan 2012 17:14:49 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:37993) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkNUM-0003k9-RB for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 17:14:48 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 894F540007; Mon, 9 Jan 2012 23:14:29 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 24DA440005; Mon, 9 Jan 2012 23:14:29 +0100 (CET) Message-ID: <4F0B66C7.5010405@lysator.liu.se> Date: Mon, 09 Jan 2012 23:14:31 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> In-Reply-To: <4F0B4591.3070105@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Stefano Lattarini skrev 2012-01-09 20:52: > On 01/09/2012 08:11 PM, Peter Rosin wrote: >> Stefano Lattarini skrev 2012-01-09 20:03: >>>> + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' >>>> + st=1 >>>> >>> Hmmm... looks like the shell is not returning a non-zero exit status in >>> face of a I/O redirection failure. >>> >>> Could you try what happens doing the following? >>> >>> $ > foo; chmod a-w foo; sh -c ': > foo; echo one: $?'; echo two: $? >> >> sh: foo: Permission denied >> two: 1 >> > So the shell catches the redirection error correctly after all. Hmmm. > > Is the failure of tap-driver-stderr.test reproducible? Yes, fails in the same way every time. Cheers, Peter From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 17:42:42 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 22:42:42 +0000 Received: from localhost ([127.0.0.1]:51431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkNvO-0004No-7I for submit@debbugs.gnu.org; Mon, 09 Jan 2012 17:42:42 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:59142) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkNvK-0004Nc-Kv for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 17:42:40 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 920E540007; Mon, 9 Jan 2012 23:42:19 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 56F5140005; Mon, 9 Jan 2012 23:42:19 +0100 (CET) Message-ID: <4F0B6D4E.2050108@lysator.liu.se> Date: Mon, 09 Jan 2012 23:42:22 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> In-Reply-To: <4F0B66C7.5010405@lysator.liu.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Peter Rosin skrev 2012-01-09 23:14: > Stefano Lattarini skrev 2012-01-09 20:52: >> On 01/09/2012 08:11 PM, Peter Rosin wrote: >>> Stefano Lattarini skrev 2012-01-09 20:03: >>>>> + ./tap-driver --test-name zardoz --log-file zardoz.log --trs-file zardoz.trs -- sh -c 'echo 1..1; echo ok 1; echo "Hello, World!"' >>>>> + st=1 >>>>> >>>> Hmmm... looks like the shell is not returning a non-zero exit status in >>>> face of a I/O redirection failure. >>>> >>>> Could you try what happens doing the following? >>>> >>>> $ > foo; chmod a-w foo; sh -c ': > foo; echo one: $?'; echo two: $? >>> >>> sh: foo: Permission denied >>> two: 1 >>> >> So the shell catches the redirection error correctly after all. Hmmm. >> >> Is the failure of tap-driver-stderr.test reproducible? > > Yes, fails in the same way every time. FWIW, this "fixes" it, but I don't actually know why a subshell would make a difference? $ sh --version GNU bash, version 3.1.17(1)-release (i686-pc-msys) Copyright (C) 2005 Free Software Foundation, Inc. Cheers, Peter >From c0bc106cbbd40225cd761124adaf434c004ad269 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Mon, 9 Jan 2012 23:40:45 +0100 Subject: [PATCH] tap/awk: run the awk program in a subshell MSYS bash (3.1.17) apparently has problems with the exit status of a grouping without a subshell. Fixes automake bug#10465. * lib/tap-driver.sh: Use a full blown subshell for running the awk script. --- lib/tap-driver.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh index c011298..6e9df79 100755 --- a/lib/tap-driver.sh +++ b/lib/tap-driver.sh @@ -115,7 +115,7 @@ else init_colors='' fi -{ +( ( # Ignore common signals (in this subshell only!), to avoid potential # problems with Korn shells. Some Korn shells are known to propagate @@ -634,7 +634,7 @@ exit 0 ' # TODO: document that we consume the file descriptor 3 :-( -} 3>"$log_file" +) 3>"$log_file" test $? -eq 0 || fatal "I/O or internal error" -- 1.7.5.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 18:34:54 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 23:34:54 +0000 Received: from localhost ([127.0.0.1]:51451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkOjt-0005XL-PV for submit@debbugs.gnu.org; Mon, 09 Jan 2012 18:34:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38635) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkOjq-0005XD-Ix for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 18:34:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q09NYXTu005665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Jan 2012 18:34:33 -0500 Received: from [10.3.113.48] (ovpn-113-48.phx2.redhat.com [10.3.113.48]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q09NYWKe013179; Mon, 9 Jan 2012 18:34:32 -0500 Message-ID: <4F0B7987.1040606@redhat.com> Date: Mon, 09 Jan 2012 16:34:31 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> <4F0B6D4E.2050108@lysator.liu.se> In-Reply-To: <4F0B6D4E.2050108@lysator.liu.se> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigEF2F6A9BFF13A76FC7A9B196" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org, Stefano Lattarini X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigEF2F6A9BFF13A76FC7A9B196 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01/09/2012 03:42 PM, Peter Rosin wrote: > FWIW, this "fixes" it, but I don't actually know why a subshell would > make a difference? >=20 > $ sh --version > GNU bash, version 3.1.17(1)-release (i686-pc-msys) > =20 > -{ > +( > ( > # Ignore common signals (in this subshell only!), to avoid potenti= al > # problems with Korn shells. Some Korn shells are known to propag= ate > @@ -634,7 +634,7 @@ exit 0 > ' > =20 > # TODO: document that we consume the file descriptor 3 :-( > -} 3>"$log_file" > +) 3>"$log_file" Ah - the classic bash bug documented in the autoconf manual: https://www.gnu.org/software/autoconf/manual/autoconf.html#Limitations-of= -Builtins Bash 3.2 (and earlier versions) sometimes does not properly set =91$?=92 when failing to write redirected output of a compound command. This problem is most commonly observed with =91{...}=92; it does not occur wit= h =91(...)=92. For example: $ bash -c '{ echo foo; } >/bad; echo $?' bash: line 1: /bad: Permission denied 0 $ bash -c 'while :; do echo; done >/bad; echo $?' bash: line 1: /bad: Permission denied 0 To work around the bug, prepend =91:;=92: $ bash -c ':;{ echo foo; } >/bad; echo $?' bash: line 1: /bad: Permission denied 1 --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigEF2F6A9BFF13A76FC7A9B196 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPC3mHAAoJEKeha0olJ0NqIaEH/1L3zs70NzgVQF4NRbOYthb3 3ogAnrXWk4O0Uzcp6p+qsnC3NKODQ+amH2cMQB3OoNE5AQRJNE+O4i+otwfo50Kp 7DeTyPL8f1Y5exfZcngtBt5e2RkShGNR4iTzS/M3KAJFJDX+x5Isy7Qv93sdqrAh vOj9chmF5TKZxbMsiOU+gh5+GWT39dTTP2JVLgIOjRitV53vLKh8pQPzejAHAAGX 9vfyCqnGR5wvvr0vyAeeAEVn2fXmBMewSAfLUWtEzDE9FsxtYbFJDc1+eroWMVUO GyNoGMzfI2ODUvBKJU1QEJTjkKqKQBgH3A7FJ7Bml2ICTH4/XCjg8bfC9vSJRYE= =PzRw -----END PGP SIGNATURE----- --------------enigEF2F6A9BFF13A76FC7A9B196-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 18:53:02 2012 Received: (at 10465) by debbugs.gnu.org; 9 Jan 2012 23:53:02 +0000 Received: from localhost ([127.0.0.1]:51455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkP1S-0005zG-CB for submit@debbugs.gnu.org; Mon, 09 Jan 2012 18:53:02 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:37077) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkP1O-0005yo-SN for 10465@debbugs.gnu.org; Mon, 09 Jan 2012 18:53:00 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0B4CB40007; Tue, 10 Jan 2012 00:52:40 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id AB9B140005; Tue, 10 Jan 2012 00:52:39 +0100 (CET) Message-ID: <4F0B7DC9.1000402@lysator.liu.se> Date: Tue, 10 Jan 2012 00:52:41 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> <4F0B6D4E.2050108@lysator.liu.se> <4F0B7987.1040606@redhat.com> In-Reply-To: <4F0B7987.1040606@redhat.com> Content-Type: text/plain; charset=windows-1252 X-Virus-Scanned: ClamAV using ClamSMTP Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org, Stefano Lattarini X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Eric Blake skrev 2012-01-10 00:34: > On 01/09/2012 03:42 PM, Peter Rosin wrote: >> FWIW, this "fixes" it, but I don't actually know why a subshell would >> make a difference? >> >> $ sh --version >> GNU bash, version 3.1.17(1)-release (i686-pc-msys) >=20 >> =20 >> -{ >> +( >> ( >> # Ignore common signals (in this subshell only!), to avoid potent= ial >> # problems with Korn shells. Some Korn shells are known to propa= gate >> @@ -634,7 +634,7 @@ exit 0 >> ' >> =20 >> # TODO: document that we consume the file descriptor 3 :-( >> -} 3>"$log_file" >> +) 3>"$log_file" >=20 > Ah - the classic bash bug documented in the autoconf manual: >=20 > https://www.gnu.org/software/autoconf/manual/autoconf.html#Limitations-= of-Builtins >=20 > Bash 3.2 (and earlier versions) sometimes does not properly set =91$?=92 > when failing to write redirected output of a compound command. This > problem is most commonly observed with =91{...}=92; it does not occur w= ith > =91(...)=92. For example: >=20 > $ bash -c '{ echo foo; } >/bad; echo $?' > bash: line 1: /bad: Permission denied > 0 > $ bash -c 'while :; do echo; done >/bad; echo $?' > bash: line 1: /bad: Permission denied > 0 >=20 > To work around the bug, prepend =91:;=92: >=20 > $ bash -c ':;{ echo foo; } >/bad; echo $?' > bash: line 1: /bad: Permission denied > 1 >=20 That works too, and is cheaper! Thanks for pointing to that workaround! So, better version: >From 38c4a7e2fcfe17a27bd16744f12d53e0968d1e52 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 10 Jan 2012 00:50:22 +0100 Subject: [PATCH] tap/awk: add workaround for bash 3.2 and earlier Fixes automake bug#10465. * lib/tap-driver.sh: Add workaround for bash 3.2 and earlier which has problems with compound statements, failing to redirect and exit status, as documented in the Autoconf manual. The workaround was pointed out by Eric Blake. --- lib/tap-driver.sh | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh index c011298..39de9c4 100755 --- a/lib/tap-driver.sh +++ b/lib/tap-driver.sh @@ -115,7 +115,9 @@ else init_colors=3D'' fi =20 -{ +# :; is there to work around a bug in bash 3.2 (and earlier) which +# does not always set $? properly on redirection failure. +:;{ ( # Ignore common signals (in this subshell only!), to avoid potential # problems with Korn shells. Some Korn shells are known to propagat= e --=20 1.7.5.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 03:49:05 2012 Received: (at 10465) by debbugs.gnu.org; 10 Jan 2012 08:49:06 +0000 Received: from localhost ([127.0.0.1]:51819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkXOD-00050I-Bz for submit@debbugs.gnu.org; Tue, 10 Jan 2012 03:49:05 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]:57738) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkXOA-000509-4R for 10465@debbugs.gnu.org; Tue, 10 Jan 2012 03:49:03 -0500 Received: by wgbdq12 with SMTP id dq12so2752151wgb.15 for <10465@debbugs.gnu.org>; Tue, 10 Jan 2012 00:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=BKrbT6ej0f5q/QXF/b0SahcYGqBWwoQYiC1z5MaYpXo=; b=Yx94Y/7WaJsWVFvxgO7vtkTAHNQdIbiIsIlfiKpAgQAW562kQPPBNMOGrSrLhqf3Ai ZSJFAF8jajutu3RebzbcUq8XcP82VnpcMK99To7puyNswZmreTV9cqqKAII1zRgxLumL loXk7B3mRVXcCZBreKRKhVBD8aqDOUJ3JMR+g= Received: by 10.180.19.168 with SMTP id g8mr10419600wie.4.1326185322852; Tue, 10 Jan 2012 00:48:42 -0800 (PST) Received: from [87.2.102.243] (host243-102-dynamic.2-87-r.retail.telecomitalia.it. [87.2.102.243]) by mx.google.com with ESMTPS id fo18sm82396837wbb.12.2012.01.10.00.48.41 (version=SSLv3 cipher=OTHER); Tue, 10 Jan 2012 00:48:42 -0800 (PST) Message-ID: <4F0BFB61.9050509@gmail.com> Date: Tue, 10 Jan 2012 09:48:33 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> <4F0B6D4E.2050108@lysator.liu.se> <4F0B7987.1040606@redhat.com> <4F0B7DC9.1000402@lysator.liu.se> In-Reply-To: <4F0B7DC9.1000402@lysator.liu.se> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org, Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Eric, Peter, and thanks to both for the super-quick diagnosis and fix. On 01/10/2012 12:52 AM, Peter Rosin wrote: > Eric Blake skrev 2012-01-10 00:34: >> On 01/09/2012 03:42 PM, Peter Rosin wrote: >>> FWIW, this "fixes" it, but I don't actually know why a subshell would >>> make a difference? >>> >>> $ sh --version >>> GNU bash, version 3.1.17(1)-release (i686-pc-msys) >> >>> >>> -{ >>> +( >>> ( >>> # Ignore common signals (in this subshell only!), to avoid potential >>> # problems with Korn shells. Some Korn shells are known to propagate >>> @@ -634,7 +634,7 @@ exit 0 >>> ' >>> >>> # TODO: document that we consume the file descriptor 3 :-( >>> -} 3>"$log_file" >>> +) 3>"$log_file" >> >> Ah - the classic bash bug documented in the autoconf manual: >> >> https://www.gnu.org/software/autoconf/manual/autoconf.html#Limitations-of-Builtins >> >> Bash 3.2 (and earlier versions) sometimes does not properly set ‘$?’ >> when failing to write redirected output of a compound command. This >> problem is most commonly observed with ‘{...}’; it does not occur with >> ‘(...)’. For example: >> >> $ bash -c '{ echo foo; } >/bad; echo $?' >> bash: line 1: /bad: Permission denied >> 0 >> $ bash -c 'while :; do echo; done >/bad; echo $?' >> bash: line 1: /bad: Permission denied >> 0 >> >> To work around the bug, prepend ‘:;’: >> >> $ bash -c ':;{ echo foo; } >/bad; echo $?' >> bash: line 1: /bad: Permission denied >> 1 >> > > That works too, and is cheaper! Thanks for pointing to that workaround! > > So, better version: > The patch is good, but I have a couple of nits below. Addressing them is not a requirement for an ACK, though (even if I'd prefer to have them addressed obviously). Feel free to push when you are ready. Thanks! > From 38c4a7e2fcfe17a27bd16744f12d53e0968d1e52 Mon Sep 17 00:00:00 2001 > From: Peter Rosin > Date: Tue, 10 Jan 2012 00:50:22 +0100 > Subject: [PATCH] tap/awk: add workaround for bash 3.2 and earlier > s/add workaround for/fix redirection issues with/ perhaps? > Fixes automake bug#10465. > > * lib/tap-driver.sh: Add workaround for bash 3.2 and earlier which has > problems with compound statements, failing to redirect and exit status, > as documented in the Autoconf manual. > What about stealing the wording of the autoconf manual, to make this entry clearer? Something like this: Add workaround for bash 3.2 and earlier, which sometimes does not properly set '$?' when failing to write redirected output of a compound command. See the Autoconf manual for more details. > The workaround was pointed out by Eric Blake. > --- > lib/tap-driver.sh | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh > index c011298..39de9c4 100755 > --- a/lib/tap-driver.sh > +++ b/lib/tap-driver.sh > @@ -115,7 +115,9 @@ else > init_colors='' > fi > > -{ > +# :; is there to work around a bug in bash 3.2 (and earlier) which > +# does not always set $? properly on redirection failure. > For the sake of completeness (and at cost of being repetitive), I'd add a reference to the Autoconf manual here as well, as: "See the Autoconf manual for more details." > +:;{ > ( > # Ignore common signals (in this subshell only!), to avoid potential > # problems with Korn shells. Some Korn shells are known to propagate > Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 10 04:07:58 2012 Received: (at 10465) by debbugs.gnu.org; 10 Jan 2012 09:07:59 +0000 Received: from localhost ([127.0.0.1]:51838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkXgT-0005QR-10 for submit@debbugs.gnu.org; Tue, 10 Jan 2012 04:07:58 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:32949) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkXgQ-0005QJ-4a for 10465@debbugs.gnu.org; Tue, 10 Jan 2012 04:07:55 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4012540034; Tue, 10 Jan 2012 10:07:34 +0100 (CET) Received: from [192.168.0.150] (h57n3fls301o1095.telia.com [81.230.178.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 94DD140007; Tue, 10 Jan 2012 10:07:33 +0100 (CET) Message-ID: <4F0BFFD8.9080903@lysator.liu.se> Date: Tue, 10 Jan 2012 10:07:36 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> <4F0B6D4E.2050108@lysator.liu.se> <4F0B7987.1040606@redhat.com> <4F0B7DC9.1000402@lysator.liu.se> <4F0BFB61.9050509@gmail.com> In-Reply-To: <4F0BFB61.9050509@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org, Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Stefano Lattarini skrev 2012-01-10 09:48: > Hi Eric, Peter, and thanks to both for the super-quick diagnosis and fix. > > On 01/10/2012 12:52 AM, Peter Rosin wrote: >> Eric Blake skrev 2012-01-10 00:34: *snip* >>> Ah - the classic bash bug documented in the autoconf manual: >>> *snip* >> >> That works too, and is cheaper! Thanks for pointing to that workaround! >> >> So, better version: >> > The patch is good, but I have a couple of nits below. Addressing them is > not a requirement for an ACK, though (even if I'd prefer to have them > addressed obviously). Feel free to push when you are ready. Ok, I have now pushed as below. Cheers, Peter >From 8525b870d5caa0a04858aa436ad6949ec277fc0c Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 10 Jan 2012 10:01:29 +0100 Subject: [PATCH] tap/awk: avoid redirection issues with bash 3.2 and earlier Fixes automake bug#10465. * lib/tap-driver.sh: Add workaround for bash 3.2 and earlier, which sometimes does not properly set '$?' when failing to write redirected output of a compound command. See the Autoconf manual for more details. The workaround was pointed out by Eric Blake. --- lib/tap-driver.sh | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh index c011298..725e779 100755 --- a/lib/tap-driver.sh +++ b/lib/tap-driver.sh @@ -115,7 +115,10 @@ else init_colors='' fi -{ +# :; is there to work around a bug in bash 3.2 (and earlier) which +# does not always set '$?' properly on redirection failure. +# See the Autoconf manual for more details. +:;{ ( # Ignore common signals (in this subshell only!), to avoid potential # problems with Korn shells. Some Korn shells are known to propagate -- 1.7.5.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 13 07:26:58 2012 Received: (at 10465) by debbugs.gnu.org; 13 Jan 2012 12:26:59 +0000 Received: from localhost ([127.0.0.1]:55930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RlgDf-00087c-BL for submit@debbugs.gnu.org; Fri, 13 Jan 2012 07:26:58 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:50087) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RlgDd-00087R-7G; Fri, 13 Jan 2012 07:26:53 -0500 Received: by wibhj6 with SMTP id hj6so357796wib.3 for ; Fri, 13 Jan 2012 04:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=W2G5C/eH4ZdQxKSpgFlzob51u9pj/OsUh0Dv4FFNgPs=; b=GiuLuIEBaKuHgBWqVm3a3C0OhSQokwha9F2FgFHJMXgVlCL5zjRHAM7omZw2Wrw5cG Ftddc6AysBrxMLFXQ6dgNuV3AHT3HMeMOvWKyvWb79TuasT8/TEzdOtbT/w1tWPws05Y S7xaW4FGcj2W8YkfGlRZUNvOnOsH+fRSFyHks= Received: by 10.180.102.169 with SMTP id fp9mr1366578wib.9.1326457575864; Fri, 13 Jan 2012 04:26:15 -0800 (PST) Received: from [82.56.38.186] (host186-38-dynamic.56-82-r.retail.telecomitalia.it. [82.56.38.186]) by mx.google.com with ESMTPS id k33sm10888073wbo.5.2012.01.13.04.26.14 (version=SSLv3 cipher=OTHER); Fri, 13 Jan 2012 04:26:14 -0800 (PST) Message-ID: <4F1022E5.6010208@gmail.com> Date: Fri, 13 Jan 2012 13:26:13 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Peter Rosin Subject: Re: bug#10465: MSYS read-only file trouble References: <4F0AC868.3060001@lysator.liu.se> <4F0B3A11.4040001@gmail.com> <4F0B3BE7.6080606@lysator.liu.se> <4F0B4591.3070105@gmail.com> <4F0B66C7.5010405@lysator.liu.se> <4F0B6D4E.2050108@lysator.liu.se> <4F0B7987.1040606@redhat.com> <4F0B7DC9.1000402@lysator.liu.se> <4F0BFB61.9050509@gmail.com> <4F0BFFD8.9080903@lysator.liu.se> In-Reply-To: <4F0BFFD8.9080903@lysator.liu.se> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10465 Cc: 10465@debbugs.gnu.org, Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 10465 patch close 10465 thanks On 01/10/2012 10:07 AM, Peter Rosin wrote: > Stefano Lattarini skrev 2012-01-10 09:48: >> Hi Eric, Peter, and thanks to both for the super-quick diagnosis and fix. >> >> On 01/10/2012 12:52 AM, Peter Rosin wrote: >>> Eric Blake skrev 2012-01-10 00:34: > *snip* >>>> Ah - the classic bash bug documented in the autoconf manual: >>>> > *snip* >>> >>> That works too, and is cheaper! Thanks for pointing to that workaround! >>> >>> So, better version: >>> >> The patch is good, but I have a couple of nits below. Addressing them is >> not a requirement for an ACK, though (even if I'd prefer to have them >> addressed obviously). Feel free to push when you are ready. > > Ok, I have now pushed. > > Cheers, > Peter > Thanks. I'm thus closing this bug. Regards, Stefano From unknown Mon Aug 18 11:10:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Feb 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator