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: Mon, 30 Dec 2024 11:18:16 +0000 Message-ID: <87jzbh1ku9.fsf@protonmail.com> References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <86ed1rswup.fsf@gnu.org> <87h66loc17.fsf@gmail.com> <878qrxoayj.fsf@gmail.com> 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="18441"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Helmut Eller , Eli Zaretskii , spd@toadstyle.org, emacs-devel@gnu.org To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 30 13:00:22 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 1tSERY-0004fL-Tx for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Dec 2024 13:00:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSEQy-0006e0-V8; Mon, 30 Dec 2024 06:59:45 -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 1tSDmy-0008JC-RI for emacs-devel@gnu.org; Mon, 30 Dec 2024 06:18:24 -0500 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSDmw-00054d-IB for emacs-devel@gnu.org; Mon, 30 Dec 2024 06:18:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735557499; x=1735816699; bh=vewS6w/6QpJ6M4PCUENToiDxJbCwlh7nFx1ZOpwLzDQ=; 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=R42/jyDMOGW5fsxwP6TYPgtBI63DdGcvloiKTLva62pVBl2RHStMd7Cj2Kc6p12oa hsAU5eDQmIAUGgeWXX+0O4sOOpzlf98bX4teksbkhPB50FtcPCpIyLc9s11HcIVOaJ Yew93MXqz+zCjO5Loa1/8w1ZIE+m9fF/KGVq7wu1Rw5lu/oXuXcLJgcmlzQgtfjts9 59ReeszCD4JAXeKcAZttHEpWOcseZppP0sKxhC7FN4K7XhwUW2+XQKxAu3Q9SEcMvN 4q5mAsmhkfLTgGheEG4CUkeflzFMbrpY3rQh5x22sskQQKUgD5lXoUYgELJrNCOixk Ej5LC3/JeevEg== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: dd6f5859c0ad8d14082f15dc3a3b10db395f9466 Received-SPF: pass client-ip=185.70.43.22; envelope-from=pipcet@protonmail.com; helo=mail-4322.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_H2=-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=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 30 Dec 2024 06:59:40 -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:327406 Archived-At: Gerd M=C3=B6llmann writes: > Helmut Eller writes: > >> On Mon, Dec 30 2024, Gerd M=C3=B6llmann wrote: >> >>> I'm afraid Modifying MPS is not my thing, But What about using somethin= g >>> more modern like Oilpan (aka cppgc) from V8? Can be used as a lib, is >>> concurrent for real. >> >> Ideally, Emacs would have an abstract GC interface so that different >> implementations could be plugged in. > > That would indeed be nice to have. > >>> That would also be a perfect time to lift Emacs to >>> C++. >> >> I'd rather see Emacs move to Rust. Anyway, neither option seems >> realistic. > > In mainline... (pondering to put a smiley). I'll throw Zig in and run away quickly. > But something else: Given what I now believe, I think I want to > understand better (a bit) why everything appears to work just fine on > macOS, with signals. Could you perhaps check if I'm off? MacOS only. Do we know that? I think macOS doesn't use signals as heavily as other platforms do, and I don't know how SIGPROF is handled on that platform, but I would not be surprised if that or SIGALRM require the signal checking thing on macOS, too. The macOS thing is equivalent to blocking signals in the SIGSEGV handler. I still think that's what MPS should have done. > In normal operation, there are only ever 2 threads running. An Emacs > thread is interrupted by a signal and lands in a signal handler, the > MPS port thread keeps running. > > In the signal handler, hitting barriers is handled by the MPS port > thread. Consistency of Emacs's state is a problem the signal handler has > to deal with, consistency of MPS' GC data is a problem that hopefully > MPS handles, and it seems to work. > > I think I understand that, except when the Emacs thread is interrupted > while in MPS code, which happens for allocation points running out of > memory and mps_arena_step (idle time). My assumption is that if the signal handler is allowed to run in that case, and tries to access MPS-managed memory, we deadlock. It might not be a detectable deadlock causing a crash, as it would be on POSIX, but that makes things worse, not better. Pip