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: profiler Date: Fri, 21 Jun 2024 11:00:02 +0000 Message-ID: References: <87v823xvq1.fsf@localhost> <86plsalgot.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="38017"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, emacs-devel@gnu.org, gerd.moellmann@gmail.com, eller.helmut@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 13:10:40 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 1sKcAC-0009XD-C6 for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 13:10:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKc9f-0000ZP-Q4; Fri, 21 Jun 2024 07:10: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 1sKc05-000560-K7 for emacs-devel@gnu.org; Fri, 21 Jun 2024 07:00:13 -0400 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 1sKc03-00073v-5f for emacs-devel@gnu.org; Fri, 21 Jun 2024 07:00:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1718967608; x=1719226808; bh=hp1bxPYl+x5PXpRv7iQxcJ/zDfVC9CtmY54Sg/7JLXU=; 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=L3dDbeLsyCQO5nikaawkBWzKjjTxWck/K2q3tSSKFfIZdviQdlCkqItqrUb2Rsd+d Fd9HLgGJv+GJsjAOAwghhF/NFkdTtltsMahipnGRD4zAaAlVJmVoTlGuqygMeFnX0x RGhRsoXpmq+VclLaFn0KE52H8PLps1OrFWWws58qASTr6xbcs76VHnydcdCq0iBrT1 srAEGZprnjav5hfjSGqG/0TVF1b2mrQk2wNsmjtTUEJ3KvWLxw/ZtHfPtZVJmPj6Ud 0sua71lDISHtJGmJdgW82Aeyk6iPwFExkc3THASYpfu5X+VjnmvskOaRHNbUK/E+wm DFaP2+zouyT9A== In-Reply-To: <86plsalgot.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: f30f3b364e2e63b73940732d706bd1f6b93d021b 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 21 Jun 2024 07:10:06 -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:320387 Archived-At: On Friday, June 21st, 2024 at 10:43, Eli Zaretskii wrote: > This is not what happens in this case, so let's stick to what we > actually see, okay? It's complex enough. Yes, it is. > > The right thing to do, IMHO, is to let MPS know that it should block SI= GPROF (and any other signals that might use managed memory) while handling = SIGSEGV. >=20 > I disagree. MPS must be able to support programs compiled with > "-gprof", so I don't believe SIGPROF should be blocked. Only while handling SIGSEGV, of course. > The handler > is our code, so we should modify the handler not to do anything unsafe > if SIGPROF happens while MPS is processing its SIGSEGV. That's a much > more reliable fix, and one that will allow us to keep our profiling > code. Why are you suggesting that my "fix" (which, yes, is overly broad, we'd nee= d to go through the signals to find all we can safely leave unblocked) requ= ires any changes to the profiling code? As far as I can tell, it just works= . The main difference between the two approaches, both of which require meddl= ing with MPS internals, is that if SIGPROF is blocked, it will be delivered= with a delay after the SIGSEGV handler is done running. If the SIGPROF han= dler runs and doesn't do "anything unsafe", on the other hand, it can recor= d the unusable signal but won't get a new one. I don't see a clear advantag= e of either, to be honest. Blocking signals, of course, is more reliable th= an "just knowing" we won't do anything unsafe. Pip