X-Loop: help-debbugs@HIDDEN Subject: bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Normand <normand@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Wed, 03 Jul 2019 11:21:01 +0000 Resent-Message-ID: <handler.36488.B.15621528159084 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 36488 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-diffutils@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.15621528159084 (code B ref -1); Wed, 03 Jul 2019 11:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Jul 2019 11:20:15 +0000 Received: from localhost ([127.0.0.1]:48467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hidJ8-0002MR-IJ for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:34692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <normand@HIDDEN>) id 1hidJ7-0002MK-0B for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35818) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <normand@HIDDEN>) id 1hidJ5-0004Xw-KH for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, TVD_SUBJ_NUM_OBFU_MINFP,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ3-0003Fd-Pm for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ1-00036l-OK for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:09 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x63BHuHt038022 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 07:20:02 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tgs8jwjnw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for <bug-diffutils@HIDDEN>; Wed, 03 Jul 2019 07:20:01 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <bug-diffutils@HIDDEN> from <normand@HIDDEN>; Wed, 3 Jul 2019 12:19:59 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 3 Jul 2019 12:19:57 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x63BJuPi50593926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 156ED52050 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 +0000 (GMT) Received: from [9.134.167.79] (unknown [9.134.167.79]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id EDB475204E for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:55 +0000 (GMT) From: Normand <normand@HIDDEN> Date: Wed, 3 Jul 2019 13:19:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19070311-0016-0000-0000-0000028EC3A1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070311-0017-0000-0000-000032EC5C26 Message-Id: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=752 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907030136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) diffutils 3.7 make check failure ppc64le opensuse on colors test as reported in OBS tool (1) The extracted failure is a "Broken pipe" ``` [ 185s] XFAIL: large-subopt [ 185s] PASS: new-file [ 185s] PASS: no-dereference [ 186s] PASS: no-newline-at-eof [ 186s] PASS: stdin [ 186s] PASS: strcoll-0-names [ 186s] PASS: filename-quoting [ 187s] strip-trailing-cr: skipped test: requires a working valgrind [ 187s] SKIP: strip-trailing-cr [ 187s] FAIL: colors [ 187s] ============================================= [ 187s] GNU diffutils 3.7: tests/test-suite.log [ 187s] ============================================= [ 187s] [ 187s] # TOTAL: 22 [ 187s] # PASS: 19 [ 187s] # SKIP: 1 [ 187s] # XFAIL: 1 [ 187s] # FAIL: 1 [ 187s] # XPASS: 0 [ 187s] # ERROR: 0 ... [ 187s] FAIL: colors [ 187s] ============ ... [ 187s] + compare exp out [ 187s] + compare_dev_null_ exp out [ 187s] + test 2 = 2 [ 187s] + test xexp = x/dev/null [ 187s] + test xout = x/dev/null [ 187s] + return 2 [ 187s] + case $? in [ 187s] + compare_ exp out [ 187s] + diff -u exp out [ 187s] + mkfifo fifo [ 187s] + printf %1000000s-a [ 187s] + printf %1000000s-b [ 187s] + diff --color=always ---presume-output-tty a b [ 187s] + head -c 10 [ 187s] diff: standard output: Broken pipe [ 187s] + test 2 = 141 [ 187s] + fail=1 [ 187s] + Exit 1 ``` (1) https://build.opensuse.org/package/live_build_log/home:michel_mno:branches:Base:System/diffutils/openSUSE_Factory_PowerPC/ppc64le -- Michel Normand
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Normand <normand@HIDDEN> Subject: bug#36488: Acknowledgement (diffutils 3.7 make check failure ppc64le opensuse on colors test) Message-ID: <handler.36488.B.15621528159084.ack <at> debbugs.gnu.org> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Gnu-PR-Message: ack 36488 X-Gnu-PR-Package: diffutils Reply-To: 36488 <at> debbugs.gnu.org Date: Wed, 03 Jul 2019 11:21:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-diffutils@HIDDEN If you wish to submit further information on this problem, please send it to 36488 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Thiago Jung Bauermann <bauermann@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Sat, 28 Aug 2021 15:41:02 +0000 Resent-Message-ID: <handler.36488.B36488.163016525024990 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 36488 <at> debbugs.gnu.org Cc: Normand <normand@HIDDEN> Received: via spool by 36488-submit <at> debbugs.gnu.org id=B36488.163016525024990 (code B ref 36488); Sat, 28 Aug 2021 15:41:02 +0000 Received: (at 36488) by debbugs.gnu.org; 28 Aug 2021 15:40:50 +0000 Received: from localhost ([127.0.0.1]:54848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mK0Ru-0006V0-9q for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 11:40:50 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:57168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <bauermann@HIDDEN>) id 1mK0Rs-0006Um-Ih for 36488 <at> debbugs.gnu.org; Sat, 28 Aug 2021 11:40:49 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 7C1F91254; Sat, 28 Aug 2021 17:40:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1630165242; x=1631979643; bh=7GWIBuB1SDjphGGF+lZc/7MRKvABnEavbPa ZnXNvS1M=; b=rCTBs/Ub0Crg+hbPOn171KRAlK76LkyF9bDnzGKAvccKDNe3a9E OmMmTUh9ASBIsQzjWxXLIMf6/r4AP6Sq6wxdEGIFhfR49jN1CCuAF8SbaoODZl1h bxJhQ+yxo2g4Lwe9nRKhdrK+LTCqZuyeyMDhAqSK48bMm9pW45VjiHlPSaIAV3eL CNJ32H0xnouFZ//53oCxEl1OdFXTzVLAdeKTXrJ2gPvdTDYotItSfk66czVVqZMg 4Jbq1x9mo9kSHIkntYbka3dIOTm1fbyO3+1aXPKofTWHFts0HSiC1Y8MO7pwKTmD GfeaXNWKElPCEIskFUBkanO8Oe0mEDqHKZOBb0AZpCHPvFbsyxcu72mRZDgp6KEv ZkDVYmiFeMzKcMZ2/p6EazIMNOd53P6edXdetaFOKG5GkRT+Yqkqkcyfb0sIrh+R j+YzzbMdvdGoiyyP0m4TzJh23Z9jlCrxFDILyvUfDyNuTYnHK+9yPJ/zcnTbeN3k ein9u8nvIipc+GyGIfYbVitQiQMpvGJNpOb/bNz5zq++UxZi2GSNFOE+fPNRSO8A yj2ckPwxAUgHNtxA5ekdNFWrh7FTvHsOuKsroU8AlLqBgRuEiQPyWX1k6JKJDQf5 2BjgZcOrLTlu0/0Kf9u7K8VHWvtjr18qqez+npmnX+fmAAhinjYrSfjE= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bx0d52jHE2hu; Sat, 28 Aug 2021 17:40:42 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id E7EDD51E; Sat, 28 Aug 2021 17:40:41 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 7BB76363D; Sat, 28 Aug 2021 17:40:40 +0200 (CEST) From: Thiago Jung Bauermann <bauermann@HIDDEN> Date: Sat, 28 Aug 2021 12:40:35 -0300 Message-ID: <10257051.elIQoDPIPK@popigai> In-Reply-To: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Em quarta-feira, 3 de julho de 2019, =E0s 08:19:55 -03, Normand escreveu: > diffutils 3.7 make check failure ppc64le opensuse on colors test as > reported in OBS tool (1) >=20 >=20 > The extracted failure is a "Broken pipe" I believe this is the same problem reported in bug 34519. The Debian build also fails with "diff: standard output: Broken pipe". =2D-=20 Thanks, Thiago
Received: (at control) by debbugs.gnu.org; 29 Aug 2021 06:55:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 29 02:55:14 2021 Received: from localhost ([127.0.0.1]:55426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKEio-00077t-2D for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 02:55:14 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKEim-00077c-A6 for control <at> debbugs.gnu.org; Sun, 29 Aug 2021 02:55:12 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BD051160071 for <control <at> debbugs.gnu.org>; Sat, 28 Aug 2021 23:55:06 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PwTJ2m316BQX for <control <at> debbugs.gnu.org>; Sat, 28 Aug 2021 23:55:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1781E160100 for <control <at> debbugs.gnu.org>; Sat, 28 Aug 2021 23:55:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kSImc7qbv923 for <control <at> debbugs.gnu.org>; Sat, 28 Aug 2021 23:55:05 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DC1CA160071 for <control <at> debbugs.gnu.org>; Sat, 28 Aug 2021 23:55:05 -0700 (PDT) To: control <at> debbugs.gnu.org From: Paul Eggert <eggert@HIDDEN> Subject: 36488 and 34519 are the same bug Organization: UCLA Computer Science Department Message-ID: <856f8b61-11af-b993-5aa8-4ce5d8169eb9@HIDDEN> Date: Sat, 28 Aug 2021 23:55:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) merge 34519 36488
Received: (at control) by debbugs.gnu.org; 29 Aug 2021 07:19:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 29 03:19:22 2021 Received: from localhost ([127.0.0.1]:55435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF6A-0001PT-A4 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:19:22 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:38792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF68-0001PE-6J for control <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:19:21 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1F1C0160071 for <control <at> debbugs.gnu.org>; Sun, 29 Aug 2021 00:19:14 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dwIFJQCq4pVB for <control <at> debbugs.gnu.org>; Sun, 29 Aug 2021 00:19:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6E257160105 for <control <at> debbugs.gnu.org>; Sun, 29 Aug 2021 00:19:13 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XhLpFBGWDIJp for <control <at> debbugs.gnu.org>; Sun, 29 Aug 2021 00:19:13 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 06AC0160102 for <control <at> debbugs.gnu.org>; Sun, 29 Aug 2021 00:19:13 -0700 (PDT) To: control <at> debbugs.gnu.org From: Paul Eggert <eggert@HIDDEN> Subject: 25402 is same as 36488 Organization: UCLA Computer Science Department Message-ID: <99c1a105-c057-8b36-f6bd-b8932c8f8787@HIDDEN> Date: Sun, 29 Aug 2021 00:19:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) merge 25402 36488
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Paul Eggert <eggert@HIDDEN> Subject: bug#36488: closed (diffutils 3.7 make check failure ppc64le opensuse on colors test) CC: tracker <at> debbugs.gnu.org Message-ID: <handler.36488.D36488.16302217685787.ackdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Gnu-PR-Message: closed 36488 X-Gnu-PR-Package: diffutils Date: Sun, 29 Aug 2021 07:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221782-5833-0" This is a multi-part message in MIME format... ------------=_1630221782-5833-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 29 Aug 2021 00:22:27 -0700 with message-id <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> and subject line Re: [bug-diffutils] bug#36488: diffutils 3.7 make check fa= ilure ppc64le opensuse on colors test has caused the debbugs.gnu.org bug report #36488, regarding diffutils 3.7 make check failure ppc64le opensuse on colors test to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@HIDDEN) --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221782-5833-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Jul 2019 11:20:15 +0000 Received: from localhost ([127.0.0.1]:48467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hidJ8-0002MR-IJ for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:34692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <normand@HIDDEN>) id 1hidJ7-0002MK-0B for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35818) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <normand@HIDDEN>) id 1hidJ5-0004Xw-KH for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, TVD_SUBJ_NUM_OBFU_MINFP,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ3-0003Fd-Pm for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ1-00036l-OK for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:09 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x63BHuHt038022 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 07:20:02 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tgs8jwjnw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for <bug-diffutils@HIDDEN>; Wed, 03 Jul 2019 07:20:01 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <bug-diffutils@HIDDEN> from <normand@HIDDEN>; Wed, 3 Jul 2019 12:19:59 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 3 Jul 2019 12:19:57 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x63BJuPi50593926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 156ED52050 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 +0000 (GMT) Received: from [9.134.167.79] (unknown [9.134.167.79]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id EDB475204E for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:55 +0000 (GMT) To: bug-diffutils@HIDDEN From: Normand <normand@HIDDEN> Subject: diffutils 3.7 make check failure ppc64le opensuse on colors test Date: Wed, 3 Jul 2019 13:19:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19070311-0016-0000-0000-0000028EC3A1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070311-0017-0000-0000-000032EC5C26 Message-Id: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=752 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907030136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) diffutils 3.7 make check failure ppc64le opensuse on colors test as reported in OBS tool (1) The extracted failure is a "Broken pipe" ``` [ 185s] XFAIL: large-subopt [ 185s] PASS: new-file [ 185s] PASS: no-dereference [ 186s] PASS: no-newline-at-eof [ 186s] PASS: stdin [ 186s] PASS: strcoll-0-names [ 186s] PASS: filename-quoting [ 187s] strip-trailing-cr: skipped test: requires a working valgrind [ 187s] SKIP: strip-trailing-cr [ 187s] FAIL: colors [ 187s] ============================================= [ 187s] GNU diffutils 3.7: tests/test-suite.log [ 187s] ============================================= [ 187s] [ 187s] # TOTAL: 22 [ 187s] # PASS: 19 [ 187s] # SKIP: 1 [ 187s] # XFAIL: 1 [ 187s] # FAIL: 1 [ 187s] # XPASS: 0 [ 187s] # ERROR: 0 ... [ 187s] FAIL: colors [ 187s] ============ ... [ 187s] + compare exp out [ 187s] + compare_dev_null_ exp out [ 187s] + test 2 = 2 [ 187s] + test xexp = x/dev/null [ 187s] + test xout = x/dev/null [ 187s] + return 2 [ 187s] + case $? in [ 187s] + compare_ exp out [ 187s] + diff -u exp out [ 187s] + mkfifo fifo [ 187s] + printf %1000000s-a [ 187s] + printf %1000000s-b [ 187s] + diff --color=always ---presume-output-tty a b [ 187s] + head -c 10 [ 187s] diff: standard output: Broken pipe [ 187s] + test 2 = 141 [ 187s] + fail=1 [ 187s] + Exit 1 ``` (1) https://build.opensuse.org/package/live_build_log/home:michel_mno:branches:Base:System/diffutils/openSUSE_Factory_PowerPC/ppc64le -- Michel Normand ------------=_1630221782-5833-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221782-5833-0--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Normand <normand@HIDDEN> Subject: bug#36488: closed (Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test) Message-ID: <handler.36488.D36488.16302217685787.notifdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Gnu-PR-Message: they-closed 36488 X-Gnu-PR-Package: diffutils Reply-To: 36488 <at> debbugs.gnu.org Date: Sun, 29 Aug 2021 07:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221782-5833-1" This is a multi-part message in MIME format... ------------=_1630221782-5833-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36488: diffutils 3.7 make check failure ppc64le opensuse on colors test which was filed against the diffutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 36488 <at> debbugs.gnu.org. --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221782-5833-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221782-5833-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Jul 2019 11:20:15 +0000 Received: from localhost ([127.0.0.1]:48467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hidJ8-0002MR-IJ for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:34692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <normand@HIDDEN>) id 1hidJ7-0002MK-0B for submit <at> debbugs.gnu.org; Wed, 03 Jul 2019 07:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35818) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from <normand@HIDDEN>) id 1hidJ5-0004Xw-KH for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, TVD_SUBJ_NUM_OBFU_MINFP,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ3-0003Fd-Pm for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <normand@HIDDEN>) id 1hidJ1-00036l-OK for bug-diffutils@HIDDEN; Wed, 03 Jul 2019 07:20:09 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x63BHuHt038022 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 07:20:02 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tgs8jwjnw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for <bug-diffutils@HIDDEN>; Wed, 03 Jul 2019 07:20:01 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <bug-diffutils@HIDDEN> from <normand@HIDDEN>; Wed, 3 Jul 2019 12:19:59 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 3 Jul 2019 12:19:57 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x63BJuPi50593926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 156ED52050 for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:56 +0000 (GMT) Received: from [9.134.167.79] (unknown [9.134.167.79]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id EDB475204E for <bug-diffutils@HIDDEN>; Wed, 3 Jul 2019 11:19:55 +0000 (GMT) To: bug-diffutils@HIDDEN From: Normand <normand@HIDDEN> Subject: diffutils 3.7 make check failure ppc64le opensuse on colors test Date: Wed, 3 Jul 2019 13:19:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19070311-0016-0000-0000-0000028EC3A1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070311-0017-0000-0000-000032EC5C26 Message-Id: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=752 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907030136 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) diffutils 3.7 make check failure ppc64le opensuse on colors test as reported in OBS tool (1) The extracted failure is a "Broken pipe" ``` [ 185s] XFAIL: large-subopt [ 185s] PASS: new-file [ 185s] PASS: no-dereference [ 186s] PASS: no-newline-at-eof [ 186s] PASS: stdin [ 186s] PASS: strcoll-0-names [ 186s] PASS: filename-quoting [ 187s] strip-trailing-cr: skipped test: requires a working valgrind [ 187s] SKIP: strip-trailing-cr [ 187s] FAIL: colors [ 187s] ============================================= [ 187s] GNU diffutils 3.7: tests/test-suite.log [ 187s] ============================================= [ 187s] [ 187s] # TOTAL: 22 [ 187s] # PASS: 19 [ 187s] # SKIP: 1 [ 187s] # XFAIL: 1 [ 187s] # FAIL: 1 [ 187s] # XPASS: 0 [ 187s] # ERROR: 0 ... [ 187s] FAIL: colors [ 187s] ============ ... [ 187s] + compare exp out [ 187s] + compare_dev_null_ exp out [ 187s] + test 2 = 2 [ 187s] + test xexp = x/dev/null [ 187s] + test xout = x/dev/null [ 187s] + return 2 [ 187s] + case $? in [ 187s] + compare_ exp out [ 187s] + diff -u exp out [ 187s] + mkfifo fifo [ 187s] + printf %1000000s-a [ 187s] + printf %1000000s-b [ 187s] + diff --color=always ---presume-output-tty a b [ 187s] + head -c 10 [ 187s] diff: standard output: Broken pipe [ 187s] + test 2 = 141 [ 187s] + fail=1 [ 187s] + Exit 1 ``` (1) https://build.opensuse.org/package/live_build_log/home:michel_mno:branches:Base:System/diffutils/openSUSE_Factory_PowerPC/ppc64le -- Michel Normand ------------=_1630221782-5833-1--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Paul Eggert <eggert@HIDDEN> Subject: bug#25402: closed (Race condition in "colors" test) CC: tracker <at> debbugs.gnu.org Message-ID: <handler.25402.D36488.16302217685787.ackdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <alpine.DEB.2.20.1701082322140.581@HIDDEN> X-Gnu-PR-Message: closed 25402 X-Gnu-PR-Package: diffutils Date: Sun, 29 Aug 2021 07:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221782-5833-2" This is a multi-part message in MIME format... ------------=_1630221782-5833-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 29 Aug 2021 00:22:27 -0700 with message-id <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> and subject line Re: [bug-diffutils] bug#36488: diffutils 3.7 make check fa= ilure ppc64le opensuse on colors test has caused the debbugs.gnu.org bug report #36488, regarding Race condition in "colors" test to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@HIDDEN) --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221782-5833-2 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Jan 2017 22:36:11 +0000 Received: from localhost ([127.0.0.1]:47191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1cQM4R-0006fJ-6e for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sanvila@HIDDEN>) id 1cQM4Q-0006f4-0D for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4J-00008J-Ar for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4J-000086-6x for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4H-0003Yt-Nx for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4C-00006x-Pn for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:36:01 -0500 Received: from zmta02.unex.es ([158.49.17.56]:49949) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4C-0008F3-I1 for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:35:56 -0500 Received: from localhost (localhost [127.0.0.1]) by zmta02.unex.es (Postfix) with ESMTP id 45D9F60F14; Sun, 8 Jan 2017 23:35:13 +0100 (CET) Received: from zmta02.unex.es ([127.0.0.1]) by localhost (zmta02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FwT7QakKEWkK; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmta02.unex.es (Postfix) with ESMTP id 39AE360F3B; Sun, 8 Jan 2017 23:35:10 +0100 (CET) X-Virus-Scanned: amavisd-new at zmta02.siue Received: from zmta02.unex.es ([127.0.0.1]) by localhost (zmta02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ISCADcYlN73k; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from zproxy02.unex.es (zproxy02.servicios.unex.es [10.254.208.62]) by zmta02.unex.es (Postfix) with ESMTPS id 0B47A60F14; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy02.unex.es (Postfix) with ESMTP id F2E9761025; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from zproxy02.unex.es ([127.0.0.1]) by localhost (zproxy02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hqGNKcT75Eh8; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy02.unex.es (Postfix) with ESMTP id 6951261007; Sun, 8 Jan 2017 23:35:09 +0100 (CET) X-Virus-Scanned: amavisd-new at zproxy02.siue Received: from zproxy02.unex.es ([127.0.0.1]) by localhost (zproxy02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nSdOnXc_HkfD; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from cantor.unex.es (cantor.unex.es [158.49.50.20]) by zproxy02.unex.es (Postfix) with ESMTPSA id 3FAD260EC9; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: by cantor.unex.es (Postfix, from userid 1000) id E0080612A8; Sun, 8 Jan 2017 23:35:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cantor.unex.es (Postfix) with ESMTP id D1974612A5; Sun, 8 Jan 2017 23:35:08 +0100 (CET) Date: Sun, 8 Jan 2017 23:35:08 +0100 (CET) From: Santiago Vila <sanvila@HIDDEN> To: bug-diffutils@HIDDEN Subject: Race condition in "colors" test Message-ID: <alpine.DEB.2.20.1701082322140.581@HIDDEN> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-Debbugs-Cc: sanvila@HIDDEN,debian.axhn@HIDDEN MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: debian.axhn@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.0 (----) Hello. The test suite for diffutils 3.5 has a tendency to fail in our ppc64el architecture: https://buildd.debian.org/status/logs.php?pkg=diffutils&ver=1%3A3.5-2&arch=ppc64el According to Christoph Biedl (Cc:ed), there is a race condition here: | mkfifo fifo | printf '%*s-a' 1000000 > a | head -c 10 < fifo > /dev/null & + diff --color=always ---presume-output-tty a b > fifo | test $? = 141 || fail=1 Quoting Christoph: > There is a race condition involved, it fails in about three of > four attempts - but not at all if the test is run under strace. > A "sleep 0.1" before the diff made the test pass in ten of ten > attempts. So the reason might indeed be the head command hasn't opened > fifo yet by the time diff tries to write to it. For the Debian package, I am going to add a "sleep 1" (slightly more portable), but Christoph points out that this should not really be architecture specific. Thanks. ------------=_1630221782-5833-2 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221782-5833-2--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Santiago Vila <sanvila@HIDDEN> Subject: bug#25402: closed (Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test) Message-ID: <handler.25402.D36488.16302217685787.notifdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <alpine.DEB.2.20.1701082322140.581@HIDDEN> X-Gnu-PR-Message: they-closed 25402 X-Gnu-PR-Package: diffutils Reply-To: 25402 <at> debbugs.gnu.org Date: Sun, 29 Aug 2021 07:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221783-5833-3" This is a multi-part message in MIME format... ------------=_1630221783-5833-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36488: Race condition in "colors" test which was filed against the diffutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25402 <at> debbugs.gnu.org. --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221783-5833-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221783-5833-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Jan 2017 22:36:11 +0000 Received: from localhost ([127.0.0.1]:47191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1cQM4R-0006fJ-6e for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sanvila@HIDDEN>) id 1cQM4Q-0006f4-0D for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4J-00008J-Ar for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4J-000086-6x for submit <at> debbugs.gnu.org; Sun, 08 Jan 2017 17:36:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4H-0003Yt-Nx for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:36:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4C-00006x-Pn for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:36:01 -0500 Received: from zmta02.unex.es ([158.49.17.56]:49949) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1cQM4C-0008F3-I1 for bug-diffutils@HIDDEN; Sun, 08 Jan 2017 17:35:56 -0500 Received: from localhost (localhost [127.0.0.1]) by zmta02.unex.es (Postfix) with ESMTP id 45D9F60F14; Sun, 8 Jan 2017 23:35:13 +0100 (CET) Received: from zmta02.unex.es ([127.0.0.1]) by localhost (zmta02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FwT7QakKEWkK; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmta02.unex.es (Postfix) with ESMTP id 39AE360F3B; Sun, 8 Jan 2017 23:35:10 +0100 (CET) X-Virus-Scanned: amavisd-new at zmta02.siue Received: from zmta02.unex.es ([127.0.0.1]) by localhost (zmta02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ISCADcYlN73k; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from zproxy02.unex.es (zproxy02.servicios.unex.es [10.254.208.62]) by zmta02.unex.es (Postfix) with ESMTPS id 0B47A60F14; Sun, 8 Jan 2017 23:35:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy02.unex.es (Postfix) with ESMTP id F2E9761025; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from zproxy02.unex.es ([127.0.0.1]) by localhost (zproxy02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hqGNKcT75Eh8; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy02.unex.es (Postfix) with ESMTP id 6951261007; Sun, 8 Jan 2017 23:35:09 +0100 (CET) X-Virus-Scanned: amavisd-new at zproxy02.siue Received: from zproxy02.unex.es ([127.0.0.1]) by localhost (zproxy02.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nSdOnXc_HkfD; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: from cantor.unex.es (cantor.unex.es [158.49.50.20]) by zproxy02.unex.es (Postfix) with ESMTPSA id 3FAD260EC9; Sun, 8 Jan 2017 23:35:09 +0100 (CET) Received: by cantor.unex.es (Postfix, from userid 1000) id E0080612A8; Sun, 8 Jan 2017 23:35:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cantor.unex.es (Postfix) with ESMTP id D1974612A5; Sun, 8 Jan 2017 23:35:08 +0100 (CET) Date: Sun, 8 Jan 2017 23:35:08 +0100 (CET) From: Santiago Vila <sanvila@HIDDEN> To: bug-diffutils@HIDDEN Subject: Race condition in "colors" test Message-ID: <alpine.DEB.2.20.1701082322140.581@HIDDEN> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) X-Debbugs-Cc: sanvila@HIDDEN,debian.axhn@HIDDEN MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: debian.axhn@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.0 (----) Hello. The test suite for diffutils 3.5 has a tendency to fail in our ppc64el architecture: https://buildd.debian.org/status/logs.php?pkg=diffutils&ver=1%3A3.5-2&arch=ppc64el According to Christoph Biedl (Cc:ed), there is a race condition here: | mkfifo fifo | printf '%*s-a' 1000000 > a | head -c 10 < fifo > /dev/null & + diff --color=always ---presume-output-tty a b > fifo | test $? = 141 || fail=1 Quoting Christoph: > There is a race condition involved, it fails in about three of > four attempts - but not at all if the test is run under strace. > A "sleep 0.1" before the diff made the test pass in ten of ten > attempts. So the reason might indeed be the head command hasn't opened > fifo yet by the time diff tries to write to it. For the Debian package, I am going to add a "sleep 1" (slightly more portable), but Christoph points out that this should not really be architecture specific. Thanks. ------------=_1630221783-5833-3--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Paul Eggert <eggert@HIDDEN> Subject: bug#34519: closed (Test "colors" fails on Debian/ppc64el) CC: tracker <at> debbugs.gnu.org Message-ID: <handler.34519.D36488.16302217685787.ackdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <alpine.DEB.2.20.1902180147100.13056@HIDDEN> X-Gnu-PR-Message: closed 34519 X-Gnu-PR-Package: diffutils Date: Sun, 29 Aug 2021 07:23:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221783-5833-4" This is a multi-part message in MIME format... ------------=_1630221783-5833-4 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Sun, 29 Aug 2021 00:22:27 -0700 with message-id <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> and subject line Re: [bug-diffutils] bug#36488: diffutils 3.7 make check fa= ilure ppc64le opensuse on colors test has caused the debbugs.gnu.org bug report #36488, regarding Test "colors" fails on Debian/ppc64el to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@HIDDEN) --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221783-5833-4 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Feb 2019 01:02:55 +0000 Received: from localhost ([127.0.0.1]:51868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gvXKg-0006uB-Q4 for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sanvila@HIDDEN>) id 1gvXKf-0006tw-6m for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:53 -0500 Received: from lists.gnu.org ([209.51.188.17]:51297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKV-0005ma-Ku for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKU-00069V-QV for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKN-0005lI-HD for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:37 -0500 Received: from zmta01.unex.es ([158.49.17.55]:51680) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKG-0005kK-C7 for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:29 -0500 Received: from localhost (localhost [127.0.0.1]) by zmta01.unex.es (Postfix) with ESMTP id 29C1C60057 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:19 +0100 (CET) Received: from zmta01.unex.es ([127.0.0.1]) by localhost (zmta01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 1MP0Ll14gzbo for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmta01.unex.es (Postfix) with ESMTP id 3A21E60059 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) X-Virus-Scanned: amavisd-new at zmta01.siue Received: from zmta01.unex.es ([127.0.0.1]) by localhost (zmta01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4iqPI652gwXi for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from zproxy01.unex.es (zproxy01.servicios.unex.es [10.254.208.61]) by zmta01.unex.es (Postfix) with ESMTPS id 0E87760057 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy01.unex.es (Postfix) with ESMTP id 019CB80A30 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from zproxy01.unex.es ([127.0.0.1]) by localhost (zproxy01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Y2BySg7FImnQ for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy01.unex.es (Postfix) with ESMTP id 8AA1480A45 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) X-Virus-Scanned: amavisd-new at zproxy01.siue Received: from zproxy01.unex.es ([127.0.0.1]) by localhost (zproxy01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id r4vLvLKLmh16 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) Received: from tulipan.isla-invisible.es (tulipan.isla-invisible.es [185.92.222.134]) by zproxy01.unex.es (Postfix) with ESMTPSA id 4ED0880A30 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:10 +0100 (CET) Received: by tulipan.isla-invisible.es (Postfix, from userid 1000) id 18B301700; Mon, 18 Feb 2019 01:57:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by tulipan.isla-invisible.es (Postfix) with ESMTP id 0C0FC103E for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:09 +0100 (CET) Date: Mon, 18 Feb 2019 01:57:09 +0100 (CET) From: Santiago Vila <sanvila@HIDDEN> To: bug-diffutils@HIDDEN Subject: Test "colors" fails on Debian/ppc64el Message-ID: <alpine.DEB.2.20.1902180147100.13056@HIDDEN> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 158.49.17.55 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hello. I've just uploaded diffutils 3.7 for Debian unstable (hopefully to be part of Debian 10, since it contains only small fixes). But there is a problem: The build in the ppc64el autobuilder failed: https://buildd.debian.org/status/logs.php?pkg=diffutils&ver=1%3A3.7-1&arch=ppc64el In tests/colors there was a race condition which I tried to fix by adding a "sleep 1", like this: mkfifo fifo printf '%1000000s-a' > a printf '%1000000s-b' > b head -c 10 < fifo > /dev/null & sleep 1 diff --color=always ---presume-output-tty a b > fifo test $? = 141 || fail=1 It is possible that the "head" command takes (sometimes) more than one second to complete on ppc64el? Are there any other places in the test where a race condition could be happening? Thanks. ------------=_1630221783-5833-4 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221783-5833-4--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Santiago Vila <sanvila@HIDDEN> Subject: bug#34519: closed (Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test) Message-ID: <handler.34519.D36488.16302217685787.notifdone <at> debbugs.gnu.org> References: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <alpine.DEB.2.20.1902180147100.13056@HIDDEN> X-Gnu-PR-Message: they-closed 34519 X-Gnu-PR-Package: diffutils Reply-To: 34519 <at> debbugs.gnu.org Date: Sun, 29 Aug 2021 07:23:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1630221783-5833-5" This is a multi-part message in MIME format... ------------=_1630221783-5833-5 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36488: Test "colors" fails on Debian/ppc64el which was filed against the diffutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 34519 <at> debbugs.gnu.org. --=20 36488: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1630221783-5833-5 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36488-done) by debbugs.gnu.org; 29 Aug 2021 07:22:48 +0000 Received: from localhost ([127.0.0.1]:55443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKF9Q-0001VB-15 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKF9K-0001Ut-9Z for 36488-done <at> debbugs.gnu.org; Sun, 29 Aug 2021 03:22:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F0BB9160071; Sun, 29 Aug 2021 00:22:32 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iN6NPjbfglo6; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25259160100; Sun, 29 Aug 2021 00:22:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PQoocUNRyQwE; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C258C160071; Sun, 29 Aug 2021 00:22:27 -0700 (PDT) To: Thiago Jung Bauermann <bauermann@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Subject: Re: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Message-ID: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Date: Sun, 29 Aug 2021 00:22:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <10257051.elIQoDPIPK@popigai> Content-Type: multipart/mixed; boundary="------------C283A678C824E5E9AFF4010F" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 36488-done Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb25uYXJk?= <frediz@HIDDEN>, 922552@HIDDEN, Santiago Vila <sanvila@HIDDEN>, 36488-done <at> debbugs.gnu.org, Normand <normand@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------C283A678C824E5E9AFF4010F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All=20 diffutils discussion. wrote: > I believe this is the same problem reported in bug 34519. > The Debian build also fails with "diff: standard output: Broken pipe". Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in=20 <https://bugs.debian.org/922552#19> was helpful. I found some time to look into this bug, and installed into=20 Savannah.gnu.org diffutils the attached patch, which I hope fixes the=20 bug although I don't have the relevant platform to test it. Please give=20 it a try. Once this patch is part of a release, Debian shouldn't need any patches=20 for diffutils. For now I am closing the diffutils bug report=20 <https://bugs.gnu.org/36488>; if I was too optimistic and the patch=20 doesn't fix things we can always reopen it. --------------C283A678C824E5E9AFF4010F Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-cleanup-signal-handling-just-before-exit.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-diff-cleanup-signal-handling-just-before-exit.patch" =46rom 9b20182d48481c7ca647ff8926feeb8e1da4f7b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sat, 28 Aug 2021 23:49:32 -0700 Subject: [PATCH] diff: cleanup signal handling just before exit MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This should fix an unlikely signal handling bug with colored output, and should also fix a Debian FTBFS (Fails To Build From Source) on powerpc64le-linux. See Bug#34519 and Fr=C3=A9d=C3=A9ric Bonnard=E2=80=99s report in: https://bugs.debian.org/922552#19 * bootstrap.conf (gnulib_modules): Add raise, sigprocmask. * src/diff.c (main): Call cleanup_signal_handlers before exiting. Don=E2=80=99t bother calling =E2=80=98exit=E2=80=99; no longer needed now= adays. * src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]: Define to 0 instead of empty, since the results are now used. (sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib. (xsigaction) [SA_NOCLDSTOP]: New function. (xsigaddset, xsigismember, xsignal, xsigprocmask): New functions. (some_signals_caught): New static var. (process_signals): Omit a conditional branch. Don=E2=80=99t bother loading interrupt_signal if stop_signal_count is non= zero. (process_signals, install_signal_handlers): Check for failures from sigprocmask etc. (sig, nsig): Now at top level, since multiple functions need them. (install_signal_handlers): No need for caught_sig array; just use caught_signals. However, set some_signals_caught. (cleanup_signal_handlers): New function. --- bootstrap.conf | 2 + src/diff.c | 2 +- src/diff.h | 1 + src/util.c | 187 ++++++++++++++++++++++++++++++++----------------- 4 files changed, 127 insertions(+), 65 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 6560e9a..e51b2d8 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -65,11 +65,13 @@ mktime nstrftime progname propername +raise rawmemchr readme-release regex sh-quote signal +sigprocmask stat stat-macros stat-time diff --git a/src/diff.c b/src/diff.c index a4e5538..3b901aa 100644 --- a/src/diff.c +++ b/src/diff.c @@ -853,7 +853,7 @@ main (int argc, char **argv) print_message_queue (); =20 check_stdout (); - exit (exit_status); + cleanup_signal_handlers (); return exit_status; } =20 diff --git a/src/diff.h b/src/diff.h index 03f00a6..f346b43 100644 --- a/src/diff.h +++ b/src/diff.h @@ -388,6 +388,7 @@ extern struct change *find_change (struct change *); extern struct change *find_reverse_change (struct change *); extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, = lin *); extern void begin_output (void); +extern void cleanup_signal_handlers (void); extern void debug_script (struct change *); extern void fatal (char const *) __attribute__((noreturn)); extern void finish_output (void); diff --git a/src/util.c b/src/util.c index dd6d3bf..8e676c8 100644 --- a/src/util.c +++ b/src/util.c @@ -31,10 +31,9 @@ present. */ #ifndef SA_NOCLDSTOP # define SA_NOCLDSTOP 0 -# define sigprocmask(How, Set, Oset) /* empty */ -# define sigset_t int +# define sigprocmask(How, Set, Oset) 0 # if ! HAVE_SIGINTERRUPT -# define siginterrupt(sig, flag) /* empty */ +# define siginterrupt(sig, flag) 0 # endif #endif =20 @@ -160,16 +159,63 @@ print_message_queue (void) } } =0C -/* The set of signals that are caught. */ =20 +#if SA_NOCLDSTOP +static void +xsigaction (int sig, struct sigaction const *restrict act, + struct sigaction *restrict oact) +{ + if (sigaction (sig, act, oact) !=3D 0) + pfatal_with_name ("sigaction"); +} +#endif + +static void +xsigaddset (sigset_t *set, int sig) +{ + if (sigaddset (set, sig) !=3D 0) + pfatal_with_name ("sigaddset"); +} + +static bool +xsigismember (sigset_t const *set, int sig) +{ + int mem =3D sigismember (set, sig); + if (mem < 0) + pfatal_with_name ("sigismember"); + assume (mem =3D=3D 1); + return mem; +} + +typedef void (*signal_handler) (int); +static signal_handler +xsignal (int sig, signal_handler func) +{ + signal_handler h =3D signal (sig, func); + if (h =3D=3D SIG_ERR) + pfatal_with_name ("signal"); + return h; +} + +static void +xsigprocmask (int how, sigset_t const *restrict set, sigset_t *restrict = oset) +{ + if (sigprocmask (how, set, oset) !=3D 0) + pfatal_with_name ("sigprocmask"); +} + +/* If true, some signals are caught. This is separate from + 'caught_signals' because POSIX doesn't require an all-zero sigset_t + to be valid. */ +static bool some_signals_caught; + +/* The set of signals that are caught. */ static sigset_t caught_signals; =20 /* If nonzero, the value of the pending fatal signal. */ - static sig_atomic_t volatile interrupt_signal; =20 /* A count of the number of pending stop signals that have been received= =2E */ - static sig_atomic_t volatile stop_signal_count; =20 /* An ordinary signal was received; arrange for the program to exit. */= @@ -202,21 +248,17 @@ stophandler (int sig) static void process_signals (void) { - while (interrupt_signal || stop_signal_count) + while (interrupt_signal | stop_signal_count) { - int sig; - int stops; - sigset_t oldset; - set_color_context (RESET_CONTEXT); fflush (stdout); =20 - sigprocmask (SIG_BLOCK, &caught_signals, &oldset); + sigset_t oldset; + xsigprocmask (SIG_BLOCK, &caught_signals, &oldset); =20 - /* Reload interrupt_signal and stop_signal_count, in case a new - signal was handled before sigprocmask took effect. */ - sig =3D interrupt_signal; - stops =3D stop_signal_count; + /* Reload stop_signal_count and (if needed) interrupt_signal, in + case a new signal was handled before sigprocmask took effect. */ + int stops =3D stop_signal_count, sig; =20 /* SIGTSTP is special, since the application can receive that sign= al more than once. In this case, don't set the signal handler to = the @@ -227,82 +269,99 @@ process_signals (void) sig =3D SIGSTOP; } else - signal (sig, SIG_DFL); + { + sig =3D interrupt_signal; + xsignal (sig, SIG_DFL); + } =20 /* Exit or suspend the program. */ - raise (sig); - sigprocmask (SIG_SETMASK, &oldset, NULL); + if (raise (sig) !=3D 0) + pfatal_with_name ("raise"); + xsigprocmask (SIG_SETMASK, &oldset, NULL); =20 /* If execution reaches here, then the program has been continued (after being suspended). */ } } =20 -static void -install_signal_handlers (void) -{ - /* The signals that are trapped, and the number of such signals. */ - static int const sig[] =3D - { - /* This one is handled specially. */ - SIGTSTP, +/* The signals that can be caught, the number of such signals, + and which of them are actually caught. */ +static int const sig[] =3D + { + /* This one is handled specially. */ + SIGTSTP, =20 - /* The usual suspects. */ - SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, #ifdef SIGPOLL - SIGPOLL, + SIGPOLL, #endif #ifdef SIGPROF - SIGPROF, + SIGPROF, #endif #ifdef SIGVTALRM - SIGVTALRM, + SIGVTALRM, #endif #ifdef SIGXCPU - SIGXCPU, + SIGXCPU, #endif #ifdef SIGXFSZ - SIGXFSZ, + SIGXFSZ, #endif - }; - enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + }; +enum { nsigs =3D sizeof (sig) / sizeof *(sig) }; + +static void +install_signal_handlers (void) +{ + if (sigemptyset (&caught_signals) !=3D 0) + pfatal_with_name ("sigemptyset"); =20 -#if ! SA_NOCLDSTOP - bool caught_sig[nsigs]; -#endif - { - int j; #if SA_NOCLDSTOP - struct sigaction act; + for (int j =3D 0; j < nsigs; j++) + { + struct sigaction actj; + xsigaction (sig[j], NULL, &actj); + if (actj.sa_handler !=3D SIG_IGN) + xsigaddset (&caught_signals, sig[j]); + } =20 - sigemptyset (&caught_signals); - for (j =3D 0; j < nsigs; j++) + struct sigaction act; + act.sa_mask =3D caught_signals; + act.sa_flags =3D SA_RESTART; + + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) { - sigaction (sig[j], NULL, &act); - if (act.sa_handler !=3D SIG_IGN) - sigaddset (&caught_signals, sig[j]); + act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sighandler; + xsigaction (sig[j], &act, NULL); + some_signals_caught =3D true; } - - act.sa_mask =3D caught_signals; - act.sa_flags =3D SA_RESTART; - - for (j =3D 0; j < nsigs; j++) - if (sigismember (&caught_signals, sig[j])) - { - act.sa_handler =3D sig[j] =3D=3D SIGTSTP ? stophandler : sigha= ndler; - sigaction (sig[j], &act, NULL); - } #else - for (j =3D 0; j < nsigs; j++) + for (int j =3D 0; j < nsigs; j++) + if (xsignal (sig[j], SIG_IGN) !=3D SIG_IGN) { - caught_sig[j] =3D (signal (sig[j], SIG_IGN) !=3D SIG_IGN); - if (caught_sig[j]) - { - signal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighan= dler); - siginterrupt (sig[j], 0); - } + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] =3D=3D SIGTSTP ? stophandler : sighandler); + some_signals_caught =3D true; + if (siginterrupt (sig[j], 0) !=3D 0) + pfatal_with_name ("siginterrupt"); } #endif +} + +/* Clean up signal handlers just before exiting the program. Do this + by resetting signal actions back to default, and then processing + any signals that arrived before resetting. */ +void +cleanup_signal_handlers (void) +{ + if (some_signals_caught) + { + for (int j =3D 0; j < nsigs; j++) + if (xsigismember (&caught_signals, sig[j])) + xsignal (sig[j], SIG_DFL); + process_signals (); } } =20 --=20 2.30.2 --------------C283A678C824E5E9AFF4010F-- ------------=_1630221783-5833-5 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Feb 2019 01:02:55 +0000 Received: from localhost ([127.0.0.1]:51868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gvXKg-0006uB-Q4 for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <sanvila@HIDDEN>) id 1gvXKf-0006tw-6m for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:53 -0500 Received: from lists.gnu.org ([209.51.188.17]:51297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKV-0005ma-Ku for submit <at> debbugs.gnu.org; Sun, 17 Feb 2019 20:02:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKU-00069V-QV for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKN-0005lI-HD for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:37 -0500 Received: from zmta01.unex.es ([158.49.17.55]:51680) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <sanvila@HIDDEN>) id 1gvXKG-0005kK-C7 for bug-diffutils@HIDDEN; Sun, 17 Feb 2019 20:02:29 -0500 Received: from localhost (localhost [127.0.0.1]) by zmta01.unex.es (Postfix) with ESMTP id 29C1C60057 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:19 +0100 (CET) Received: from zmta01.unex.es ([127.0.0.1]) by localhost (zmta01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 1MP0Ll14gzbo for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmta01.unex.es (Postfix) with ESMTP id 3A21E60059 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) X-Virus-Scanned: amavisd-new at zmta01.siue Received: from zmta01.unex.es ([127.0.0.1]) by localhost (zmta01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4iqPI652gwXi for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from zproxy01.unex.es (zproxy01.servicios.unex.es [10.254.208.61]) by zmta01.unex.es (Postfix) with ESMTPS id 0E87760057 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy01.unex.es (Postfix) with ESMTP id 019CB80A30 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:16 +0100 (CET) Received: from zproxy01.unex.es ([127.0.0.1]) by localhost (zproxy01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Y2BySg7FImnQ for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zproxy01.unex.es (Postfix) with ESMTP id 8AA1480A45 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) X-Virus-Scanned: amavisd-new at zproxy01.siue Received: from zproxy01.unex.es ([127.0.0.1]) by localhost (zproxy01.servicios.unex.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id r4vLvLKLmh16 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:15 +0100 (CET) Received: from tulipan.isla-invisible.es (tulipan.isla-invisible.es [185.92.222.134]) by zproxy01.unex.es (Postfix) with ESMTPSA id 4ED0880A30 for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:10 +0100 (CET) Received: by tulipan.isla-invisible.es (Postfix, from userid 1000) id 18B301700; Mon, 18 Feb 2019 01:57:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by tulipan.isla-invisible.es (Postfix) with ESMTP id 0C0FC103E for <bug-diffutils@HIDDEN>; Mon, 18 Feb 2019 01:57:09 +0100 (CET) Date: Mon, 18 Feb 2019 01:57:09 +0100 (CET) From: Santiago Vila <sanvila@HIDDEN> To: bug-diffutils@HIDDEN Subject: Test "colors" fails on Debian/ppc64el Message-ID: <alpine.DEB.2.20.1902180147100.13056@HIDDEN> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 158.49.17.55 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hello. I've just uploaded diffutils 3.7 for Debian unstable (hopefully to be part of Debian 10, since it contains only small fixes). But there is a problem: The build in the ppc64el autobuilder failed: https://buildd.debian.org/status/logs.php?pkg=diffutils&ver=1%3A3.7-1&arch=ppc64el In tests/colors there was a race condition which I tried to fix by adding a "sleep 1", like this: mkfifo fifo printf '%1000000s-a' > a printf '%1000000s-b' > b head -c 10 < fifo > /dev/null & sleep 1 diff --color=always ---presume-output-tty a b > fifo test $? = 141 || fail=1 It is possible that the "head" command takes (sometimes) more than one second to complete on ppc64el? Are there any other places in the test where a race condition could be happening? Thanks. ------------=_1630221783-5833-5--
X-Loop: help-debbugs@HIDDEN Subject: bug#36488: [bug-diffutils] bug#36488: bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Gisle Vanem <gisle.vanem@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Sun, 29 Aug 2021 11:15:02 +0000 Resent-Message-ID: <handler.36488.B.16302356443889 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 36488 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-diffutils@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.16302356443889 (code B ref -1); Sun, 29 Aug 2021 11:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Aug 2021 11:14:04 +0000 Received: from localhost ([127.0.0.1]:55683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKIlI-00010f-K1 for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 07:14:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:34102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gisle.vanem@HIDDEN>) id 1mKIlH-00010Y-4B for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 07:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <gisle.vanem@HIDDEN>) id 1mKIlG-0005AK-Rl for bug-diffutils@HIDDEN; Sun, 29 Aug 2021 07:14:02 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:36561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <gisle.vanem@HIDDEN>) id 1mKIlE-0005VO-Li for bug-diffutils@HIDDEN; Sun, 29 Aug 2021 07:14:02 -0400 Received: by mail-lj1-x22a.google.com with SMTP id p15so20321370ljn.3 for <bug-diffutils@HIDDEN>; Sun, 29 Aug 2021 04:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Y+kfBwyEirmyXKBYUpJeqoADRfn1to7C/XExghFuFGA=; b=nXtmzp/x0Leykd80CRb+J89PM9jplZ/vqDdJVXAlZXtOKB2NVpotemdRWk9xUw0KyE 7nzJTVYqLTqT0fHHu+cYSANuXKQqISfHiJLi/9dUBblBjRS5QUqs0GVLK/qqrnYzIVPw V1KDio7uu6jQ+haE3yp4n5JRH8lVWv+6VGylRIbpxIVeb5uozRIDmhTCTpCV+ovFZrxy L1Ja0ZVeqN5sKop4CbeDlaqhbZRSaaApO5r90Ay/5usgChoQZpGyvW75ktIzQ8mzdqGB TjQbJ5EALPm/W+XBlXE4Nd5fBJa17iLatEbJ7awBUX0ck9CUBU2GO84UM65uI1nAPKDA BlWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y+kfBwyEirmyXKBYUpJeqoADRfn1to7C/XExghFuFGA=; b=HuN+HDLQJEaGunTS0K5lnmMt8RjsxdfmMzMk+U1g+dRrH8bKu9gbNKv8ejfaVAwBT6 qcc7kpRJb7HRnwFZLSMbh0XuEpq5O8wG5uryQ8clUE3pJToMUJoomiLAALGJSCN0CDdH pTeg+b4Y773P2gfGcjW4j1E164+OJCt5+g2lKFyYTD3RC26iZtwUK/fndvAHOCEhXosz 6gsKoL+eIwcwedDPgsWhkaRu92Nao8YOepSd86wSxUWXMnEoe1FQEIMqo93Edir8y+D6 ZzBGF42Ed9lWibVB7lZorH9SvvvYpbOqBECjx/gQYQNox4qpQExdTa0hdZRoK94+JDD4 hwUw== X-Gm-Message-State: AOAM531ejpKdA+0dwfeLh+IQpZ8adBsSi4rta1gshW0GhMe+x/+k0CLA 8MGVKnCUAe6rUFZ48JcHmWNUzYlI0m4= X-Google-Smtp-Source: ABdhPJxWnnLRYYSqwQ3FOx0B4HOQE3gP7KOvsaaJddXzdF6NQICmITp4s1L4ee+hV/wBR2DurUBR6Q== X-Received: by 2002:a2e:58c:: with SMTP id 134mr16128977ljf.269.1630235638053; Sun, 29 Aug 2021 04:13:58 -0700 (PDT) Received: from [10.0.0.10] (ti0040q160-0004.bb.online.no. [88.95.101.5]) by smtp.gmail.com with ESMTPSA id o18sm582593lfg.109.2021.08.29.04.13.57 for <bug-diffutils@HIDDEN> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Aug 2021 04:13:57 -0700 (PDT) From: Gisle Vanem <gisle.vanem@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Message-ID: <0b916f46-2495-3f86-b27d-5b151b8bc7f0@HIDDEN> Date: Sun, 29 Aug 2021 13:13:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=gisle.vanem@HIDDEN; helo=mail-lj1-x22a.google.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.437, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) Paul Eggert wrote: > +static signal_handler > +xsignal (int sig, signal_handler func) > +{ > + signal_handler h = signal (sig, func); > + if (h == SIG_ERR) > + pfatal_with_name ("signal"); > + return h; > +} > + On Windows, this causes a "diff --color file1 file2" to exit with "diff.exe signal". How useful. With some added trace-code I found this was for SIGHUP (=1) which is not supported. So I just dropped SIGHUP from the list. -- --gv
X-Loop: help-debbugs@HIDDEN Subject: bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Paul Eggert <eggert@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Sun, 29 Aug 2021 18:21:01 +0000 Resent-Message-ID: <handler.36488.B36488.163026121721314 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: Gisle Vanem <gisle.vanem@HIDDEN> Cc: 36488 <at> debbugs.gnu.org Received: via spool by 36488-submit <at> debbugs.gnu.org id=B36488.163026121721314 (code B ref 36488); Sun, 29 Aug 2021 18:21:01 +0000 Received: (at 36488) by debbugs.gnu.org; 29 Aug 2021 18:20:17 +0000 Received: from localhost ([127.0.0.1]:57340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKPPk-0005Xi-Tv for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 14:20:17 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:56292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKPPi-0005XK-WB for 36488 <at> debbugs.gnu.org; Sun, 29 Aug 2021 14:20:16 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A9292160083; Sun, 29 Aug 2021 11:20:08 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id q-oqT8UPz_z4; Sun, 29 Aug 2021 11:20:04 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E80EC1600A7; Sun, 29 Aug 2021 11:20:03 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7I3NGHUlA0KF; Sun, 29 Aug 2021 11:20:03 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id BD238160083; Sun, 29 Aug 2021 11:20:03 -0700 (PDT) References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <0b916f46-2495-3f86-b27d-5b151b8bc7f0@HIDDEN> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Message-ID: <3986b30e-cc23-5cb2-9ddb-d2f56e280d9a@HIDDEN> Date: Sun, 29 Aug 2021 11:20:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <0b916f46-2495-3f86-b27d-5b151b8bc7f0@HIDDEN> Content-Type: multipart/mixed; boundary="------------49226973C0F681E13A18E7A2" Content-Language: en-US X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------49226973C0F681E13A18E7A2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 8/29/21 4:13 AM, Gisle Vanem wrote: > With some added trace-code I found this was for > SIGHUP (=1) which is not supported. So I just dropped > SIGHUP from the list. Thanks for reporting that. I installed the attached, which I hope fixes the problem in a more-portable way. Please give it a try. In hindsight perhaps 'diff' should never have added signal handling, as it's a bug magnet. If your display's colors get messed up due to ^C the shell should fix the colors, not 'diff'. --------------49226973C0F681E13A18E7A2 Content-Type: text/x-patch; charset=UTF-8; name="0001-diff-port-better-to-MS-Windows.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-diff-port-better-to-MS-Windows.patch" From 078321ebeb4d9e83e900278154dbf47ec2758295 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@HIDDEN> Date: Sun, 29 Aug 2021 11:14:14 -0700 Subject: [PATCH] diff: port better to MS-Windows Problem reported by Gisle Vanem (Bug#36488#30). * src/util.c (xsigaction) [SA_NOCLDSTOP]: Remove; no longer needed. (install_signal_handlers): If the first call to sigaction or signal fails, do not exit; just skip the signal and continue, in case the runtime does not support the signal even though the corresponding SIG* macro is defined. --- src/util.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/util.c b/src/util.c index 8e676c8..f8b911a 100644 --- a/src/util.c +++ b/src/util.c @@ -159,16 +159,7 @@ print_message_queue (void) } } - -#if SA_NOCLDSTOP -static void -xsigaction (int sig, struct sigaction const *restrict act, - struct sigaction *restrict oact) -{ - if (sigaction (sig, act, oact) != 0) - pfatal_with_name ("sigaction"); -} -#endif +/* Signal handling, needed for restoring default colors. */ static void xsigaddset (sigset_t *set, int sig) @@ -321,8 +312,7 @@ install_signal_handlers (void) for (int j = 0; j < nsigs; j++) { struct sigaction actj; - xsigaction (sig[j], NULL, &actj); - if (actj.sa_handler != SIG_IGN) + if (sigaction (sig[j], NULL, &actj) == 0 && actj.sa_handler != SIG_IGN) xsigaddset (&caught_signals, sig[j]); } @@ -334,19 +324,23 @@ install_signal_handlers (void) if (xsigismember (&caught_signals, sig[j])) { act.sa_handler = sig[j] == SIGTSTP ? stophandler : sighandler; - xsigaction (sig[j], &act, NULL); + if (sigaction (sig[j], &act, NULL) != 0) + pfatal_with_name ("sigaction"); some_signals_caught = true; } #else for (int j = 0; j < nsigs; j++) - if (xsignal (sig[j], SIG_IGN) != SIG_IGN) - { - xsigaddset (&caught_signals, sig[j]); - xsignal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler); - some_signals_caught = true; - if (siginterrupt (sig[j], 0) != 0) - pfatal_with_name ("siginterrupt"); - } + { + signal_handler h = signal (sig[j], SIG_IGN); + if (h != SIG_IGN && h != SIG_ERR) + { + xsigaddset (&caught_signals, sig[j]); + xsignal (sig[j], sig[j] == SIGTSTP ? stophandler : sighandler); + some_signals_caught = true; + if (siginterrupt (sig[j], 0) != 0) + pfatal_with_name ("siginterrupt"); + } + } #endif } -- 2.30.2 --------------49226973C0F681E13A18E7A2--
X-Loop: help-debbugs@HIDDEN Subject: bug#36488: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Thiago Jung Bauermann <bauermann@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Sun, 29 Aug 2021 21:27:01 +0000 Resent-Message-ID: <handler.36488.B36488.163027239323616 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: Paul Eggert <eggert@HIDDEN> Cc: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric?= Bonnard <frediz@HIDDEN>, Santiago Vila <sanvila@HIDDEN>, 36488 <at> debbugs.gnu.org, Normand <normand@HIDDEN> Received: via spool by 36488-submit <at> debbugs.gnu.org id=B36488.163027239323616 (code B ref 36488); Sun, 29 Aug 2021 21:27:01 +0000 Received: (at 36488) by debbugs.gnu.org; 29 Aug 2021 21:26:33 +0000 Received: from localhost ([127.0.0.1]:57590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKSK1-00068p-BM for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 17:26:33 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:6722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <bauermann@HIDDEN>) id 1mKSJx-00068M-0B for 36488 <at> debbugs.gnu.org; Sun, 29 Aug 2021 17:26:29 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 5FA8CB4A; Sun, 29 Aug 2021 23:26:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1630272378; x=1632086779; bh=XhcFuaASC6CVEfm3XPVL1bvlmplUVxARvtg HXnZGCfE=; b=4lfGlvbzXxH1XTlY7O2e94ZHEoJByYhRl7ci0qvT1/GktR/iTds cc+3kjnIBSQR0/f8UgJCnatWr+Gd/15bsd/1GhXHrMgfZ6+GkW+etAfYEGeMfekD U9OKKCr7Tat56NLIUqECAuWmr7HvnzuTCKhOPpvePLonCrKw4irpgQuiTnbo6WKa tSwXAMF0gwZPKLZOrB3GjNHoPXZec127pTu/UTW1KoKC0pbppZwRDd/dTPxk255T VqplqhEcuCvVJTxCDj6W3+fobnxxjOk1U3I6xF+IWaTYVJzhcp8YITFzO27u9lwt s8HSjhQRoRy2l7Zi3+WzleS4XvpyQuys5kfapVYEhXEsMIrbfokpI/E13yfFtkUm ScWGZ3sJ3hKprI/x6KkgsBm3mRIE6I0IDHDtLx7eOJDkfihQjC4Z4KEeiDauDiHJ Y8sKDYRinoI8PQEwbGO4/cJNC+tv9BT90WtuKsIlnKkGuqLIn9R71Zblvhs7mkU5 9+oKykdjSP47BR2Guz0HR80QX8tNSnK1QDXnJ9FTN2m/jYei43eHJ/0hd1RsjVeu 98TrqbvnwE8kX+xOBarDBBM1oR1BB21xGoA2qLuZvlIQ6wW9MiQTInOHf3q5qoIG aLCB9pW51C0OYMx5IBH0sBKDYOejy2rheFN/diqlBg55ARhWx80dif7Y= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mx5xt2djpUCY; Sun, 29 Aug 2021 23:26:18 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 9020FAAD; Sun, 29 Aug 2021 23:26:16 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 4214F3571; Sun, 29 Aug 2021 23:26:12 +0200 (CEST) From: Thiago Jung Bauermann <bauermann@HIDDEN> Date: Sun, 29 Aug 2021 18:26:01 -0300 Message-ID: <12562597.lilg3O6Q0V@popigai> In-Reply-To: <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello Paul, Em domingo, 29 de agosto de 2021, =C3=A0s 04:22:27 -03, Paul Eggert escreve= u: > On 8/28/21 8:40 AM, Thiago Jung Bauermann via bug-diffutils via All >=20 > diffutils discussion. wrote: > > I believe this is the same problem reported in bug 34519. > > The Debian build also fails with "diff: standard output: Broken pipe". >=20 > Thanks for tracking that down. Fr=C3=A9d=C3=A9ric's analysis in > <https://bugs.debian.org/922552#19> was helpful. >=20 > I found some time to look into this bug, and installed into > Savannah.gnu.org diffutils the attached patch, which I hope fixes the > bug although I don't have the relevant platform to test it. Please give > it a try. Awesome! That was very fast. Thank you very much. > Once this patch is part of a release, Debian shouldn't need any patches > for diffutils. >=20 > For now I am closing the diffutils bug report > <https://bugs.gnu.org/36488>; if I was too optimistic and the patch > doesn't fix things we can always reopen it. Unfortunately the colors test still hits the same problem in some runs even= =20 with this patch applied. Do you have access to a powerpc64le-linux machine? If you want, I can give= =20 you an account on the VM I=E2=80=99m using. =2D-=20 Thanks, Thiago
Received: (at fakecontrol) by fakecontrolmessage; To: internal_control <at> debbugs.gnu.org From: Debbugs Internal Request <help-debbugs@HIDDEN> Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Sun, 29 Aug 2021 21:50:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator
X-Loop: help-debbugs@HIDDEN Subject: bug#36488: [bug-diffutils] bug#36488: diffutils 3.7 make check failure ppc64le opensuse on colors test Resent-From: Paul Eggert <eggert@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-diffutils@HIDDEN Resent-Date: Sun, 29 Aug 2021 22:01:01 +0000 Resent-Message-ID: <handler.36488.B36488.16302744274141 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 36488 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: Thiago Jung Bauermann <bauermann@HIDDEN> Cc: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric?= Bonnard <frediz@HIDDEN>, Santiago Vila <sanvila@HIDDEN>, 36488 <at> debbugs.gnu.org, Normand <normand@HIDDEN> Received: via spool by 36488-submit <at> debbugs.gnu.org id=B36488.16302744274141 (code B ref 36488); Sun, 29 Aug 2021 22:01:01 +0000 Received: (at 36488) by debbugs.gnu.org; 29 Aug 2021 22:00:27 +0000 Received: from localhost ([127.0.0.1]:57619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mKSqp-00014V-2o for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 18:00:27 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1mKSqm-0000wQ-MK for 36488 <at> debbugs.gnu.org; Sun, 29 Aug 2021 18:00:25 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A8E3916005A; Sun, 29 Aug 2021 15:00:18 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tbXeKeh9G-bj; Sun, 29 Aug 2021 15:00:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D4AC81600FC; Sun, 29 Aug 2021 15:00:17 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3cp_Vz04q7BF; Sun, 29 Aug 2021 15:00:17 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 61F4616005A; Sun, 29 Aug 2021 15:00:17 -0700 (PDT) References: <bf6471bb-38a2-d0a9-aee4-e20edb86fc97@HIDDEN> <10257051.elIQoDPIPK@popigai> <3a207779-c39f-55c0-2f27-d675da6df96f@HIDDEN> <12562597.lilg3O6Q0V@popigai> From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department Message-ID: <6a34af3f-9f6c-ccb6-f68c-99fb54220e57@HIDDEN> Date: Sun, 29 Aug 2021 15:00:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <12562597.lilg3O6Q0V@popigai> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.4 (---) On 8/29/21 2:26 PM, Thiago Jung Bauermann wrote: > Unfortunately the colors test still hits the same problem in some runs = even > with this patch applied. Too bad. I reopened the bug report. > Do you have access to a powerpc64le-linux machine? If you want, I can g= ive > you an account on the VM I=E2=80=99m using. An account would be helpful, thanks.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.