From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KEQrLIfiQmKMhQAAgWs5BA (envelope-from ) for ; Tue, 29 Mar 2022 12:42:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +OreKYfiQmJQAAEA9RJhRA (envelope-from ) for ; Tue, 29 Mar 2022 12:42:15 +0200 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 88BC9114E9 for ; Tue, 29 Mar 2022 12:42:14 +0200 (CEST) Received: from localhost ([::1]:45716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZ9Ij-0000Do-Id for larch@yhetil.org; Tue, 29 Mar 2022 06:42:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ9Hc-00006t-A7 for guix-devel@gnu.org; Tue, 29 Mar 2022 06:41:08 -0400 Received: from [2a02:1800:120:4::f00:13] (port=38014 helo=baptiste.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZ9Ha-0001th-MJ for guix-devel@gnu.org; Tue, 29 Mar 2022 06:41:03 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id CAgy2700A4UW6Th01Agy2Y; Tue, 29 Mar 2022 12:40:58 +0200 Message-ID: Subject: Re: The Shepherd on Fibers From: Maxime Devos To: Zhu Zihao , Philip McGrath Date: Tue, 29 Mar 2022 12:40:58 +0200 In-Reply-To: <86sfr1t5fj.fsf@163.com> References: <87ee2sfg9d.fsf@inria.fr> <4f889372-3464-92df-b350-b7c61e081f31@philipmcgrath.com> <86sfr1t5fj.fsf@163.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-lsw6Yt+5yLN/+orYqGAX" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648550458; bh=DGTf/t7YE2u5b71p/MTJdQ5gU7ALK/N1utgGZqc1IHc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EjJfvs/Fe+QBWEcRlSdqK4xDzIUAh8wv/+zefkSe9pSR9NHP61hOShRrbVaQV21St lLUS5OWQ5rgkGDsrzQRgJ5KrLelDOWUP9cYj3+XP4uI1etKxIxNYjGiSq/BoMTfL7k OJrLzWffNnaC5ywOv7BmSDZXW7VK4hd9jaw24lOXM9DxSGkr0hZnD67kMjXuiaf3Q6 lVpKsWc/v//7AKLn2iykhjWOckYMt/u0eUPIZv96NHdbgv1dQY1+QKU8loWh3mIkFW Pr8gNGf24z4hh2IWTY2djij9jtXdt/FiDfOE9m2uZk7NxOnP2Xex2Fvfquz3IvqjMS KGxuvFjH4BHgg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:120:4::f00:13 (failed) Received-SPF: pass client-ip=2a02:1800:120:4::f00:13; envelope-from=maximedevos@telenet.be; helo=baptiste.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648550534; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DGTf/t7YE2u5b71p/MTJdQ5gU7ALK/N1utgGZqc1IHc=; b=b1UAkWwTy8hVSL3QNxqIuaWKmJo9PHG7YvrJrhKvY4fVfhAl7sbX5e5/GKMZkYj22jbsWK ckAZ8+ojptN/f90E7Xwygv+i6OLnIXKbtta1DZ/+jDYNABq02160uyUr613jMOWvqO4dLA ZSqxk084wVTZcjXnq/YJX+2cX7Z/CcFnt4KtD3aCeVsJVmQUbpFPyeDXb6sDrEzSU3W360 j4+2Ve+2qVy5oXBjUBr7qYU5tgOtyoeVigKT7A7Yg3gEWs+3D2TPQ+PRbplD69R7UcPU8J sLfAo8XMYVufbW3QI5OtAm4ZBrpKFg2x/6xzdukn3P2J/hIgdIdti4To1t6zNQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648550534; a=rsa-sha256; cv=none; b=pVLYvj2pNvb+H16kQvoj2Lf9P015+OOXv547IeTWXMEjvdc/pW+WDTsdCbAeWN3Cwh74BA 9MSmBnO+OA3bmi9M5BRuAFeLS914YV9p6rnO1H6FvgWVw5/psurhNCnrq/xnLnWmH1p3lX svcXck2lfb1KDRcRupcrafcDXoC+KuZShHy+lW6C6Gto55NX/vEf1yKBGfT8X+480dkV+U cXliFZYwlhYsDoVR+BuXt9YRBRUS8rAuISzhsAloFMzkQh9iuoTA9pp6IC2XjZzM5jvq8x dFQ/8ixF3Qkkwe8+7yBEZpdNyd1/Jk5K+KJfm0EB8mD11IVNc6w2ITYRtGXRbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b="EjJfvs/F"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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" X-Migadu-Spam-Score: 3.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b="EjJfvs/F"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); 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" X-Migadu-Queue-Id: 88BC9114E9 X-Spam-Score: 3.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: zNImZBvTtEda --=-lsw6Yt+5yLN/+orYqGAX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Zhu Zihao schreef op di 29-03-2022 om 18:13 [+0800]: > IMO the problem is not fork, you can't do anything useful to create > subprocess without fork on *NIX systems. >=20 > fork is allowed to execute in multi-thread environment. It just don't > care about other threads, it's safe and recommended if you only call > execv after fork. >=20 > The problem is, Shepherd is too flexible and people can do so many > things other than fork+exec in the startup of Shepherd service > (unlike > systemd, only create subprocess is allowed). So Shepherd has to be > conservative. >=20 Being conservative is not sufficient. What if, in-between 'fork' and 'exec', some memory is allocated (and hence, in typical 'malloc' implementations, locking happens)? Greetings, Maxime. --=-lsw6Yt+5yLN/+orYqGAX 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+4iGRcl7gUCYkLiOhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gPEAQDHuKZJC7ItcoWVSNqI3ZNFJ+Vj 870Nd9bbI2swsg12jwD9EIlfMqf3YZU+4Sqgmi3v2gARsJ0vbBUlUwNZwbmMFw4= =LL57 -----END PGP SIGNATURE----- --=-lsw6Yt+5yLN/+orYqGAX--