From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: SIGPROF + SIGCHLD and igc Date: Tue, 24 Dec 2024 09:39:58 +0100 Message-ID: References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> <864j2u442i.fsf@gnu.org> <87ldw55w28.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31244"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, acorallo@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 24 09:40:47 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQ0T9-00082h-8j for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 09:40:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ0ST-00084e-Qk; Tue, 24 Dec 2024 03:40:05 -0500 Original-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 1tQ0ST-00084W-1U for emacs-devel@gnu.org; Tue, 24 Dec 2024 03:40:05 -0500 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQ0SR-0002X4-Ft; Tue, 24 Dec 2024 03:40:04 -0500 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa684b6d9c7so890998266b.2; Tue, 24 Dec 2024 00:40:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735029600; x=1735634400; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O/nu2aCA0lKklHvxvXMgAMheyp0FV+m3jeh8Z9m3m50=; b=V2D0q7ce3FzoUyaKKjUC2Y99JAZc+ClQeKpzwbYcs6ycy2+vJxZkKFETl6CpYl5psD Vqir7pJ2vrho0FJCGV8EmlBndUFgdvxE49NlFkWXn5prFXQtkw9JlfPZy+l0vzd2/eaE zHv7wahsD6lh6x6fGQhYZJTP/+V3hhLtOOX3fogRS0hSD+INkosuncOBqVWKh0SUYRtI Jfgg17ELaNKlTiWb66AccB0KzhV1XOMqk+3WY7TelQmiGmzzJTt8sA6XAMCMNlciaIPS b16dLAvPUurLFqe+DTQL87OGnpImgV0vbs4kmN7yC6VZ/+dB35Eb4eda9vg3QkuCJCFL C2pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735029600; x=1735634400; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=O/nu2aCA0lKklHvxvXMgAMheyp0FV+m3jeh8Z9m3m50=; b=D2bSssI4JiWEjYBaTtYwgI27TTRss3MXNwg7TyWQYILvlohvW9stWK7uFusLIsLBAy V0GcZakJv/m+7kH4YvsE6r40g+5FeLwxHo3SmYZZqyeHLy7Bb5dP4QZOK/WBszlT5PtF ywfTeq1k6AAfp+fIVhE9Lc/PidoIVm2N/4kogTsxYckaAqfknJ4LOdKhevD/EGS0OE91 vanEWfzNCMjh+zpev+nn3Lzz6/yVQGnqBfl0Cob6aA2R3hOCSt5m4yuSxaIyj2az+H3R RHQGmI4ijd8f1MMvqcE35A2igFFsFzgE2Y9jRAJSMT7uJSDtZk+W2RbORH3S316nqov5 aAMg== X-Forwarded-Encrypted: i=1; AJvYcCWhyzhsheEl67bw8XJc33cYNFZPGxScY2w1Gaj3iIJloSZSWJ0PgnYUcZWMCpLRQ2wCKWoTq+eP1w==@gnu.org, AJvYcCXVVuBHTrzB4agvLgdCrTZkfTQdYJXFbVxTFuqijpd00YKfHjsAl6092bKG2EcUALemKUsF1xIk/2c7rYs=@gnu.org X-Gm-Message-State: AOJu0Ywizr4r6T4yKrQrPCUclNs4PWDJd4+D5rTSJOJro4P/gsvaeG65 SBBktwpdQUtMVQE3CkKZMsE6cpCRB/WOIwC4rIcfFfcL29ScYvKVf8YDwQ== X-Gm-Gg: ASbGncv+6XFh3CWokDIqBnQsRujyp87EtLNsiFxcvPa4dv0qFb1XDQ+eIEPh/2fFe70 82RUHtj98VaWslQyShnADnk5lJuisJItLYnzWdDj3phbk4gH86vSLd8JvOmyeL8dBQWcFUqg8RR WsMCFxPbvGPU6LPr1kGmyPmgs7TuvmjAdJY6+xbhAcgAgfv/EDGxRZsUipeTWjZNUBxjfzdHaDP RmhFJrIjltLF51tgcBKMBAiHm0MHOGSdmQgTDD0MrlOj0o8ZYT4Jxfui+LYi7j7ayXkoG2VuCMm gTZdsOfmCIrFSU34zQrout5Rm5TJr5SzSppck0VbiFL96g6W0f05tY/dqt7iYpVT1w== X-Google-Smtp-Source: AGHT+IH7u3a741Dq8pKVWi2Jlm4E67X7OmVoK/G61aclOJ1WRCuyjNFpzFpmxAYxm8Gj7x/04D1s5g== X-Received: by 2002:a17:907:1b85:b0:aae:849f:3255 with SMTP id a640c23a62f3a-aae849f3398mr790256466b.34.1735029600152; Tue, 24 Dec 2024 00:40:00 -0800 (PST) Original-Received: from pro2 (p200300e0b7326d00f9ed2197837c3ebd.dip0.t-ipconnect.de. [2003:e0:b732:6d00:f9ed:2197:837c:3ebd]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f011efdsm621477166b.134.2024.12.24.00.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 00:39:59 -0800 (PST) In-Reply-To: <87ldw55w28.fsf@gmail.com> (Helmut Eller's message of "Tue, 24 Dec 2024 09:23:11 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62c.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326975 Archived-At: Helmut Eller writes: > On Tue, Dec 24 2024, Gerd M=C3=B6llmann wrote: > > [...] >> Anyway, what I see here: SIGCHLD doesn't do anything dangerous in the >> signal handler. Instead, the occurrence of SIGCHLD is added to a queue >> with enqueue_async_work and that's basically it. > > Wrong branch! enqueue_async_work doesn't exist in master. ISTR that in > master it iterates through process-list. Also, Pip said something that > the queue is not signal safe, because signals can nest or something like > that. Also, Eli didn't like enqueue_async_work much. Oops, thanks for checking! And =F0=9F=91=8D to Pip. Then we have to see wha= t to do with nested signals if that's a problem. >> My personal summary for SIGPROF + SIGCHLD at this point: >> >> - I recommend rewriting SIGPROF handling in the way I tried to describe, >> possibly using the existing work queue mechanism. Everything else looks >> too complicated to me. >>=20=20=20 >> - Lisp allocation in signal handlers cannot exist because alloc.c is not >> reentrant which means we would crash with the old GC. We don't need >> anything extra for that in igc. >> >> - No longer wondering why macOS does not show any problems in that whole >> area. The only problem is SIGPROF accessing Lisp objects, and the >> memory barrier is not a problem on macOS because it doesn't use >> signals. >> >> Please double-check! > > I think, SIGIO might cause trouble. But that async IO code in process.c > is sooo hard to read. I wonder if it would be simpler with threads, > e.g. one thread per Lisp_Process. It's a maze :-(. BTW, do you agree with my analysis that Lisp allocations can't possibly exist in signal handlers today?