From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#44724: Uninitialised variables in syntax.c cause trouble. Date: Thu, 19 Nov 2020 16:30:32 +0000 Message-ID: <20201119163032.GD6259@ACM> References: <20201118171726.GA10071@ACM> <1b64b1bf-b12e-7a13-2a33-4a308cf38873@gmx.at> <20201118202610.GB10071@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44724@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 19 17:31:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kfmpz-00081w-Vf for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Nov 2020 17:31:11 +0100 Original-Received: from localhost ([::1]:42948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfmpy-0003bt-W5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Nov 2020 11:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfmpq-0003bL-Qa for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 11:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfmpq-0002og-2I for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 11:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfmpp-0001qM-UY for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 11:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Nov 2020 16:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44724 X-GNU-PR-Package: emacs Original-Received: via spool by 44724-submit@debbugs.gnu.org id=B44724.16058034417059 (code B ref 44724); Thu, 19 Nov 2020 16:31:01 +0000 Original-Received: (at 44724) by debbugs.gnu.org; 19 Nov 2020 16:30:41 +0000 Original-Received: from localhost ([127.0.0.1]:40771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfmpU-0001pn-S5 for submit@debbugs.gnu.org; Thu, 19 Nov 2020 11:30:41 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:12888 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kfmpT-0001pZ-6F for 44724@debbugs.gnu.org; Thu, 19 Nov 2020 11:30:39 -0500 Original-Received: (qmail 42650 invoked by uid 3782); 19 Nov 2020 16:30:32 -0000 Original-Received: from acm.muc.de (p4fe153fb.dip0.t-ipconnect.de [79.225.83.251]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Thu, 19 Nov 2020 17:30:31 +0100 Original-Received: (qmail 19446 invoked by uid 1000); 19 Nov 2020 16:30:32 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193730 Archived-At: Hello, Martin. On Thu, Nov 19, 2020 at 09:25:50 +0100, martin rudalics wrote: > >> Just curious: Did current_buffer == find_start_buffer really succeed > >> in your scenario? > > Yes it did. All four comparisons in that block of code succeeded, > > causing a spurious value to be returned by find_defun_start. > Isn't the probability for such a thing to be caused by uninitialized > variables lower than that of the Emacs tagging scheme to fail as a > whole? Yes. > > But now I think that that value was a previously valid one which just > > hadn't been updated on buffer changes. > > I don't think there's any cache invalidation code associated with this > > cache, > MODIFF == find_start_modiff Yes, thanks, I was wrong there. > > and I think that's why it gave an invalid result. I've found out what my problem is. find_defun_start, unless one takes precautions against it, calls syntax-ppss, which in my situation was uninitialised. There is nothing in Emacs to cause the initialisation of syntax-ppss when, say, the syntax-table is changed. It all needs to be done by hand. I'll close this bug as not a bug. Thanks for all the help! > martin -- Alan Mackenzie (Nuremberg, Germany).