From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: a random backtrace while toying with gdb Date: Mon, 01 Jul 2024 05:33:58 +0300 Message-ID: <86plrxg7s9.fsf@gnu.org> References: <87bk3jh8bt.fsf@localhost> <87wmm6rcv1.fsf@gmail.com> <86le2mhhsj.fsf@gnu.org> <875xtqramd.fsf@gmail.com> <86cynyhfsn.fsf@gnu.org> <87v81qp91g.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25970"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 Mon Jul 01 04:35:08 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 1sO6sl-0006Vl-Lk for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 04:35:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sO6rn-0007Yc-0e; Sun, 30 Jun 2024 22:34:07 -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 1sO6rl-0007YN-JW for emacs-devel@gnu.org; Sun, 30 Jun 2024 22:34:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sO6rj-0006Hm-R7; Sun, 30 Jun 2024 22:34:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QgbcMF8fJeOsE5qMC5dSyjkZFdzcnfmP+QTce3qJZk4=; b=ZN75dGqaNxCE 76sv2PKJXwdlrEekMCI7YFTFIuiMRSxClfNcBe8S2kmQAU0bqu/s6m1Z6vlVQTAgzkMNtnlVoXbj9 IWXQhphS8lnZF+wMG6LBRT5IdbI2aqE399T4Ms01qNXm11Iu/5FpcDUoc35JCRjVo8fE9cU+IOySC eABwX5RYYaPKR9ZapNIl4vzQfE9xihX/xy32dl21s+OVPhJsemb02uVC/P6/JHxSPNsTneMbNQTCM rOqWdTVD0pyPJYsOE0OXdKhXlWgBEwR6DZEF/R6lnL6NpN74qlAR7x+NqeJUvEImGieynM4ZBq81w +scjHXQ5zywddgVwaCdjmg==; In-Reply-To: (message from Pip Cet on Sun, 30 Jun 2024 19:25:36 +0000) 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:320993 Archived-At: > Date: Sun, 30 Jun 2024 19:25:36 +0000 > From: Pip Cet > Cc: Eli Zaretskii , gerd.moellmann@gmail.com, yantar92@posteo.net, emacs-devel@gnu.org > > As Eli points out, most of our signals don't have arguments, so how about simply having one flag per signal? Even a global signal flag would require us to block signals while we clear it. How is this different from blocking the signals using the signal mask? What do you think the system does when you block a signal? It does the same. The differences are just two: . blocking signals uses system calls, which are well-documented, their semantics is well-understood, and their implementation is reliable. By contrast, doing that in our own home-grown code will definitely have windows of race conditions, and will generally be less reliable, as any tricky signal-related code in userland; . instead of blocking signals only around MPS calls, we will be blocking signals for much longer times, thus making the above-mentioned windows larger and disabling more useful Emacs features And that is even before we consider the fact that we have no plan for the profiler, the SIGINT on TTY frames, and SIGUSR1/2, which are all very useful features and their lack will be noticed. And the only reason for not blocking signals as I suggested was "yuck", with no further explanation. I frankly cannot see any good sense in not liking that, but then going ahead and reimplementing the same idea in our own code.