From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2EJrFV7NfGU6mgAAkFu2QA (envelope-from ) for ; Fri, 15 Dec 2023 23:04:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0DpZD17NfGXpbwAAe85BDQ (envelope-from ) for ; Fri, 15 Dec 2023 23:04:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail header.b=V5pZ9JA9; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702677854; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=K8RV7NWHXYbamVp89dcHEDhcY30JDbGsfp/gSNSe5nQ=; b=P3IWvBRu7oznUZr6ZcgDOLpt79xAYwR1Ar2xmBmmQjBIaUnjBTTjeieR6/x7eKSB8CfPRf hk/+SCZRM/hH+GxJuTVIRQ8Bd2IMThZOYFLkacBiQVR9ciR0aTHyAr03LFHhhAdzEofdV5 7OKjRPFAdWcDCZdnSKh67t2PlTlTyZSXoshrmgTprBGMXDfqwggUYjcIIV/q4mmjzKN1JL t/VlPIHL+0jgcmadX7N4gZm5MVu5t6A6cna1Yi87ukiiERZR36t84TQRJU48tk7tjVbRLc YqVNoFMfjnEnTZRvrTq6eTTeisWQDBHmO0yJzPfz7S89is55GsDo4rAPW24LeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail header.b=V5pZ9JA9; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702677854; a=rsa-sha256; cv=none; b=W3czFZZeF9v4RoohZXPc9l68Gk9g+agETWxSojtC11i36x6A9Tcj1Rf3rSPhb6X1FxW51P WR+t3fdk5BDUFxNqulnaZDAZ/JabowTUzyd39aUAN+x/4RfGxbkRcKlEjk5veJFIBNvxHQ BfHwrCWnoWwo5LMswoM+xC1Ae1jgq/6EmluFJ0J+cRXdATWSIrO9EWK7T+A1rsZ7lbAHaU FtfBFSB17KC5B/9DlHvzte4AsSbSHlkVy0t9cl6WPYOUDafgq/bOl4C4zxp/GJat7pwpKh RE7U9S5aouvpHTtZbbrWofjIKROt1ceiWzXu5wS9K7wP4eEjo6ZN/m7TDyytxg== 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 B687840F8C for ; Fri, 15 Dec 2023 23:04:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEGHR-0004Bh-Kn; Fri, 15 Dec 2023 17:03:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEGHP-00049N-TM for guix-devel@gnu.org; Fri, 15 Dec 2023 17:03:35 -0500 Received: from mail-4022.proton.ch ([185.70.40.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEGHN-0005FK-Dc for guix-devel@gnu.org; Fri, 15 Dec 2023 17:03:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail; t=1702677810; x=1702937010; bh=K8RV7NWHXYbamVp89dcHEDhcY30JDbGsfp/gSNSe5nQ=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=V5pZ9JA9VmZ9eJkJ5G8812MFZhe3LabXMTQCyk2OC7P76gHfU8PHXvpbX8EuGEINV nKoVyym9F626oPaimnJa6YvDJ3oexody292tFJB9Sj8P0IcsSQzzH1ORli65fgduJ1 hThpAUmZSX1KgLExrUE/FD3Y9BO3vxXvTvzaayK9c3KQsc1IOx45Kx3yIo++pQZDNH dI1hyAp8thV4WspPS/ywhMBdG/otAltI7F4ZhsI6PAX2fv2HAmTnPGYrFvcFQf1TRc cPXLZSYn7yilOy+RGtAyVMhPF05DCa+ZrnSmgioJM1clwOp7tt8ocL3ytGaugHV6F7 SKdaSaYi04y7A== Date: Fri, 15 Dec 2023 22:03:21 +0000 To: guix-devel From: Attila Lendvai Subject: shepherd, fibers, and signals (asyncs) Message-ID: Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.22; envelope-from=attila@lendvai.name; helo=mail-4022.proton.ch 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.86 X-Spam-Score: -3.86 X-Migadu-Queue-Id: B687840F8C X-TUID: STvM1+cv3ssA dear Guix, context: Shepherd stops responding during "guix system reconfigure" https://issues.guix.gnu.org/67538 https://issues.guix.gnu.org/65178 https://issues.guix.gnu.org/67230 i've added a ton of logging and asserts in my fork: https://codeberg.org/attila-lendvai-patches/shepherd which resulted in this report: https://github.com/wingo/fibers/issues/29#issuecomment-1858319291 to which @emixa-d kindly responded: https://github.com/wingo/fibers/issues/29#issuecomment-1858497720 which essentially identifies the following: -------------- posix signal handlers are async, and shepherd uses the fibers API from ins= ide signal handlers, specifically in at least handle-SIGCHLD. this violates the fibers API, and most probably leads to the root cause of = the reconfigure hang: a match-error flying out from service-controller due = to losing the value of the parameter called (current-process-monitor), whic= h then makes that fiber exit. i have little experience with posix signal handlers, so i probably won't co= me up with a fix for this, or at least not without someone's bird's eye vie= w guidance. maybe the solution could be something like packaging up posix signals and d= elivering them to the fibers universe by some form of polling of an atomic = variable? or is there some signal-safe semaphore facility in guile that cou= ld be used in accordance with the fibers API? --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CVirtue is never left to stand alone. He who has it will have neigh= bors.=E2=80=9D =09=E2=80=94 Confucius (551=E2=80=93479 BC)