From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0PWKE1ti4GH1GwEAgWs5BA (envelope-from ) for ; Thu, 13 Jan 2022 18:33:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eELfEFti4GGf9AAA9RJhRA (envelope-from ) for ; Thu, 13 Jan 2022 18:33:15 +0100 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 EA4F81D63C for ; Thu, 13 Jan 2022 18:33:14 +0100 (CET) Received: from localhost ([::1]:57750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n83yL-0003Q3-Mv for larch@yhetil.org; Thu, 13 Jan 2022 12:33:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n83vH-0001ID-Bp for bug-guix@gnu.org; Thu, 13 Jan 2022 12:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n83vG-0001xN-Tm for bug-guix@gnu.org; Thu, 13 Jan 2022 12:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n83vG-0002V6-G2 for bug-guix@gnu.org; Thu, 13 Jan 2022 12:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52779: tests/no-home test failure in Shepherd Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 13 Jan 2022 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52779 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52779-submit@debbugs.gnu.org id=B52779.16420949649525 (code B ref 52779); Thu, 13 Jan 2022 17:30:02 +0000 Received: (at 52779) by debbugs.gnu.org; 13 Jan 2022 17:29:24 +0000 Received: from localhost ([127.0.0.1]:34460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n83ue-0002TZ-1t for submit@debbugs.gnu.org; Thu, 13 Jan 2022 12:29:24 -0500 Received: from mail-io1-f43.google.com ([209.85.166.43]:45922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n83uc-0002TH-LK for 52779@debbugs.gnu.org; Thu, 13 Jan 2022 12:29:23 -0500 Received: by mail-io1-f43.google.com with SMTP id s11so1295745ioe.12 for <52779@debbugs.gnu.org>; Thu, 13 Jan 2022 09:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=G4DgWcr8dmI/j1J08/yASbhDwQJpxr+sqoo9abLWv/A=; b=dmnqAUjQaASftqVdUutVJParjDBt31yWdnt4Vq8GcjXxogTrDpg5Y9Yk1HleVJ1UhJ U58xbJ6bWWm2zX53X4a5WmZHHL3F2EufKVNvn8hn2qpdWh8cQamFA0q8cxI3rw5KahCd I3elxd6Nlfz6XakOzuOQSaA0NXIl7Fd9DX+r3QM5j1VVH6u0yGfen0qZS454dRvfIQYV IdvOTbdtD3UITpVZIZXZqWj76K9j5QlMIWq3juf0j2zYhgcmFpd2sAEzZhkbTPvdq0Vr Ls8EgWlXzSANEFqTp5hPt/GuggejkTuPO8RmVHGFoh6v3l9HBya4b7aX+HnwSrJx9YEJ SsZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=G4DgWcr8dmI/j1J08/yASbhDwQJpxr+sqoo9abLWv/A=; b=Atwun5wL5UpplrVS+kQvu+QhXjVwOno5qu6QGWQkM3cy+dqMuwDzp0ngot001FNGld SzFRVXhjAonAuyt0LV/hrsUqmRvUlIrGqbo7EWyTlyeyAxpf01eHF0BBsmqCnQJkjLHi Gp5MuXKl6gnpPrOrWKPvXonsaQD8dVrmDPJsaMRUX7uCX8gCHqGAbjfThafOQVTLjmu6 d/TSXryPothpiXWx2BBP7RGupcLcdj+Xl524BSIBRZk99TJhGKJovkHWVleS5Gg4/FSZ AYs9J9tavoztSiMwGFOOKHXRzlmHs1RbeAmiN4RDJXCFKV/hhcn7eHfzRdF4oq/27q5y xjOQ== X-Gm-Message-State: AOAM53373F3jXNN2Dw6fQWR82KedumwIX0ULdPFZhC4ew0vYQ0drhoHD 63tzhvnmHE5NrFSUAgd1kEowVGbrh9c= X-Google-Smtp-Source: ABdhPJwuVEvJAWGzDhmGtsKIxSX7gBxXdLxC/cGlYIzZ8w9w2KqsvmHFVECSI9/S0e57gcDQ0Olmwg== X-Received: by 2002:a05:6602:24cf:: with SMTP id h15mr2642353ioe.8.1642094956938; Thu, 13 Jan 2022 09:29:16 -0800 (PST) Received: from hurd (dsl-152-155.b2b2c.ca. [66.158.152.155]) by smtp.gmail.com with ESMTPSA id c3sm3655092iow.28.2022.01.13.09.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 09:29:16 -0800 (PST) From: Maxim Cournoyer References: <87h7ayys14.fsf@gmail.com> <87ee5b7ik6.fsf@gnu.org> Date: Thu, 13 Jan 2022 12:29:14 -0500 In-Reply-To: <87ee5b7ik6.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 13 Jan 2022 16:37:45 +0100") Message-ID: <875yqn1r4l.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 52779@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642095195; h=from:from:sender:sender: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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=G4DgWcr8dmI/j1J08/yASbhDwQJpxr+sqoo9abLWv/A=; b=g4iBVyDlOLmT0+68qBzts4jbtQ0noEN9h1YqfVUjWkeViUrEGoLjwwBmX5GF3ZpKeAEMUP ADU3OuPnLADuHt2gYFfxNIGeQv4ZMBbH8lNUN5x7fH2jxDaNNh41FDmvcT/9wx7WLts4p3 lX/SviwZXlEqgSlBZZjptzydkZMttVnF1qj6YTW8eMGy2FJD6Gk3gxno3oBGRYrn+A3RgT KE86lzSnQRPhz7IAPQkFTE3hESND0ZK6Ico+u4E3rpJLRONODuIy9DsCAcNAcM5NHIguEr azdIn0bNAQ5XJwDzGJHLlBs4zxd8yQCsiQwtCWZOv4wEeMJCgwRI+OTjEQrVOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642095195; a=rsa-sha256; cv=none; b=GDmf74UeXKVsoaAR4AY7FyLmIIBipAdd6tcVpFftzXR53mDh/CwHgbLhZnUA+dlFfEfK3e gla2f8z2nBQ6ZV8n3F36Rb4TvO3DwlYrrqNqh3oDOTR6LFpfcn9CC8gAFelvjN4hVaJBRY t6P0uUKsBm1v6fpwEzzMKzZ8aqSArn6OKNmK2bTTPM5QRZ1zE6MoXDL4xDX5FKU9DmvD/V MPxDl1f5Yf3kJPTZbHc7ER/BxsIg42P1BVhsQ+VV+FvAu95SGQBRoSx8un7ozXM6AihRd7 4ORBtPrbW7g5om1CzvpfMS7jTCBeEv/EXbFiDvKcuMD6avrNJ81tsv5aUMk2pw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dmnqAUjQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dmnqAUjQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EA4F81D63C X-Spam-Score: -2.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: WkRfevrtIgSK Hi Ludo! Ludovic Court=C3=A8s writes: > Hello, > > Maxim Cournoyer skribis: > >> + herd -s t-socket-1651 status root >> Started: >> + root >> + herd -s t-socket-1651 stop root >> ++ cat t-pid-1651 >> + kill 1896 >> + exit 1 >> + rm -f t-socket-1651 >> + test -f t-pid-1651 >> ++ cat t-pid-1651 >> + kill 1896 >> + rm -f t-pid-1651 >> FAIL tests/no-home.sh (exit status: 1) > > What happens here is that the shepherd process is still alive after > =E2=80=98herd stop root=E2=80=99 has completed, contrary to what=E2=80=99= s expected: > > $herd stop root > > if kill `cat "$pid"` > then > exit 1 > fi Yes! [...] > Maybe there=E2=80=99s a chance that the shell hasn=E2=80=99t processed th= e shepherd=E2=80=99s > SIGCHLD when it evaluates the =E2=80=9Cif kill `cat "$pid"`=E2=80=9D cond= ition; in that > case, the shepherd process still exists as a zombie. > > A more robust approach might be to use the shell=E2=80=99s builtin =E2=80= =98wait=E2=80=99, > because then I suppose the shell will be forced to process pending > SIGCHLDs: > > diff --git a/tests/no-home.sh b/tests/no-home.sh > index 85b6116..5a8c278 100644 > --- a/tests/no-home.sh > +++ b/tests/no-home.sh > @@ -1,5 +1,5 @@ > # GNU Shepherd --- Make sure shepherd doesn't fail when $HOME is not wri= table. > -# Copyright =C2=A9 2014, 2016 Ludovic Court=C3=A8s > +# Copyright =C2=A9 2014, 2016, 2022 Ludovic Court=C3=A8s > # > # This file is part of the GNU Shepherd. > # > @@ -46,7 +46,4 @@ kill -0 `cat "$pid"` > $herd status root > $herd stop root >=20=20 > -if kill `cat "$pid"` > -then > - exit 1 > -fi > +wait `cat "$pid"` As I wrote, I was also unable to reproduce this (but when I had a high load of packages to build at the same time, I could get it to happen a couple times upon retrying). Your analysis (and the narrow window which would allow for a failure) makes sense to me, along with the proposed fix. I think you should commit it and tentatively mark this bug as fixed :-). Thank you for looking into it! Maxim