GNU bug report logs - #50239
[PATCH core-updates-frozen] gnu: diffutils: Fix signal processing.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Thiago Jung Bauermann <bauermann@HIDDEN>; Keywords: patch; dated Sat, 28 Aug 2021 16:45:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 50239 <at> debbugs.gnu.org:


Received: (at 50239) by debbugs.gnu.org; 6 Sep 2021 11:56:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 06 07:56:18 2021
Received: from localhost ([127.0.0.1]:52232 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNDEX-0004zE-Mh
	for submit <at> debbugs.gnu.org; Mon, 06 Sep 2021 07:56:18 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51674)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mNDEI-0004yW-LC
 for 50239 <at> debbugs.gnu.org; Mon, 06 Sep 2021 07:56:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37128)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mNDEC-0001Wx-Ex; Mon, 06 Sep 2021 07:55:56 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47204 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mNDEA-0001iT-OK; Mon, 06 Sep 2021 07:55:56 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Thiago Jung Bauermann <bauermann@HIDDEN>
Subject: Re: bug#50239: [PATCH core-updates-frozen] gnu: diffutils: Fix
 signal processing.
References: <20210828164357.8868-1-bauermann@HIDDEN>
Date: Mon, 06 Sep 2021 13:55:52 +0200
In-Reply-To: <20210828164357.8868-1-bauermann@HIDDEN> (Thiago Jung
 Bauermann's message of "Sat, 28 Aug 2021 13:43:57 -0300")
Message-ID: <877dft9auv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50239
Cc: Maxime Devos <maximedevos@HIDDEN>, 50239 <at> debbugs.gnu.org
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 (---)

Hi,

Thiago Jung Bauermann <bauermann@HIDDEN> skribis:

> 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:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34519#11

Thanks for working on this!

> I=E2=80=99m not familiar with the diffutils code base, but FWIW I analysed
> the patch and it looks very reasonable to me. To be honest I=E2=80=99m not
> 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.
>
> 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.
>
> 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=E2=80=99s not
> worth updating diffutils I can rebase this patch on top of current
> =E2=80=98core-updates-frozen=E2=80=99.

Normally we won=E2=80=99t update diffutils on =E2=80=98core-updates-frozen=
=E2=80=99.

Thus, could you adjust this patch so that (1) it applies on
=E2=80=98core-updates-frozen=E2=80=99, and (2) it doesn=E2=80=99t change de=
rivations on other
platforms (thus, the patch needs to be applied from a build phase)?
Bonus point if there=E2=80=99s an upstream patch to use, as Maxime suggeste=
d.

TIA,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50239; Package guix-patches. Full text available.

Message received at 50239 <at> debbugs.gnu.org:


Received: (at 50239) by debbugs.gnu.org; 30 Aug 2021 13:40:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 30 09:40:25 2021
Received: from localhost ([127.0.0.1]:58495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mKhWP-0004Lt-49
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2021 09:40:25 -0400
Received: from mx.kolabnow.com ([95.128.36.40]:45814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bauermann@HIDDEN>) id 1mKhWJ-0004KB-LL
 for 50239 <at> debbugs.gnu.org; Mon, 30 Aug 2021 09:40:20 -0400
Received: from localhost (unknown [127.0.0.1])
 by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 413414067E;
 Mon, 30 Aug 2021 15:40:09 +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=
 1630330804; x=1632145205; bh=r271GbYjfE4jNIXQZBkcWFcMLrt263Os+cq
 kvPLy2jo=; b=0qvpkrHHPpvWwBCoBZxx0jAsnw5rr1JdocAEoPztm9u6w2QkoRh
 eH14i9q7gOHSr+zHuRZzBXBgkwdA1771aI1mAkZyPAzD1VgNemvyNK/SGN3MYtSL
 1VZeK0xIBb/O4/X/7zbi7Dx6Yw+mD25KD/f7eqGDl5WmLG8KD7YXzH9p9hOfazjW
 KfG7Ugyz/ukJG0cEq7tzu38sdG/CebnJEAWJmzbpBmTg6PCJpztMLDpb9ulssz5A
 IME6VSZNX8EvH1c2TDA7Q8TRhaW65hxgpAtSKNHtmgohuXApOVrh6L2TZWvfeO9p
 JIdJRzvVrXnM6HETHEtgFfYiWUOtrIWFDwnExDH+lA5gQydkmMVa7dBe05B750sp
 RXYF+2Q2pjQWqidun+BPRWixkPrNF4qB82qLXJ+mh8tbegjdAotfPWV5tBY1z2DB
 AfAhCJQe3C8EPxf/pC4b/Dk8gtOxqOmjVnirjZYVcg5StSjfBjxT+gXTSYSV+nbT
 galqyWm0rtpG1B0VPRLnlUA4NqBo6E18CjDzOSpnuOWdc/NjUL0tgd8lnAtSVpbI
 TGki786Ig9Vz98gqzb4/vBaNBAps31sf9Xc3uxoTJPeUM4pQdD4ZYDdzrsGMWNft
 jb8LQ0fO96DihJHwIyfD1/jV2rtXMI4Zcn1jRFtxoPAHkZdJumi0P3ig=
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-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id z1u4jR34YxXa; Mon, 30 Aug 2021 15:40:04 +0200 (CEST)
Received: from int-mx003.mykolab.com (unknown [10.9.13.3])
 by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id B2D2140610;
 Mon, 30 Aug 2021 15:40:04 +0200 (CEST)
Received: from ext-subm002.mykolab.com (unknown [10.9.6.2])
 by int-mx003.mykolab.com (Postfix) with ESMTPS id 8B5282546;
 Mon, 30 Aug 2021 15:40:03 +0200 (CEST)
From: Thiago Jung Bauermann <bauermann@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50239] [PATCH core-updates-frozen] gnu: diffutils: Fix
 signal processing.
Date: Mon, 30 Aug 2021 10:39:54 -0300
Message-ID: <3088529.eW9a4NE73H@popigai>
In-Reply-To: <d7f74cb51997e491e98564df10c1b4c9144ef9de.camel@HIDDEN>
References: <20210828164357.8868-1-bauermann@HIDDEN>
 <d7f74cb51997e491e98564df10c1b4c9144ef9de.camel@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50239
Cc: 50239 <at> debbugs.gnu.org
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 Maxime,

Thank you for your review!

Em segunda-feira, 30 de agosto de 2021, =C3=A0s 08:43:42 -03, Maxime Devos=
=20
escreveu:
> Thiago Jung Bauermann via Guix-patches via schreef op za 28-08-2021 om=20
13:43 [-0300]:
> > [...]
> > 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 =E2=80=98colors=E2=80=99 test to fail and therefore the build of th=
e package fails
> > as well. [...]
>=20
> Adding this patch makes sense to me too, though I don't have a
> powerpc64le-linux to test this on.

Nice, thanks!

> > Add the patch proposed in Debian bug 922552 which fixes the problem.
>=20
> Do you think upstream will have its own working patch soonish?

I think so. Paul Eggert was very quick in his response and is already=20
working on a fix.

> (See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488#41>, for peop=
le
> who aren't Thiago Jung Bauermann.)

Yeah, the discussion moved unexpectedly to a different bug report. Thanks=20
for tracking it down and posting the new link.

> If so, it might make sense to wait a little for an =E2=80=98official=E2=
=80=99 patch.

Yes, I agree.

=2D-=20
Thanks,
Thiago






Information forwarded to guix-patches@HIDDEN:
bug#50239; Package guix-patches. Full text available.

Message received at 50239 <at> debbugs.gnu.org:


Received: (at 50239) by debbugs.gnu.org; 30 Aug 2021 11:43:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 30 07:43:58 2021
Received: from localhost ([127.0.0.1]:58297 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mKfhl-0000hK-Gx
	for submit <at> 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 <maximedevos@HIDDEN>) id 1mKfhh-0000h9-Mf
 for 50239 <at> 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: <d7f74cb51997e491e98564df10c1b4c9144ef9de.camel@HIDDEN>
Subject: Re: [bug#50239] [PATCH core-updates-frozen] gnu: diffutils: Fix
 signal processing.
From: Maxime Devos <maximedevos@HIDDEN>
To: Thiago Jung Bauermann <bauermann@HIDDEN>, 50239 <at> debbugs.gnu.org
Date: Mon, 30 Aug 2021 13:43:42 +0200
In-Reply-To: <20210828164357.8868-1-bauermann@HIDDEN>
References: <20210828164357.8868-1-bauermann@HIDDEN>
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-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50239
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.7 (-)


--=-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 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36488#41>, 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 <frediz@HIDDEN>
> +
> +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--





Information forwarded to guix-patches@HIDDEN:
bug#50239; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Aug 2021 16:44:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 12:44:32 2021
Received: from localhost ([127.0.0.1]:54934 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK1RU-00026k-57
	for submit <at> 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 <bauermann@HIDDEN>) id 1mK1RO-00026U-HW
 for submit <at> 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 <bauermann@HIDDEN>)
 id 1mK1RO-0004pq-AQ
 for guix-patches@HIDDEN; 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 <bauermann@HIDDEN>)
 id 1mK1RL-0005My-CX
 for guix-patches@HIDDEN; 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 <guix-patches@HIDDEN>; 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
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-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id lFMQvNIxlV_3 for <guix-patches@HIDDEN>;
 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 <guix-patches@HIDDEN>; 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)
From: Thiago Jung Bauermann <bauermann@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates-frozen] gnu: diffutils: Fix signal processing.
Date: Sat, 28 Aug 2021 13:43:57 -0300
Message-Id: <20210828164357.8868-1-bauermann@HIDDEN>
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@HIDDEN;
 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-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: Thiago Jung Bauermann <bauermann@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: -2.4 (--)

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 <frediz@HIDDEN>
+
+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)
+ {




Acknowledgement sent to Thiago Jung Bauermann <bauermann@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#50239; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 6 Sep 2021 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.