GNU bug report logs - #30948
[PATCH core-updates] guix: Reap finished child processes in build containers.

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: Carlo Zancanaro <carlo@HIDDEN>; Keywords: patch; dated Mon, 26 Mar 2018 11:17:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 30948) by debbugs.gnu.org; 30 Mar 2018 11:17:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 07:17:26 2018
Received: from localhost ([127.0.0.1]:59412 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1s2A-0004pI-9Q
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 07:17:26 -0400
Received: from mail-pf0-f177.google.com ([209.85.192.177]:34941)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f1s28-0004p5-Op
 for 30948 <at> debbugs.gnu.org; Fri, 30 Mar 2018 07:17:25 -0400
Received: by mail-pf0-f177.google.com with SMTP id u86so5266826pfd.2
 for <30948 <at> debbugs.gnu.org>; Fri, 30 Mar 2018 04:17:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:references:user-agent:from:to:cc:subject:message-id
 :in-reply-to:date:mime-version;
 bh=RbwRXuM9eqeFTsC0SnbqvbyKnD7Eu8LVAQukofh3w4s=;
 b=mys2BoJj+I+T/fVyuie/jaUKlJxyasp89PzNLyTmhAFdKAPuM0PhSv2j8teWtEuvBJ
 6MXgZpCP2Ky75oW3m2IL9nfCIBbTjBHNiev4v64Zb+FHspcHPs4Z+F7jQK+K3Xge5Iaa
 Ng0UZDsaa5CuENI1RmAPbs+/cd/0ezWG9XvnvqPpnynmNhghr3l7c70JQeY7Ak0b7XRS
 5etZ+6SEOxClkOyRRRAt/wQckDgE/xbYBL/MOZ3I2MfG22sopfyJh/ehJ34VUjpDaWkv
 LneyPTHxTdkRc++c7DWN9vCU2+j4eK3JF1eIm5oWFDVdOXwACewysl1a3GtxHMFXyPTJ
 GYlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject
 :message-id:in-reply-to:date:mime-version;
 bh=RbwRXuM9eqeFTsC0SnbqvbyKnD7Eu8LVAQukofh3w4s=;
 b=LiTTMDQT+nW3Tifp2NDsVduyKPujL9qp4enXt9JJkmT6/Ik7RaE21QWsNkth+rb+d4
 OvaxZlAkXcd5x86VxXvUSx9mtXlVUYojYrXO1zij1lKNeLe3VqryZek7kGu0dJxgWZFa
 xD7/3ACEgSVJ7exET014ei6n0mDoz+BjieJ11REUNDIHlHIS7HfzPYHajn+DZ9FwVaX2
 DWOgGxGx6XWcpb49Oeq5HkvOmwoRWGC3cV0esqCwV82j0ON0qCg031ahC8CLXu2DjNQ0
 ENSnxesY5MmGtsPPAYRjn4NPp7AoApbvLBk+EyZFy3D7iu4kI/VZd3ErFfUJnroujRx5
 8Whg==
X-Gm-Message-State: AElRT7EJOEizaVpAY8L+Z6goI7/u0zD6Q1S/wZmSthsV2DMN69dr9Yg6
 gwkzinshB9dnljCqUSzMYz3QIdKa
X-Google-Smtp-Source: AIpwx4+lBCUn7quopdFhMebAEjY57bEwV4MnGGJoFa1axNKb3cevh8kppGbpQ3N6S3OpcCa8l+R3yA==
X-Received: by 10.99.190.5 with SMTP id l5mr8324299pgf.25.1522408638081;
 Fri, 30 Mar 2018 04:17:18 -0700 (PDT)
Received: from gengar (210-1-202-160-cpe.spintel.net.au. [210.1.202.160])
 by smtp.gmail.com with ESMTPSA id k70sm15013354pga.72.2018.03.30.04.17.15
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 30 Mar 2018 04:17:17 -0700 (PDT)
References: <87muyvulwt.fsf@HIDDEN> <87bmf6ve6u.fsf@HIDDEN>
 <87sh8id1mg.fsf@HIDDEN> <87vadeou54.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 25.3.1
From: Carlo Zancanaro <carlo@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child
 processes in build containers.
Message-ID: <87o9j5x1d4.fsf@HIDDEN>
In-reply-to: <87vadeou54.fsf@HIDDEN>
Date: Fri, 30 Mar 2018 22:17:06 +1100
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 30948
Cc: 30948 <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: 0.5 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Hey,

On Fri, Mar 30 2018, Ludovic Court=C3=A8s wrote:
>> From what I can understand it's one of pid 1's responsiblities=20
>> to reap child processes, so I would expect this to be set up=20
>> for every builder, before the builder is run.
>
> True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D be=
cause=20
> eventually guix-daemon terminates all its child processes.

As long as the build process doesn't rely on behaviour that,=20
strictly speaking, it should be allowed to rely on. It's not an=20
issue of resource leaking, it's an issue of correctness.

>> Given it's not specific to the gnu-build-system, I don't think=20
>> it really fits there.
>
> Yes, but note that it would be inherited by all the build=20
> systems.

Except for trivial-build-system, which is probably fine. I still=20
don't think it fits in a specific build system, given it's a=20
behaviour that transcends the specific action happening within the=20
container.

Putting it in gnu-build-system will solve the problem in all=20
realistic cases, so that's probably fine. It's still subtly=20
incorrect, but will only be a problem if something using the=20
trivial build system relies on pid 1 to reap a process, or if we=20
make a new build system not deriving from gnu-build-system (which=20
seems unlikely, but not impossible).

> The =E2=80=9Cbuild side=E2=80=9D is fully specified: =E2=80=98guix graph=
=E2=80=99 shows exactly=20
> what Guile is used where, and you can see with, say:
>
>   guix graph -t derivation \
>     -e '(@@ (gnu packages commencement) findutils-boot0)'
>
> that the early derivations run on Guile 2.0.9.
>
> For =E2=80=9Chost side=E2=80=9D code, users can use any Guile >=3D 2.0.13.

Yeah, okay. That makes sense. I guess I just expected 2.0.13 to be=20
the minimum version throughout.

Carlo

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAlq+HLIACgkQCShLEsLi
KqL7WAgAyftn/CJ0pPyDVc6L3qwhmU58s5hsT6U+E7TkRdkdf1NY6Hl1JK4JygJt
FRFy7IuDgPWm4UpuBrCbHTbA5G7yzNoSqPzFiG+ephJmXvCyCg578NEfLD/ChUmz
D/ES/rWw/rFmqTWTVxHZrnC7buiNOS9BgiiMkYbZ5cmAP1s77pzGFPKiZXoyp5zw
zyn3lGPlh+ULvLGah+PdjLMM74qhIi7y3MDpGdRuHEFmCP4+vdz/33bZKwFqQ1YE
Cj3Yi2tDPA4Ana0oAqCs4SMLGcseaZpAR4CmkDqaMq4t891k+JJ6EcvV45dFF0is
7gba+//F3RQAH9e1ujrp3SXCweO2GA==
=qY0n
-----END PGP SIGNATURE-----
--=-=-=--




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

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


Received: (at 30948) by debbugs.gnu.org; 30 Mar 2018 08:16:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 04:16:44 2018
Received: from localhost ([127.0.0.1]:59336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1pDH-0000i1-VX
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 04:16:44 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:49988)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1f1pDF-0000hs-8H
 for 30948 <at> debbugs.gnu.org; Fri, 30 Mar 2018 04:16:42 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 96C8612CE2;
 Fri, 30 Mar 2018 10:16:40 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id TWmZrQqpJ-Yt; Fri, 30 Mar 2018 10:16:39 +0200 (CEST)
Received: from ribbon (unknown [193.50.110.67])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 8560112CBC;
 Fri, 30 Mar 2018 10:16:39 +0200 (CEST)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Carlo Zancanaro <carlo@HIDDEN>
Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child
 processes in build containers.
References: <87muyvulwt.fsf@HIDDEN> <87bmf6ve6u.fsf@HIDDEN>
 <87sh8id1mg.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 10 Germinal an 226 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 30 Mar 2018 10:16:39 +0200
In-Reply-To: <87sh8id1mg.fsf@HIDDEN> (Carlo Zancanaro's message of
 "Fri, 30 Mar 2018 08:15:51 +1100")
Message-ID: <87vadeou54.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30948
Cc: 30948 <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 (+)

Heya,

Carlo Zancanaro <carlo@HIDDEN> skribis:

> On Thu, Mar 29 2018, Ludovic Court=C3=A8s wrote:
>> I would rather install the handler as a phase in gnu-build-system:
>> this leaves =E2=80=98build-expression->derivation=E2=80=99 generic, and =
also gives
>> us more flexibility (e.g., we can disable that phase without doing a
>> full rebuild if needed.)  See the patch below.
>>
>> WDYT?
>
> What do you mean by "generic"?

I want as little magic as possible around the expression that=E2=80=99s pas=
sed
to =E2=80=98build-expression->derivation=E2=80=99.

> From what I can understand it's one of pid 1's responsiblities to reap
> child processes, so I would expect this to be set up for every
> builder, before the builder is run.

True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D beca=
use eventually
guix-daemon terminates all its child processes.

> Given it's not specific to the gnu-build-system, I don't think it
> really fits there.

Yes, but note that it would be inherited by all the build systems.

>> On my first attempt with:
>>
>>   ./pre-inst-env guix build -e '(@@ (gnu packages commencement)
>> findutils-boot0)'
>>
>> quickly failed:
>>
>> ...
>>
>> This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does =
nothing on
>> Guile <=3D 2.0.9.
>
> From what I understand, Guix depends on Guile 2.0.13 or later, so I
> didn't think it needed to work with 2.0.9. From my quick check,
> though, our bootstrap binaries are Guile 2.0.9?

Exactly.

> I can see how that might cause a problem. In what sense does Guix
> require 2.0.13 (as the manual claims) rather than 2.0.9?

There=E2=80=99s the =E2=80=9Chost side=E2=80=9D (the =E2=80=98guix=E2=80=99=
 commands and related modules), and
there=E2=80=99s the =E2=80=9Cbuild side=E2=80=9D (code used in the build en=
vironment when
building derivations.)

The =E2=80=9Cbuild side=E2=80=9D is fully specified: =E2=80=98guix graph=E2=
=80=99 shows exactly what
Guile is used where, and you can see with, say:

  guix graph -t derivation \
    -e '(@@ (gnu packages commencement) findutils-boot0)'

that the early derivations run on Guile 2.0.9.

For =E2=80=9Chost side=E2=80=9D code, users can use any Guile >=3D 2.0.13.

See also
<https://gnu.org/software/guix/manual/html_node/G_002dExpressions.html>.

I hope this clarifies a bit!

Ludo=E2=80=99.




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

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


Received: (at 30948) by debbugs.gnu.org; 29 Mar 2018 21:16:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 29 17:16:12 2018
Received: from localhost ([127.0.0.1]:59099 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1eu3-0006mH-UV
	for submit <at> debbugs.gnu.org; Thu, 29 Mar 2018 17:16:12 -0400
Received: from mail-pf0-f182.google.com ([209.85.192.182]:43320)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f1eu2-0006m5-Oq
 for 30948 <at> debbugs.gnu.org; Thu, 29 Mar 2018 17:16:11 -0400
Received: by mail-pf0-f182.google.com with SMTP id j2so4087100pff.10
 for <30948 <at> debbugs.gnu.org>; Thu, 29 Mar 2018 14:16:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=V/KMDxHzv22SM0bTAkM9xBVJO5jDcUAYelQSXqwoJr0=;
 b=Eyxzf6TfPQHNqSmS+roCWw/Rw8Q0Pk9dTPq1KJu0MHL/FsDVELiRIZhe8B9psLtq5T
 g/ozUu9Q/vJNtka00mLiS48jBM3nzxB9z2mj8D7qCDM3SzXndEiGJtaYZmOwCSue4cFT
 L/01WFE6TjKKf7t3BIDB8LLY2NMSZoXlJY6NAOpkNCidxQcok7aYt9RsvdbcsovdkGMs
 qLmhZgDsHQ9GiBOmAzHNbGaqjvhnljeHSdOSDELv38/DHbJ7WmIzTkk4sh2wAwwew6xH
 d46IHLg3e+oHCQLAVpby052W9nRvq5AQ2fLSj9/o7ItRHegb74ryEptOlkj+qgrlsrab
 y2Mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=V/KMDxHzv22SM0bTAkM9xBVJO5jDcUAYelQSXqwoJr0=;
 b=apLbIrvBxkJbPjhksdL0G+asAuXzPep/UrU4IzoaRh0Edc4ZeSRkKwO2krQfBYi5gk
 BI4Xo2dzWulTGkQ2gqmmvvo6UJlksy1/uWusS5o1s1lk+DsjzgMLKBj0NSlvGT9k7Uet
 7dMKotXQDkpBX2L44U6fdK1JsGs6Luf/+RIrZvVv1Z28XxCtJuDoqbECdU/VlY7uGYpI
 tgvVn1cAE8kIHs8XHIju85VjLWHYE+pSMvN/C4fEZEhzPqCyq/7zZFoFJ1sTZwewZZVg
 0ASBGv8v7k87LX2H9580YZO7q2v6SiYXqwbVpCTVESVj9jNSDDQ9epIHjD/I3/BW6KI9
 wf6w==
X-Gm-Message-State: AElRT7EmsGEpnheSt4P2/SddVuz1rUCt8N/BQRT+QTFsFXVzZ2VJNZHY
 Dd5XSzgLoNVqSbx+1I0tJe1Kwx/A
X-Google-Smtp-Source: AIpwx48XDYd4oA3WFdSXSKt7f1Yd2nZWmZgcsIgq7jOMuoZn6sq8kNC0iqG8GEoHTEgH6AsEafVrKw==
X-Received: by 2002:a17:902:8282:: with SMTP id
 y2-v6mr4759084pln.7.1522358164214; 
 Thu, 29 Mar 2018 14:16:04 -0700 (PDT)
Received: from pidgey (210-1-202-160-cpe.spintel.net.au. [210.1.202.160])
 by smtp.gmail.com with ESMTPSA id k24sm13482544pff.77.2018.03.29.14.16.01
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 29 Mar 2018 14:16:02 -0700 (PDT)
References: <87muyvulwt.fsf@HIDDEN> <87bmf6ve6u.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 25.3.1
From: Carlo Zancanaro <carlo@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child
 processes in build containers.
In-reply-to: <87bmf6ve6u.fsf@HIDDEN>
Date: Fri, 30 Mar 2018 08:15:51 +1100
Message-ID: <87sh8id1mg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 30948
Cc: 30948 <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: 0.5 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Hey Ludo,

On Thu, Mar 29 2018, Ludovic Court=C3=A8s wrote:
> I would rather install the handler as a phase in=20
> gnu-build-system: this leaves =E2=80=98build-expression->derivation=E2=80=
=99=20
> generic, and also gives us more flexibility (e.g., we can=20
> disable that phase without doing a full rebuild if needed.)  See=20
> the patch below.
>
> WDYT?

What do you mean by "generic"? From what I can understand it's one=20
of pid 1's responsiblities to reap child processes, so I would=20
expect this to be set up for every builder, before the builder is=20
run. Given it's not specific to the gnu-build-system, I don't=20
think it really fits there.

> On my first attempt with:
>
>   ./pre-inst-env guix build -e '(@@ (gnu packages commencement)=20
>   findutils-boot0)'
>
> quickly failed:
>
> ...
>
> This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does n=
othing=20
> on Guile <=3D 2.0.9.

From=20what I understand, Guix depends on Guile 2.0.13 or later, so=20
I didn't think it needed to work with 2.0.9. From my quick check,=20
though, our bootstrap binaries are Guile 2.0.9? I can see how that=20
might cause a problem. In what sense does Guix require 2.0.13 (as=20
the manual claims) rather than 2.0.9?

> Now, we=E2=80=99d need to test it for real with Guile 2.2.  I suppose=20
> one way to
> test without rebuilding it all would be to add this phase=20
> explicitly in
> a package and try building it with --rounds=3D10 or something.=20
> Would you
> like to try that?

Yeah, I'll give it a go.

Carlo

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq9V4gACgkQqdyPv9aw
IbwfFA/6A+eIjcEhtb6obaSPl1hhiZj/bPIftEpE5m/DS0AHqxsAfwejLA6I/av6
jJdswbSER/nQanDO5u685G0pvQLmJL5NlFCrjC4Ji/vi0FlTtVOOI8xaUsQFrXrb
eu+HhWg891VvI1hKSfrQm8ZOYzi+SyayCatontP4M4rUFbzY4UQFJZNf8IPtUAY/
N7YVv3UJ2nGGGOMU89u52idSpVxBRBesdUyszvLTW4yLKXM7wjpDP4jq1W+MJ8j+
kXEn7iNNG8L1jOTgCNPOrD0j+pnlyh4hCstaDx8AcJsbJO7cUCM3/t86Nogo27R2
nY8M+ayYUZ3mpoU4PfTDQZ4dVUoxFPqJ+mAqZ3NtYLrRZLlQQots+qLWTSIsUqoz
MI8+yaMbQej7sEGrU6pJUmwKggEpMbKdHrTsUPXAXHupBylyoXnboIzCh0aJ9kAR
4u0djoW/eAJo6Z7AuxCuO023z0mTqeAgI5dkPUx4C0S8Zl3csaFP/rO9SzFvehSy
+iWgD8BCJTZEMtgX+WUWyO37FyvvCCvOtrcLgizBJ3m2OdYZ/U1kbS3HqFaxgtvp
pEuwPWNnYNk5mM09dl/l7aV9TCbJRuryZV5Ued5pP9P9JCRcHIaz756AW98uZs3C
b9r2Bc6xVhkWiEv0SXv42HFCUJcfHhOS2e/BJO6F4Q/xufEnj8Y=
=3nBj
-----END PGP SIGNATURE-----
--=-=-=--




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

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


Received: (at 30948) by debbugs.gnu.org; 29 Mar 2018 20:07:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 29 16:07:12 2018
Received: from localhost ([127.0.0.1]:59069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1dpH-0005Ah-U2
	for submit <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:07:12 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:45870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1f1dpF-0005AY-Fc
 for 30948 <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:07:10 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 8725D12BD8;
 Thu, 29 Mar 2018 22:07:08 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id lnfDb7iQa_FT; Thu, 29 Mar 2018 22:07:07 +0200 (CEST)
Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 9C6F212BD7;
 Thu, 29 Mar 2018 22:07:06 +0200 (CEST)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Carlo Zancanaro <carlo@HIDDEN>
Subject: Re: [bug#30948] [PATCH core-updates] guix: Reap finished child
 processes in build containers.
References: <87muyvulwt.fsf@HIDDEN>
Date: Thu, 29 Mar 2018 22:07:05 +0200
In-Reply-To: <87muyvulwt.fsf@HIDDEN> (Carlo Zancanaro's message of
 "Mon, 26 Mar 2018 22:16:34 +1100")
Message-ID: <87bmf6ve6u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 30948
Cc: 30948 <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 (+)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Carlo,

Carlo Zancanaro <carlo@HIDDEN> skribis:

> When working on the Shepherd, I found that in the build containers
> processes don't get reaped by pid 1. See
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30637#29. This caused
> (and will cause) the Shepherd's tests to fail on some systems.
>
> Our guile-builder script should handle SIGCHLD and then use waitpid to
> reap the child processes. Here's my attempt at a patch to do that.

I would rather install the handler as a phase in gnu-build-system: this
leaves =E2=80=98build-expression->derivation=E2=80=99 generic, and also giv=
es us more
flexibility (e.g., we can disable that phase without doing a full
rebuild if needed.)  See the patch below.

WDYT?

On my first attempt with:

  ./pre-inst-env guix build -e '(@@ (gnu packages commencement) findutils-b=
oot0)'

quickly failed:

--8<---------------cut here---------------start------------->8---
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... Backtrace:
In ice-9/boot-9.scm:
yes
checking for working vfork... (cached) yes
checking for strcasecmp...  157: 13 [catch #t #<catch-closure c900a0> ...]
In unknown file:
   ?: 12 [apply-smob/1 #<catch-closure c900a0>]
In ice-9/boot-9.scm:
  63: 11 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 10 [eval # #]
In ice-9/boot-9.scm:
2320: 9 [save-module-excursion #<procedure cc1b80 at ice-9/boot-9.scm:3961:=
3 ()>]
3966: 8 [#<procedure cc1b80 at ice-9/boot-9.scm:3961:3 ()>]
1645: 7 [%start-stack load-stack #<procedure cbd2c0 at ice-9/boot-9.scm:395=
7:10 ()>]
1650: 6 [#<procedure cc3060 ()>]
In unknown file:
   ?: 5 [primitive-load "/gnu/store/pz3jy89ax5jg0j6fnp5n42x4vznga8s3-make-b=
oot0-4.2.1-guile-builder"]
In ice-9/eval.scm:
 387: 4 [eval # ()]
In srfi/srfi-1.scm:
 619: 3 [for-each #<procedure 1217560 at /gnu/store/hf8xflikhgsd4hfy9h8s0cj=
zfqm8f3yb-module-import/guix/build/gnu-build-system.scm:815:12 (expr)> ...]
In /gnu/store/hf8xflikhgsd4hfy9h8s0cjzfqm8f3yb-module-import/guix/build/gnu=
-build-system.scm:
 819: 2 [#<procedure 1217560 at /gnu/store/hf8xflikhgsd4hfy9h8s0cjzfqm8f3yb=
-module-import/guix/build/gnu-build-system.scm:815:12 (expr)> #]
In /gnu/store/hf8xflikhgsd4hfy9h8s0cjzfqm8f3yb-module-import/guix/build/uti=
ls.scm:
 614: 1 [invoke "/gnu/store/g34swjqyw205d15pyra39j56qvyxq9w9-bootstrap-bina=
ries-0/bin/bash" ...]
In unknown file:
   ?: 0 [system* "/gnu/store/g34swjqyw205d15pyra39j56qvyxq9w9-bootstrap-bin=
aries-0/bin/bash" ...]

ERROR: In procedure system*:
ERROR: In procedure system*: Interrupted system call
builder for `/gnu/store/hc96d5dcshbdgavpp0j01qnsjf0yf9z5-make-boot0-4.2.1.d=
rv' failed with exit code 1
--8<---------------cut here---------------end--------------->8---

This is why =E2=80=98install-SIGCHLD-handler=E2=80=99 in the patch does not=
hing on Guile
<=3D 2.0.9.

Now, we=E2=80=99d need to test it for real with Guile 2.2.  I suppose one w=
ay to
test without rebuilding it all would be to add this phase explicitly in
a package and try building it with --rounds=3D10 or something.  Would you
like to try that?

Note that we have only a couple of days left before the =E2=80=98core-updat=
es=E2=80=99
freeze.

Thanks,
Ludo=E2=80=99.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index be5ad78b9..2c6cb4ad2 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -51,6 +51,28 @@
    (define time-monotonic time-tai))
   (else #t))
 
+(define* (install-SIGCHLD-handler #:rest _)
+  "Handle SIGCHLD signals.  Since this code is usually running as PID 1 in the
+build daemon, it has to reap dead processes, hence this procedure."
+  ;; In Guile <= 2.0.9, syscalls could throw EINTR.  With these versions,
+  ;; installing a SIGCHLD handler is not safe because we could have uncaught
+  ;; 'system-error' exceptions at any time.
+  (when (or (not (string=? (effective-version) "2.0"))
+            (> (string->number (micro-version)) 9))
+    (format #t "installing SIGCHLD handler in PID ~a\n" (getpid))
+    (sigaction SIGCHLD
+      (lambda _
+        (let loop ()
+          (match (catch 'system-error
+                   (lambda ()
+                     (waitpid WAIT_ANY WNOHANG))
+                   (lambda args
+                     '(0 . -)))
+            ((0 . _) #f)
+            ((pid . _) (loop)))))
+      SA_NOCLDSTOP))
+  #t)
+
 (define* (set-SOURCE-DATE-EPOCH #:rest _)
   "Set the 'SOURCE_DATE_EPOCH' environment variable.  This is used by tools
 that incorporate timestamps as a way to tell them to use a fixed timestamp.
@@ -758,7 +780,8 @@ which cannot be found~%"
   ;; Standard build phases, as a list of symbol/procedure pairs.
   (let-syntax ((phases (syntax-rules ()
                          ((_ p ...) `((p . ,p) ...)))))
-    (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack
+    (phases install-SIGCHLD-handler
+            set-SOURCE-DATE-EPOCH set-paths install-locale unpack
             bootstrap
             patch-usr-bin-file
             patch-source-shebangs configure patch-generated-file-shebangs

--=-=-=--




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

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


Received: (at 30948) by debbugs.gnu.org; 26 Mar 2018 23:39:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 26 19:39:58 2018
Received: from localhost ([127.0.0.1]:54927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f0biX-0004OR-G6
	for submit <at> debbugs.gnu.org; Mon, 26 Mar 2018 19:39:58 -0400
Received: from mail-pf0-f178.google.com ([209.85.192.178]:40409)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f0biU-0004OB-1R
 for 30948 <at> debbugs.gnu.org; Mon, 26 Mar 2018 19:39:55 -0400
Received: by mail-pf0-f178.google.com with SMTP id v66so5680096pfv.7
 for <30948 <at> debbugs.gnu.org>; Mon, 26 Mar 2018 16:39:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:references:user-agent:from:to:subject:in-reply-to:date
 :message-id:mime-version;
 bh=JH42JLREWHcDGcHQfuMWpLGydG/QAXtfUzEZ+Pv0DpY=;
 b=Aev745OA8qfwc+GiafRrK9HAHtWO5pV2wji6CHyUpzMpgsuUMFZpd+jhxCP0qPC7Qb
 oQ3P/d4rawueenzO3/O5PAz9xin22UK1dy5QNk7Jd34VvraGO+DOlCknYCaT2wTkFq16
 zL4qY5qosro8Gpmxl2tphRXucOstxxAXnZIGh07I/cX6eNKptx4Gg2AMPK2x+GnTlSol
 LTpAFwLXscNJDIrJ4hljdXyHlNXibonyqI5YRXZrajVHU1/53mfbOtyEk1YMql3z7/bU
 59RzwsynJP/sngy2l661RoAV6CeO/8EYUM1EUs33PWHYU50hQXHJmye+uMfs2qOKM4ww
 wKiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:references:user-agent:from:to:subject
 :in-reply-to:date:message-id:mime-version;
 bh=JH42JLREWHcDGcHQfuMWpLGydG/QAXtfUzEZ+Pv0DpY=;
 b=HZOxdZIwfWmhl5mESdXfQzObTSI98Nm52RVnbNQNtUn/QLKFYkfpB995nn77503Gm3
 Eaq+/ma/HivQidrnM2tAW+4Net8/93YQfWObzraJA4v0jU9kquHZ7epK+gN+0rbe1Ld3
 Cf3Dz+nwpmpFV/M/cueNjEmJWrJNpZWqgO09vBbWE+AY0I0l9FlV8rG6YLfytV3hJKqv
 3ZyZLjHUYYsbY1OVTYAxEZtBhl2i496ZacxsDDdvWRPwxDrA8fn1WwB2SQFjWkqk2i0H
 iQ1byjMU0Yp5v+qWOrhWWwsN7K+gf8jiMqajkkqBvDwQ9veSrnHiM4Q1yioqBCuSv9AQ
 fuaQ==
X-Gm-Message-State: AElRT7H0RQXmsctL6IX/0NO6RJ6nMZqJD0Nl/WccVDWix1mo8VCnVglo
 b8XO3tJIjhNSC8CzlYqwS2E7h7W4
X-Google-Smtp-Source: AG47ELsTSVkJBhBBQNuf+uIbG2XbfvJ+/kQa+WZ0g7nhx3xmiqkFxreR2CU2pV2qcZig5d8qZkl+pw==
X-Received: by 10.99.49.19 with SMTP id x19mr15921473pgx.250.1522107587741;
 Mon, 26 Mar 2018 16:39:47 -0700 (PDT)
Received: from pidgey ([210.1.202.160])
 by smtp.gmail.com with ESMTPSA id o88sm23591061pfk.53.2018.03.26.16.39.45
 for <30948 <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 26 Mar 2018 16:39:46 -0700 (PDT)
References: <87muyvulwt.fsf@HIDDEN>
User-agent: mu4e 1.0; emacs 25.3.1
From: Carlo Zancanaro <carlo@HIDDEN>
To: 30948 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates] guix: Reap finished child processes in build
 containers.
In-reply-to: <87muyvulwt.fsf@HIDDEN>
Date: Tue, 27 Mar 2018 10:39:41 +1100
Message-ID: <878tae76f6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 30948
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.5 (/)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; format=flowed

Okay, it turns out my previous patch was very wrong. I tried to 
start a build and it broke pretty significantly.

I've attached a new patch that at least starts building. My 
computer takes too long to actually build anything, but I'm 
slightly more confident that my change won't break everything.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-guix-Reap-finished-child-processes-in-build-containe.patch
Content-Transfer-Encoding: quoted-printable

From=20c57b2fe19865afc21fd1fd9a7cad3286b05a9b22 Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@HIDDEN>
Date: Mon, 26 Mar 2018 22:08:26 +1100
Subject: [PATCH] guix: Reap finished child processes in build containers.

* guix/derivations (build-expression->derivation)[prologue]: Handle SIGCHLD
  and reap child processes when they finish.
=2D--
 guix/derivations.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index da686e89e..27ab3e420 100644
=2D-- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1201,6 +1201,21 @@ ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUI=
LD?, and SUBSTITUTABLE?."
                                           (else drv))))))
                                inputs))
=20
+                      ;; The root process in the build container should re=
ap
+                      ;; processes that die, so handle SIGCHLD.
+                      (use-modules (ice-9 match))
+                      (sigaction SIGCHLD
+                        (lambda _
+                          (let loop ()
+                            (match (catch 'system-error
+                                     (lambda ()
+                                       (waitpid WAIT_ANY WNOHANG))
+                                     (lambda args
+                                       '(0 . -)))
+                              ((0 . _) #f)
+                              ((pid . _) (loop)))))
+                        SA_NOCLDSTOP)
+
                       ,@(if (null? modules)
                             '()
                             ;; Remove our own settings.
=2D-=20
2.16.2


--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq5hL0ACgkQqdyPv9aw
Ibw7AA//fT/jMaBcVfGr2W+AN+nsndZ5kJyFAh+y+IbSah3QFYX4FThNTMn0vxLB
Wk2lB84ry+jRk5v8P/SFJSrgf6QkoU50psNwd/rkH9fUjjVfLlSGyV5qMwxybNoj
QbT2YL/e0xDt1RNN92wuAOQv8PrsBS2ZLqow2fU9H9tPrEb9SBr8ej1oyeGcLs/z
ybJlk1KcXpJ79Er716r7tEJxTyiAWOu/PTwvetfsvohUoSoIMgIofBYYudWVP2xr
1ABOASzEITWO2/0Y+XkoN3J8SZTVWjLssw9aaHLdE+7PD7DkDA/qvlzpbLM48SzK
eTsmRxXU8li5Sif6wHZ9Y0snWKs4tS1QbExFXJL2dnKOOpltp6ddsrvFq4SX4lMX
dQ8l85KWvJDOjnPJ1VaU5OjNUcAGpcHrLvcZ17ePCwDOiuZNZFA1CBhxD5RbH+0B
1usyMd8PvVUo+H8HGC2cbhlwiuZjn6Id4kgn7j9ozaMaRfbUt8yP++EIt/+8GEvo
V3uTNVVNXL8omBIXrZH3zOcznqZE/X5yAswcWINShHiWI9Hm6xspspdJp4bPu8+U
hFRaW7+Zf1TFbJkg4aDTxpORzP4WOCkzqXb1Kz6gS1qa2PwqzSdLZGq6h5Ep6xmk
3F312fAFpAP03uOKuwVdtHrsH/e+nfVfKk5b2EIBgze8E5N96TQ=
=AsO6
-----END PGP SIGNATURE-----
--==-=-=--




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

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


Received: (at submit) by debbugs.gnu.org; 26 Mar 2018 11:17:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 26 07:17:01 2018
Received: from localhost ([127.0.0.1]:53668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f0Q7Y-0005xD-VD
	for submit <at> debbugs.gnu.org; Mon, 26 Mar 2018 07:17:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55989)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f0Q7W-0005wy-NY
 for submit <at> debbugs.gnu.org; Mon, 26 Mar 2018 07:16:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f0Q7P-000476-TD
 for submit <at> debbugs.gnu.org; Mon, 26 Mar 2018 07:16:53 -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,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:58291)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <carlozancanaro@HIDDEN>)
 id 1f0Q7P-00043T-Lw
 for submit <at> debbugs.gnu.org; Mon, 26 Mar 2018 07:16:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46944)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f0Q7O-0002Ah-5V
 for guix-patches@HIDDEN; Mon, 26 Mar 2018 07:16:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <carlozancanaro@HIDDEN>) id 1f0Q7K-0003tJ-Vz
 for guix-patches@HIDDEN; Mon, 26 Mar 2018 07:16:50 -0400
Received: from mail-pl0-x22b.google.com ([2607:f8b0:400e:c01::22b]:35851)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <carlozancanaro@HIDDEN>)
 id 1f0Q7K-0003rU-Oo
 for guix-patches@HIDDEN; Mon, 26 Mar 2018 07:16:46 -0400
Received: by mail-pl0-x22b.google.com with SMTP id 91-v6so3919942pld.3
 for <guix-patches@HIDDEN>; Mon, 26 Mar 2018 04:16:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:user-agent:from:to:subject:date:message-id:mime-version;
 bh=7BU8qg1xP8FyMbihUYSSkxFhBGuqSLAZG4pCWK/0h9c=;
 b=c0mH5bKthuKG83wm1qct+0QLOZibUvY5kp368Afbe8Npc1Oj0oXSIuxpPKogQA/p72
 yVFUC4WkwoZ00BaR8HfFWSNHxxLrmBqCj9RASthWIXBf2kExj9VHPweeehLnyewiXnoT
 eFLmu8jO+j+AFKDedykQbYuB7Ut3KJD02zMbPGFwuAGOjX72kntu5oCJwD1qMApTcVoF
 wylurfybngZrd5OcGhL34pY+OvvoVdFlcW8SyBYVQA37DtcxabbLq8amolbFilMISTPE
 EqNZ9cO7SyhNtr6K+4agR2ZrY/mehQdLZ4Kao2MroT+/0y454xi/39cGHMbGWuNdzzhX
 mIXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:user-agent:from:to:subject:date
 :message-id:mime-version;
 bh=7BU8qg1xP8FyMbihUYSSkxFhBGuqSLAZG4pCWK/0h9c=;
 b=KnnModVUwNghzhTMRtLTXp26Bvo/FAcXR+7pf0J2R4GXXxLhyC2O3h9k2qwgfglKUZ
 Aw64SPuvljviSe0Dhb4zGYBeBnHvelQVp9DxI1H2Be2T31ddjpJ1rTvzA4QcJHTfidc7
 WX5eEHnvYF1ZGM2fq3SQt9o/L3EzAs5B3vjWsLFcPKaWSdjq11HxIGr6kG2efjiOzDv4
 Y0E/+x9CMkpnvEpSr6HlkoNoIJ0JMcZ7cJFBO2s9p+17zYcwE5UhfecndtgSFbrgHpX1
 9YCOIfvmi0xmB+cRCQgIHdd1+nCbJXK/EIeYVWoWabI/As0o5JvSfVv0+Gj2o72PHLHO
 NpeQ==
X-Gm-Message-State: AElRT7E3iI3+Ouzwg2K5GLOz81KHEm4YrYIjXbbRDNo+7FPR2qSUlghx
 uot//ZRkhQBXAlltbA6olktFi1JH
X-Google-Smtp-Source: AG47ELu4I+68a0xyOYrxXZZLuxpFFdZ4cEx0yNXiWmRTqxScXu0ozymIcE00MrvlcojFwn4kASre6w==
X-Received: by 2002:a17:902:aa48:: with SMTP id
 c8-v6mr39305678plr.361.1522063005236; 
 Mon, 26 Mar 2018 04:16:45 -0700 (PDT)
Received: from pidgey (210-1-202-160-cpe.spintel.net.au. [210.1.202.160])
 by smtp.gmail.com with ESMTPSA id t1sm25792799pgs.47.2018.03.26.04.16.42
 for <guix-patches@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 26 Mar 2018 04:16:44 -0700 (PDT)
User-agent: mu4e 1.0; emacs 25.3.1
From: Carlo Zancanaro <carlo@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates] guix: Reap finished child processes in build
 containers.
Date: Mon, 26 Mar 2018 22:16:34 +1100
Message-ID: <87muyvulwt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.5 (---)
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.5 (---)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; format=flowed

When working on the Shepherd, I found that in the build containers 
processes don't get reaped by pid 1. See 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30637#29. This 
caused (and will cause) the Shepherd's tests to fail on some 
systems.

Our guile-builder script should handle SIGCHLD and then use 
waitpid to reap the child processes. Here's my attempt at a patch 
to do that.

I haven't been able to build anything with it because the computer 
I'm currently on is laughably slow. If someone else can check that 
you can still build with it I'd really appreciate it.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-guix-Reap-finished-child-processes-in-build-containe.patch
Content-Transfer-Encoding: quoted-printable

From=207c66818570a139fc4e7b11de34d07c76ebdc6bac Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@HIDDEN>
Date: Mon, 26 Mar 2018 22:08:26 +1100
Subject: [PATCH] guix: Reap finished child processes in build containers.

* guix/derivations (build-expression->derivation)[prologue]: Handle SIGCHLD
  and reap child processes when they finish.
=2D--
 guix/derivations.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/guix/derivations.scm b/guix/derivations.scm
index da686e89e..80787e99e 100644
=2D-- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1180,6 +1180,17 @@ ALLOWED-REFERENCES, DISALLOWED-REFERENCES, LOCAL-BUI=
LD?, and SUBSTITUTABLE?."
                            (filter module-form? exp))
                           (_ `(,exp)))
=20
+                      ;; The root process in the build container should re=
ap
+                      ;; processes that die, so handle SIGCHLD.
+                      (sigaction SIGCHLD
+                        (lambda ()
+                          (let loop ()
+                            (match (waitpid WAIT_ANY WNOHANG)
+                              ((0 . _) #f)
+                              ((pid . _) (loop))
+                              (_ #f))))
+                        SA_NOCLDSTOP)
+
                       (define %output (getenv "out"))
                       (define %outputs
                         (map (lambda (o)
=2D-=20
2.16.2


--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq41pIACgkQqdyPv9aw
IbwkIBAAsY1CkKoTi0SFmbjGNXXx+PQQmvKBYn94UCRIl6VdhAFiShvNqo0wlDn3
EaRBhyJfC6ZPVTBGhJkdKY1Ar8xiL/9XYE/GpWKzCpITaccTpS1PwLO6A5dmXwUp
5jhhVOfVT1cQb7jSEWlDzee2gcnMUEWwoxM259/tJX3bJeYROnuhfQwZ4PFqBNWq
8njF6cdPVKh059A0Lvp4VUas7HnskHosdzoRzAsFjiwuQMtXX4eO4Vpb1fUsNocA
90JrgJZayu0PfvF3BG8qbkQJixSsgkbBB478L3kk/XUJJsjDCEAA0JYyXPEAWzE7
tmC6DQeZvxl9N7gVYFLk0gWdXXaFWwPieLYR7CvQwk+r9s9bY5b0/904cdx6ZcbY
UARtItvXJM3raYuFdG69Dtw/xkj906ljRr+USTcB5kBgrl6oZWh27bVKNVVefdOs
TNUFjx7gRUvuFPU6N5foxoJ5+STP4DEg75zqYleLVHhJ/kX7TprviA+aOik+uiN3
/C/WpoWPBxvb++2TYD0VML97OHZa8MML9DswhZvchY2PHHkFfmCrJAYjTj/gHje+
FfRODwEj+EiqTNRnATyFFKzcIRPQkpWyytPbk6T/tq5HonzfD1bmTDTeZY7A4Orh
5gC3Z711PvfLe+N/9JZHBAwSel8sFHyrGw8cv161vxtn2llQlSY=
=XRYr
-----END PGP SIGNATURE-----
--==-=-=--




Acknowledgement sent to Carlo Zancanaro <carlo@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#30948; 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: Fri, 30 Mar 2018 11:30:02 UTC

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