From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: scratch/igc: Avoid MPS being interrupted by signals Date: Wed, 08 Jan 2025 08:27:24 +0000 Message-ID: <87ldvlg17a.fsf@protonmail.com> References: Reply-To: Pip Cet 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="19444"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 08 13:16:13 2025 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 1tVUyp-0004qX-UD for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jan 2025 13:16:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVUwj-0002c9-Av; Wed, 08 Jan 2025 07:14:04 -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 1tVRPb-0003f4-DU for emacs-devel@gnu.org; Wed, 08 Jan 2025 03:27:35 -0500 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVRPY-0003ke-HF for emacs-devel@gnu.org; Wed, 08 Jan 2025 03:27:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736324847; x=1736584047; bh=92cGWMOy2T/0PwBI9k4r+2/7tcT0Z9ufnbzGWLvHDxQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=D94EOyed5qkREcydBa+Ss2IEYUxibre7oUm3NGAiEcasc7Pfn4bBwLbr77K+A3Ot+ R7EGfJjD4hBmOg9WcX1AOhGHteg8f3q5U3OVsPT5HSN3U3tKbM/HWJ3RFV8mUGI6F4 BBklEtVy4d1puGOlYXvzAsrnmMAN/WDnUm5R5gziaPFT7pyHC3FLaXNxWMiCiMzVHP 0qY8IdTHWMQnRbnbVRr6Uiz1WJDav1Wo3IwUsyz/r+m7zjPLEa/+mG7cvd7zZmJPUe MQbnImJKbKVcAIfU6CKL0Le3BM889cY8eu3Igmg0B+8REXt6V84u5kt7+kImt54HgZ CXQfKpBNar5tw== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 88c3c2875e610c8720d080a486863b59a80c80f0 Received-SPF: pass client-ip=185.70.40.134; envelope-from=pipcet@protonmail.com; helo=mail-40134.protonmail.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 08 Jan 2025 07:12:36 -0500 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:327785 Archived-At: Gerd M=C3=B6llmann writes: > As I mentioned, I reverted > > ceec5ace134 * Avoid MPS being interrupted by signals > > in my fork because I observed worse "smoothness" in interactive use on > macOS. Eli said Helmut was working on fixing this commit for SIGIO/SIGPOLL, which is most likely the problem (and implied I shouldn't work on that, of course, because Eli). OTOH, if we just fix the few remaining handlers, it's safe to remove it. > Is this commit still strictly necessary on non-macOS now that I don't understand why you think this differs between macOS and non-macOS. The way macOS handles SIGSEGV does not make things any safer: if a signal handler accesses MPS data we lose on any platform. That said, there aren't that many signal handlers. Definitely SIGINT (accesses terminal data), technically SIGUSR (accesses symbol, string, string data), probably more on Windows and Android. > Helmut's changes for SIGPROF are in? Helmut's changes for SIGPROF and SIGCHLD were present before that commit. They make SIGPROF safe, but discard data when igc_busy_p (), which has false positives. I don't understand why SIGCHLD needs a fixed-size queue and function pointers rather than simply setting a flag, but what it does now is safe. igc_busy_p () uses pthread_trylock, but that seems safe on glibc. > If not, I'd like to reverse it on scratch/igc. I don't know what you decided wrt scratch/igc and Eli. If we really want to spend more time on signal handling we can remove it and fix the remaining handlers; if we don't, special-case safe signals and leave it in. Pip