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: igc, macOS avoiding signals Date: Tue, 31 Dec 2024 14:19:44 +0000 Message-ID: <87h66kndfd.fsf@protonmail.com> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <87msgdkt29.fsf@gmail.com> <86h66lnjrt.fsf@gnu.org> <868qrxnfrw.fsf@gnu.org> <87a5ccl2zx.fsf@gmail.com> <86o70sm1ts.fsf@gnu.org> 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="35739"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Helmut Eller , gerd.moellmann@gmail.com, spd@toadstyle.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 31 16:05:46 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 1tSdoX-00097J-6f for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Dec 2024 16:05:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSdnq-00028N-W7; Tue, 31 Dec 2024 10:05:03 -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 1tSd69-000120-3i for emacs-devel@gnu.org; Tue, 31 Dec 2024 09:19:53 -0500 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSd67-00036P-DW for emacs-devel@gnu.org; Tue, 31 Dec 2024 09:19:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735654788; x=1735913988; bh=+LNbNynIiLNAbMbW8Aj0OesXDiWBfaUnKTuwhyHVzJc=; 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=NJtiNAtvnHz1sHeXmc+JzYwCb72KJGRycf9GdNGPuDuSbQrH+8xofvsRml5HiIWxq E2gvgbkbi82T/MGs4gyP2MJjGFHB1eqF1B/vyuhTJwvmF+BbRwUPFrkMGipdUfrHDl Kr0cvjqwW54sVd/H3k0IFm/IYqWTxjBlzAWrPHQ2ppOElRMhnDpBYwuO3/ZK96UOGM 1I29Y2X5widk87BB/Jh2HhKPqtBhFxK+MmhN1MWHfHeCQ0UNB+HZMDolmDOus9KI0b cQyr2I40qWugCV7y7ihb6fO2cn8ips1yARJmdfssk5coF6cqxjm6aMywpW1l9V2oer oTNl+tKDkuiuA== In-Reply-To: <86o70sm1ts.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 4dc8f57c430515fda29243c3cd71395ae46e75b5 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: Tue, 31 Dec 2024 10:05:01 -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:327520 Archived-At: "Eli Zaretskii" writes: >> From: Helmut Eller >> Cc: Eli Zaretskii , pipcet@protonmail.com, >> spd@toadstyle.org, emacs-devel@gnu.org >> Date: Tue, 31 Dec 2024 08:34:42 +0100 >> >> On Mon, Dec 30 2024, Gerd M=C3=B6llmann wrote: >> >> > Eli Zaretskii writes: >> > >> >>> From: Gerd M=C3=B6llmann >> >>> Cc: Helmut Eller , pipcet@protonmail.com, >> >>> spd@toadstyle.org, emacs-devel@gnu.org >> >>> Date: Mon, 30 Dec 2024 19:37:38 +0100 >> >>> >> >>> So, to summarize, everyone agrees with Helmut? >> >> Except the POSIX police: it says that pthread_mutex_trylock isn't async >> signal safe. I suppose this also makes it's unsafe to use MPS's fault >> handler in an async signal handler. Bummer. (Does the police take >> bribes?) > > Doesn't MPS itself call it from a SIGSEGV handler? Worse, it calls pthread_mutex_lock, IIUC. This isn't POSIX but works (on GNU/Linux, it works as long as you don't make the mutex recursive or rely on deadlock detection. IIRC MPS uses normal or error-checking mutexes only and only uses deadlock detection to abort). >> I wonder if the backtrace that we see in the signal handler is any >> different from the backrace that we would see at the next safe point >> (i.e. the next time maybe_quit is called). > > I think we cannot rely on that, because maybe_quit must be called by > hand, it isn't magic. We call it from various places in the > interpreter, which could well be in some other place of a Lisp > program. > > Once again, why not ask the MPS folks to give us a callback? Or maybe > we could try hacking MPS ourselves first, to see if that does the job, > and ask them then? I'm not sure what your suggestion is at this point, sorry. You said in another email not too long ago that you wanted to improve the current code by special-casing "simple" signals; I agreed; now you appear to be saying we should wait for an MPS modification. Pip