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: master 8c81818673a 6/7: Tune volatile in read_char Date: Mon, 19 Aug 2024 19:05:12 +0000 Message-ID: <871q2kcp0a.fsf@protonmail.com> References: <172386820621.30556.15409337288904485218@vcs2.savannah.gnu.org> <87f24fac-aa71-499f-a398-2bad70a0ca42@cs.ucla.edu> <8634n0y2th.fsf@gnu.org> <87plq4cyuj.fsf@protonmail.com> <861q2ky0tg.fsf@gnu.org> <87le0scxig.fsf@protonmail.com> <86y14swksj.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="26709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acorallo@gnu.org, eggert@cs.ucla.edu, emacs-devel@gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 19 21:23:35 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 1sg7yY-0006oK-FR for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Aug 2024 21:23:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sg7xr-000745-5t; Mon, 19 Aug 2024 15:22:51 -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 1sg7gv-0001Rz-Pb for emacs-devel@gnu.org; Mon, 19 Aug 2024 15:05:23 -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 1sg7gt-0004qS-05 for emacs-devel@gnu.org; Mon, 19 Aug 2024 15:05:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1724094316; x=1724353516; bh=G0fjryg7tOqD+v1m0PG09r1P6/ltqnKBTr4vO0wXrsw=; 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=dMis3M05CbFPGH2R/wbShoUOpXTn28mNpWUC5RPeIgxD+wziRWtYfczNiJbhQsUrk zkc8Ws1+ohEDvK5VlAZuIF6a8ldiA2tciQfe6EHw/3jB5s36hQ6dJHkXvE8E3Pr/Dc RlpIp8NLDfdXCiFDNO5MOBbvU0/BnCmOMCBpo81tNHjcM47G2OYupqqfZj7/mBoGkn rldrKX7sDgdNxj0sYAhb4kGOjcXqYQrBWsFd5Quu/SXiwa/cBjFdHw0qYdvcXVkDNR JHoW7lPqJjsZg9fdY/8OogP5RUSFo4wxZZiDjhNB1z+EyuJvn4e4kWHVw3C1hlUHDw mLcHNEjUN09rw== In-Reply-To: <86y14swksj.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: e879a7ae0623c4d2ceba5cccdadbd05174db6292 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_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: Mon, 19 Aug 2024 15:22:48 -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:322941 Archived-At: "Eli Zaretskii" writes: >> either duplicating them into a 'c_volatile' >> / 'c' pair, as Paul's patch did, or keeping a single volatile >> variable. I think "let's make all of them volatile" is an obvious >> simplification of that idea. > > Why not simply undo that single patch, and be done? Because we will run into further setjmp()-related bugs. For example, I believe Paul's recent patches to bytecode.c subtly changed quit behavior when exception handlers are involved, at least from the intended mode of operation: now we reset the quit counter to the value it had when we registered the handler, which might reduce it, and thus lead to missed quits (though I haven't found a bytecode object that causes that bug yet). IOW, I think we need this patch: diff --git a/src/bytecode.c b/src/bytecode.c index 48a29c22d55..f261617783d 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -857,6 +857,7 @@ #define DEFINE(name, value) [name] =3D &&insn_ ## name, maybe_gc (); maybe_quit (); } + saved_quitcounter =3D quitcounter; pc +=3D op; NEXT; =20 ... or simply make quitcounter a volatile variable and be done with it. My apologies if I'm mistaken about this. Pip