From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8EbPEkzFLGEQXgEAgWs5BA (envelope-from ) for ; Mon, 30 Aug 2021 13:47:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YIlODkzFLGHUawAA1q6Kng (envelope-from ) for ; Mon, 30 Aug 2021 11:47:24 +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 8D27F5682 for ; Mon, 30 Aug 2021 13:47:23 +0200 (CEST) Received: from localhost ([::1]:42742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKfl4-0006wh-K7 for larch@yhetil.org; Mon, 30 Aug 2021 07:47:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKfhq-0004dc-9O for guix-patches@gnu.org; Mon, 30 Aug 2021 07:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKfhq-0001kc-0m for guix-patches@gnu.org; Mon, 30 Aug 2021 07:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mKfhp-0000hj-V2 for guix-patches@gnu.org; Mon, 30 Aug 2021 07:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50239] [PATCH core-updates-frozen] gnu: diffutils: Fix signal processing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 11:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Thiago Jung Bauermann , 50239@debbugs.gnu.org Received: via spool by 50239-submit@debbugs.gnu.org id=B50239.16303238382690 (code B ref 50239); Mon, 30 Aug 2021 11:44:01 +0000 Received: (at 50239) by debbugs.gnu.org; 30 Aug 2021 11:43:58 +0000 Received: from localhost ([127.0.0.1]:58297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKfhl-0000hK-Gx for submit@debbugs.gnu.org; Mon, 30 Aug 2021 07:43:57 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:36614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKfhh-0000h9-Mf for 50239@debbugs.gnu.org; Mon, 30 Aug 2021 07:43:56 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id nnjr2500H0mfAB401njr0F; Mon, 30 Aug 2021 13:43:52 +0200 Message-ID: From: Maxime Devos Date: Mon, 30 Aug 2021 13:43:42 +0200 In-Reply-To: <20210828164357.8868-1-bauermann@kolabnow.com> References: <20210828164357.8868-1-bauermann@kolabnow.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-dNXV/BKqbMk29130DVyy" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630323832; bh=iRg1ADs3a/cIZyy/yn1AqH+3EzgxFcwJgxohOZVBiig=; h=Subject:From:To:Date:In-Reply-To:References; b=NASNHp3EjVrN9IqHHW8Btk04G2Y672t7dGyXhGxe2HZYuV10JWeFB6b7/0u68bDxw +ZZS9fdMlg3v6dBMJWcFrH3lb4DraJRNPoQeZqCHXpMH03nUE8k5Va+LmMCQMUyEe5 6MxKzCdtF1COKjfHASeOBqeIY5u2wlv2W6BYnluhiZQxzmhiajU4L7ogQ4Scu3QHml 9o+k1OoFLe/Z17JuQo/WnE8g6GVv+0XJgKrNCMtOxogBv4ulHN9i7cnvRwZCo1+BZ7 plVTaG/AM6PZFJCmU3zk/J8MYZEvQPiDG0tSLm1J0Tu5vPGXP4BaNryry8Vrf1ZQgU BXYW+m2CNe3dg== 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630324044; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=iRg1ADs3a/cIZyy/yn1AqH+3EzgxFcwJgxohOZVBiig=; b=FcRDz7aR7DDyli0jhsX3g/c4ZDzUDfSi1T5azbrx9uEmXGPxSDPUv8xHPJDFVy4VAwFQB9 YPfFiBVVrJc2IuVrIZ+3MnOcruua1mX2LiL+oe7jJVj7yLIxaZJrJ2P+67nyInlFrc9Q16 /yOpZd7hq9yMh5pXmmUjzaapqPLTIGD7REINUAZDEegS2EVh1LJeNipJD3q+v7x71N2q+Z vK7aaqiGuLliQ5BwvxJMx2DavrTKip9LeDwu2VY7oUaEvwt6/3t0sTMstXyK6haH39Jkgw kw4g1eQDlA2GelRjD3sMLBinolJsFiUFbTeYdpq1cLGsOM2zq5iKS+LxOeQ+bw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630324044; a=rsa-sha256; cv=none; b=BflWXvJgIGXrJzNjd4+bvRe3s/V/fD30t0vwlP1CHrRA0ts1Iw22M+6K88bPIqm9gEGGJs aDE6+ZEZwEjmBmG7jbcG25u5BcD06bPWEkMA7Lfr4h05JlQh6F4e1PfAKj3l3qKetkhSEX WEDqRyZmOtpPGpRnOQMVAqYthbJp+lV2ErzhZUBbBg9NB7dS4VWvmRJHu7xI752JpkobgI xM20rzEwg9K5Y150x+aNBFJV6ERpjq8YWPu8D8Lecgg4zcZYSwulvj1ifJzx/thlZ27m/f wp6FbcH7HkPCxppwelVKDFe+Ld7HgipDBLgPdT01M1bpTtLgZQ0IA1cnJ4fIOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=NASNHp3E; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=NASNHp3E; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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: 8D27F5682 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: RTZS/uFVFWke --=-dNXV/BKqbMk29130DVyy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thiago Jung Bauermann via Guix-patches via schreef op za 28-08-2021 om 13:4= 3 [-0300]: > [...] > diffutils has a race condition in its signal processing code which is eas= y > to trigger on powerpc64le-linux. More often than not, it causes the > =E2=80=98colors=E2=80=99 test to fail and therefore the build of the pack= age fails as well. > [...] Adding this patch makes sense to me too, though I don't have a powerpc64le-= linux to test this on. > Add the patch proposed in Debian bug 922552 which fixes the problem. Do you think upstream will have its own working patch soonish? (See , for people who aren't Thiago Jung Bauermann.) If so, it might make sense to wait a li= ttle for an =E2=80=98official=E2=80=99 patch. > * 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. > --- >=20 > Hello, >=20 > This fixes the build of diffutils on powerpc64le-linux, which currently > fails more often than not. The patch I=E2=80=99m adding here isn=E2=80=99= t being > shipped by Debian and hasn=E2=80=99t been seen by upstream yet. I just br= ought > it to their attention here: >=20 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34519#11 >=20 > I=E2=80=99m not familiar with the diffutils code base, but FWIW I analyse= d > the patch and it looks very reasonable to me. To be honest I=E2=80=99m no= t > sure if it completely fixes the race condition or just makes it much > less likely to happen, but in any case I can=E2=80=99t hit the race condi= tion > anymore. >=20 > In addition, since all it does is add a new call to the function which > checks and processes any pending signal, I don=E2=80=99t think it can cau= se > any harm. >=20 > Finally, this patch is based on top of the one which updates diffutils > to version 3.8: >=20 > https://issues.guix.gnu.org/50233 >=20 > The fix works equally well in version 3.7 so if you think it=E2=80=99s no= t > worth updating diffutils I can rebase this patch on top of current > =E2=80=98core-updates-frozen=E2=80=99. >=20 > 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 >=20 > 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 =3D \ > %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.pa= tch")))) > (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=C3=A9d=C3=A9ric Bonnard > + > +Obtained from: > + > +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D922552#19 > + > +and slightly adapted to apply on v3.8. > + > +Fixes bug reported upstream at: > + > +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34519 > + > +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, > + } > + } > +=20 > ++ final_process_signals (); > ++ > + /* Now the comparison has been done, if no error prevented it, > + and STATUS is the value this function will return. */ > +=20 > +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 *, l= in *, 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) > + } > + } > +=20 > ++/* Process remaining signals once before exit */ > ++void > ++final_process_signals (void) > ++{ > ++ static int last =3D 1; > ++ > ++ if (last) { > ++ process_signals (); > ++ last =3D 0; > ++ } > ++} > ++ > + static void > + install_signal_handlers (void) > + { >=20 >=20 >=20 --=-dNXV/BKqbMk29130DVyy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYSzEbhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rUlAQCbcxjoa5V6n4oZnEv6nbnZT+9P b8qf7Nbj7wDRExUt+QEAliiATW9dvq36BWlPAGy+AWNTSUxutctcsAvnQLFH4Ao= =W8ld -----END PGP SIGNATURE----- --=-dNXV/BKqbMk29130DVyy--