From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: a random backtrace while toying with gdb Date: Wed, 03 Jul 2024 11:31:48 +0000 Message-ID: References: <87bk3jh8bt.fsf@localhost> <86msn1fk0c.fsf@gnu.org> <86h6d9dlyg.fsf@gnu.org> <86h6d8c52h.fsf@gnu.org> <86sewrc057.fsf@gnu.org> 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="33596"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , eller.helmut@gmail.com, gerd.moellmann@gmail.com, yantar92@posteo.net, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 03 13:51:18 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 1sOyW5-0008QW-1i for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Jul 2024 13:51:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOyVi-0002eF-Ae; Wed, 03 Jul 2024 07:50:54 -0400 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 1sOyDP-0001TN-6X for emacs-devel@gnu.org; Wed, 03 Jul 2024 07:32:03 -0400 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 1sOyDM-000187-Mx for emacs-devel@gnu.org; Wed, 03 Jul 2024 07:31:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1720006314; x=1720265514; bh=MsXja3wIdV8BuyyuOTnGV8W+2T8KFlgWAJxU/Z4Rfro=; 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; b=ICeTW0eNrKdIIANaEpKNB7OFEmuCc80dcGI8aTIzleZ7BlpEOKBWtOV2e3w5xMiQu OdHiqCRuu6BBKFYrvs0ecnG7n9oExPtcNDE97HsyX3r5XT8NAs1d+NYEPZ1Rjtw4+f Lpu+4dn8P7+zkr12S9rSuTHC6Bul/JYXkQx55iYdaa2h0DCOH5wUZ6xSx2HzVPMZeM 18C0qhzVfQUOZB8iGZ2WN/t4IihGGa+4tc8UVrki3cXBpr1poF7pXUl2CB+jd/yQ8i rESjQz+zk1cIV46B62gkC179om8mQiUIPmGkHG2TONxVF+MHjR3D8PXiCGUyJ2nGji PhkWI7nTh9maw== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: c0e1edad154f5656ee84139dff118c587f09b207 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 03 Jul 2024 07:50:47 -0400 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:321250 Archived-At: On Tuesday, July 2nd, 2024 at 17:06, Pip Cet wrote: > > But even if I'm wrong, why is that important? We need to solve both > > kinds of situations, don't we? >=20 > Now that we have a way to reproducibly make it happen, yes, I agree. So what are the proposed solutions that are still on the table? I can think= of these: 1. block signals around MPS calls and block signals while the MPS SIGSEGV h= andler is running 2. handle signals in a special thread 3. switch Emacs to an event loop model and handle all signals asynchronousl= y (1) is hard to do because we'd need to hijack the SIGSEGV handler and/or mo= dify MPS (3) is a very major change which would mean permanently losing features we = want (2) is very easy to do, but gets complicated for SIGPROF (which needs to be= on the thread it's profiling) and emergency breakout signals which need to= modify the main thread's state. I've tried (2) and it fixes the specific reproducer I posted yesterday, as = it should do in theory. I believe it's the most flexible approach which sti= ll gives us well-defined semantics for signal handlers. We'd need to add pe= r-thread signals for the specific cases mentioned above. And, of course, it= s pthread-specific. Pip