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: Wed, 18 Nov 2020 17:38:34 +0000 Message-ID: <20201118171726.GA10071@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="21407"; mail-complaints-to="usenet@ciao.gmane.io" To: 44724@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 18 18:43:09 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 1kfRU4-0005TW-5k for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 18:43:08 +0100 Original-Received: from localhost ([::1]:58980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfRU3-00071q-6y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 12:43:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfRQ6-0003xu-I1 for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 12:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfRQ6-0004hp-8F for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 12:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfRQ6-0004JJ-4Z for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 12:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Nov 2020 17:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44724 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160572112716544 (code B ref -1); Wed, 18 Nov 2020 17:39:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Nov 2020 17:38:47 +0000 Original-Received: from localhost ([127.0.0.1]:36376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfRPq-0004Im-O2 for submit@debbugs.gnu.org; Wed, 18 Nov 2020 12:38:46 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfRPn-0004Ic-Bz for submit@debbugs.gnu.org; Wed, 18 Nov 2020 12:38:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfRPn-0003bL-4r for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 12:38:43 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:65334 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1kfRPj-0004fG-QM for bug-gnu-emacs@gnu.org; Wed, 18 Nov 2020 12:38:42 -0500 Original-Received: (qmail 23607 invoked by uid 3782); 18 Nov 2020 17:38:34 -0000 Original-Received: from acm.muc.de (p4fe15a12.dip0.t-ipconnect.de [79.225.90.18]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Wed, 18 Nov 2020 18:38:34 +0100 Original-Received: (qmail 10314 invoked by uid 1000); 18 Nov 2020 17:38:34 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 12:38:34 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:193636 Archived-At: Hello, Emacs. On the master branch. In src/syntax.c, there are several uninitialised static variables, one of which is find_start_value. It is used in function find_defun_start before being initialised. The first use is at L.14 of the function, this: && pos >= find_start_value . This has the effect of causing a certain (forward-comment -1) (which calls back_comment, which calls find_defun_start) to fail. In my test setup (I am writing tests for syntax.c), find_start_value's value at loading time was randomly 1270, which was spuriously inside the comment I was trying to scan backwards over. back_comment thus failed to recognise the comment, and returned failed. All these variables need initialising to something if the code in syntax.c is to work properly. -- Alan Mackenzie (Nuremberg, Germany).