From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6GdsBxhoKmHIRwAAgWs5BA (envelope-from ) for ; Sat, 28 Aug 2021 18:45:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2FcYAxhoKmHGMgAAbx9fmQ (envelope-from ) for ; Sat, 28 Aug 2021 16:45:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ABBB758C5 for ; Sat, 28 Aug 2021 18:45:11 +0200 (CEST) Received: from localhost ([::1]:39344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mK1SA-0005v5-Qy for larch@yhetil.org; Sat, 28 Aug 2021 12:45:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK1S2-0005pe-ND for guix-patches@gnu.org; Sat, 28 Aug 2021 12:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mK1S2-0005rQ-Ek for guix-patches@gnu.org; Sat, 28 Aug 2021 12:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mK1S2-000282-C1 for guix-patches@gnu.org; Sat, 28 Aug 2021 12:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50239] [PATCH core-updates-frozen] gnu: diffutils: Fix signal processing. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 28 Aug 2021 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50239@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16301690728114 (code B ref -1); Sat, 28 Aug 2021 16:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Aug 2021 16:44:32 +0000 Received: from localhost ([127.0.0.1]:54934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK1RU-00026k-57 for submit@debbugs.gnu.org; Sat, 28 Aug 2021 12:44:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:41208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK1RO-00026U-HW for submit@debbugs.gnu.org; Sat, 28 Aug 2021 12:44:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK1RO-0004pq-AQ for guix-patches@gnu.org; Sat, 28 Aug 2021 12:44:22 -0400 Received: from mx.kolabnow.com ([95.128.36.40]:36606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK1RL-0005My-CX for guix-patches@gnu.org; Sat, 28 Aug 2021 12:44:21 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 1232640F6F for ; Sat, 28 Aug 2021 18:44:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1630169052; x=1631983453; bh=MBcO5+u4RdxlkE9bJ2t9qUudWYGJowldh5Tl2JrCj88=; b=oNXVuzgZaUCO OreMdWHQoEUtpX0ZBG1tMMCCmen0IOcbuRWszZPuf8AHKvElZ0garQc3DxtROJfv y+zutIFzde3gJfZ/w/RIa6JBAXJJTNmCj82EsFuxDWvD0XJeFRWz5yogMJ3R+HDk hiCBnpp9QIv7kBE8X2gbzk3vxuZnGhwxG/WVjZJXGfPxrBepkg+DANWL4NfJRGBp tAWltxTTqoYt6N7b5O3LHw6MXad6WWzF9ZPqQhenBXzmF/LtTB8HymZQxtj0TdwC 6CWt1lqOPm4RX1CKbP0tak4LnVyRc4bCdaKL5POTTh3VVZ+wSP2QjOZ4UiKWbW5u D7SrzkhslfN7BicVeUvNqJstMky/I1dUi8FesD+uRw96lmLeE1j2bPCUPEK72wMm 3e3phbIlIs9Rg/PiCHLSeyIxCvb/IcEMSlxLXbNFw8X4h6+iOSVxoH1YELqaAj0Q L7iBInf/H0+zT6dx/4G3ac15wkKx0HYwN42sAcsCi7CVOsLgC46JOWBgVw3G1v0o imnZPhWmryp2yOEfv0UffsFqOCLy7fvxxxoQv29wxCOl9PSXGt5T6cCGMY/ZvXFX KPLURDvd6PcOX3jrVLHFIbvLVZGaWBYINR2QXNMwPxGYbne5DoVE5XhBjLJ8BE8A NwQifAPl4JBktf0pXW5nFIHUMKcwUuM= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lFMQvNIxlV_3 for ; Sat, 28 Aug 2021 18:44:12 +0200 (CEST) Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id 07EFB4067E for ; Sat, 28 Aug 2021 18:44:11 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 5E239AFB; Sat, 28 Aug 2021 18:44:10 +0200 (CEST) Date: Sat, 28 Aug 2021 13:43:57 -0300 Message-Id: <20210828164357.8868-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=95.128.36.40; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630169111; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=MBcO5+u4RdxlkE9bJ2t9qUudWYGJowldh5Tl2JrCj88=; b=gZ1UXCz0FAFlcuyW6rbb9vEyZovrb468KTslZH6F84fKEU5G4nLj4LwWIXGB61vnBsjeKw KqYS+EEL/E9Ja147tRADceNynumRL7GITU78Zyuve+r5jLqwrkI6fhsa8cPllG6aH6e68n sqWlMixZMDh4AJdF8iDAri7qVwJfvjQmO04v4KoapDhauEPzhdQNL1NUDBJH9MgTrOvAmd xwTyHwpqdz94XuWMRQYizr4zxk33cybaouRty3kRZ2TCkTi9qIS52QGAuamNaAuVs0SX6z Xb1lmPSC9oHwDsZe3ahVv+jkcepuenUPsfUknGBFQV1HGLKArEq7r5VqjMhJrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630169111; a=rsa-sha256; cv=none; b=kdTubulVNtxUmIrk0sqeEY0mNu5A/EQ3mNHL1tFmeqmK9Ow6+NQ881Q4v4X7wjq4yFnTL5 e963XKCocrTSIHVhY2jpS0f15jnv5FsUTBt0LHytQGMyn2X9OeWDgaxaZRSqvmm8Nm5HUC rQZQXXFhykUTkKE9cYsZ0rH/byDvV/MPTOByIoZjEpfs/DN5bull11U4fsCV39Shf20waV 4N1yLyt2bakoottemlSBOLyDM5wCN+0bYD8wnIHxA3beguxVecw5fEcx9/mUnpCpfbveSP X2x7rq3fPezRnyckPOss2TvBF8ZGkAWH5VNujRTwZbHcKqMhzvD1GAE3ctO+Dg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=oNXVuzgZ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=oNXVuzgZ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: ABBB758C5 X-Spam-Score: -2.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: //oaiTHi5plG diffutils has a race condition in its signal processing code which is easy to trigger on powerpc64le-linux. More often than not, it causes the ‘colors’ test to fail and therefore the build of the package fails as well. Add the patch proposed in Debian bug 922552 which fixes the problem. * gnu/packages/patches/diffutils-fix-signal-processing.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/base.scm (diffutils)[source]: Use it. --- Hello, This fixes the build of diffutils on powerpc64le-linux, which currently fails more often than not. The patch I’m adding here isn’t being shipped by Debian and hasn’t been seen by upstream yet. I just brought it to their attention here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34519#11 I’m not familiar with the diffutils code base, but FWIW I analysed the patch and it looks very reasonable to me. To be honest I’m not sure if it completely fixes the race condition or just makes it much less likely to happen, but in any case I can’t hit the race condition anymore. In addition, since all it does is add a new call to the function which checks and processes any pending signal, I don’t think it can cause any harm. Finally, this patch is based on top of the one which updates diffutils to version 3.8: https://issues.guix.gnu.org/50233 The fix works equally well in version 3.7 so if you think it’s not worth updating diffutils I can rebase this patch on top of current ‘core-updates-frozen’. gnu/local.mk | 1 + gnu/packages/base.scm | 3 +- .../diffutils-fix-signal-processing.patch | 60 +++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/diffutils-fix-signal-processing.patch diff --git a/gnu/local.mk b/gnu/local.mk index 11b002b66e72..bc385eecc592 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -962,6 +962,7 @@ dist_patch_DATA = \ %D%/packages/patches/desmume-gcc6-fixes.patch \ %D%/packages/patches/desmume-gcc7-fixes.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ + %D%/packages/patches/diffutils-fix-signal-processing.patch \ %D%/packages/patches/diffutils-gets-undeclared.patch \ %D%/packages/patches/disarchive-cross-compilation.patch \ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 2c648953ae39..0e3b346b93a0 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -272,7 +272,8 @@ differences.") version ".tar.xz")) (sha256 (base32 - "1v4g8gi0lgakqa7iix8s4fq7lq6l92vw3rjd9wfd2rhjng8xggd6")))) + "1v4g8gi0lgakqa7iix8s4fq7lq6l92vw3rjd9wfd2rhjng8xggd6")) + (patches (search-patches "diffutils-fix-signal-processing.patch")))) (build-system gnu-build-system) (native-inputs (list perl)) (synopsis "Comparing and merging files") diff --git a/gnu/packages/patches/diffutils-fix-signal-processing.patch b/gnu/packages/patches/diffutils-fix-signal-processing.patch new file mode 100644 index 000000000000..24130bd4c37a --- /dev/null +++ b/gnu/packages/patches/diffutils-fix-signal-processing.patch @@ -0,0 +1,60 @@ +Author: Frédéric Bonnard + +Obtained from: + +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922552#19 + +and slightly adapted to apply on v3.8. + +Fixes bug reported upstream at: + +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34519 + +diff --git a/src/diff.c b/src/diff.c +index 9938daa0c8fd..2bc443f1ca70 100644 +--- a/src/diff.c ++++ b/src/diff.c +@@ -1453,6 +1453,8 @@ compare_files (struct comparison const *parent, + } + } + ++ final_process_signals (); ++ + /* Now the comparison has been done, if no error prevented it, + and STATUS is the value this function will return. */ + +diff --git a/src/diff.h b/src/diff.h +index 27362c010fd2..28c89b0797ef 100644 +--- a/src/diff.h ++++ b/src/diff.h +@@ -390,6 +390,7 @@ extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *); + extern void begin_output (void); + extern void debug_script (struct change *); + extern void fatal (char const *) __attribute__((noreturn)); ++extern void final_process_signals (void); + extern void finish_output (void); + extern void message (char const *, char const *, char const *); + extern void message5 (char const *, char const *, char const *, +diff --git a/src/util.c b/src/util.c +index 4348757e1507..8954197f33fc 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -237,6 +237,18 @@ process_signals (void) + } + } + ++/* Process remaining signals once before exit */ ++void ++final_process_signals (void) ++{ ++ static int last = 1; ++ ++ if (last) { ++ process_signals (); ++ last = 0; ++ } ++} ++ + static void + install_signal_handlers (void) + {