GNU bug report logs - #44724
Uninitialised variables in syntax.c cause trouble.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alan Mackenzie <acm@HIDDEN>; Keywords: notabug; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 44724 <at> debbugs.gnu.org and Alan Mackenzie <acm@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 44724 <at> debbugs.gnu.org:


Received: (at 44724) by debbugs.gnu.org; 24 Nov 2020 08:02:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 24 03:02:48 2020
Received: from localhost ([127.0.0.1]:57328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1khTHk-0007nh-1R
	for submit <at> debbugs.gnu.org; Tue, 24 Nov 2020 03:02:48 -0500
Received: from quimby.gnus.org ([95.216.78.240]:50568)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1khTHi-0007nS-Uo
 for 44724 <at> debbugs.gnu.org; Tue, 24 Nov 2020 03:02:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=HlJrl27joInaoNPJWpRSfV8H04AeItdMy82h3wAHIqw=; b=jP4uUrIVS9SoVSt/ufsFjs4aiN
 21FuLP5BoCZqHD51ypHLj3oEPFLq0+EafrxirksDWDZHQEvrHuelVyN74Ytealw+yLpTKSYbNzf3i
 chwuRytBwuADj+6vbyLZEXGscwaUDtEncAm7+MWsEczvkf+WP1SQa8E9EKkkuC/hgVX8=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1khTHT-00013Z-Ak; Tue, 24 Nov 2020 09:02:41 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#44724: Uninitialised variables in syntax.c cause trouble.
References: <20201118171726.GA10071@ACM>
 <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN>
 <20201118202610.GB10071@ACM>
 <ce6c38be-1afd-5963-3fab-9585b29d6589@HIDDEN>
 <20201119163032.GD6259@ACM>
X-Now-Playing: Fad Gadget's _Fireside Favourites_: "Fireside Favourite"
Date: Tue, 24 Nov 2020 09:02:29 +0100
In-Reply-To: <20201119163032.GD6259@ACM> (Alan Mackenzie's message of "Thu, 19
 Nov 2020 16:30:32 +0000")
Message-ID: <87y2ir6v3e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Alan Mackenzie <acm@HIDDEN> writes: > I'll close this bug
 as not a bug. This wasn't done, so I'm doing that now. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44724
Cc: martin rudalics <rudalics@HIDDEN>, 44724 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> I'll close this bug as not a bug.

This wasn't done, so I'm doing that now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.

Message received at 44724 <at> debbugs.gnu.org:


Received: (at 44724) by debbugs.gnu.org; 19 Nov 2020 16:30:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 19 11:30:41 2020
Received: from localhost ([127.0.0.1]:40771 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfmpU-0001pn-S5
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2020 11:30:41 -0500
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 <acm@HIDDEN>) id 1kfmpT-0001pZ-6F
 for 44724 <at> debbugs.gnu.org; Thu, 19 Nov 2020 11:30:39 -0500
Received: (qmail 42650 invoked by uid 3782); 19 Nov 2020 16:30:32 -0000
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
Received: (qmail 19446 invoked by uid 1000); 19 Nov 2020 16:30:32 -0000
Date: Thu, 19 Nov 2020 16:30:32 +0000
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#44724: Uninitialised variables in syntax.c cause trouble.
Message-ID: <20201119163032.GD6259@ACM>
References: <20201118171726.GA10071@ACM>
 <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN>
 <20201118202610.GB10071@ACM>
 <ce6c38be-1afd-5963-3fab-9585b29d6589@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ce6c38be-1afd-5963-3fab-9585b29d6589@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44724
Cc: 44724 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.

Message received at 44724 <at> debbugs.gnu.org:


Received: (at 44724) by debbugs.gnu.org; 19 Nov 2020 08:26:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 19 03:26:02 2020
Received: from localhost ([127.0.0.1]:38060 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kffGU-0003oz-Iy
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2020 03:26:02 -0500
Received: from mout.gmx.net ([212.227.15.19]:37915)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1kffGQ-0003oT-ON
 for 44724 <at> debbugs.gnu.org; Thu, 19 Nov 2020 03:26:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1605774351;
 bh=XNvgix13Fyendm9y6vJUohJF5D6rnm2jFZh16rWvdJo=;
 h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To;
 b=EVBCJvjT7zpEkX+xWY8yLz/Hg1DM4Q7ACuteXvFBfX02ah44dwAeQyc2rdRCtNoz5
 4ZRDVx1FJhM6INSOTQCEbdRf8bhzdst6Mcy3g3/JdcjwWtkEyMs5+6lHjqogc0G4ig
 jGUxE5XnPIas0K7PiCSx06eCAIYQR+ky/j8XGg88=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.100] ([212.95.5.202]) by mail.gmx.com (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MqaxO-1jtO9v2bXk-00mYbX; Thu, 19
 Nov 2020 09:25:51 +0100
Subject: Re: bug#44724: Uninitialised variables in syntax.c cause trouble.
To: Alan Mackenzie <acm@HIDDEN>
References: <20201118171726.GA10071@ACM>
 <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN> <20201118202610.GB10071@ACM>
From: martin rudalics <rudalics@HIDDEN>
Message-ID: <ce6c38be-1afd-5963-3fab-9585b29d6589@HIDDEN>
Date: Thu, 19 Nov 2020 09:25:50 +0100
MIME-Version: 1.0
In-Reply-To: <20201118202610.GB10071@ACM>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:0hyKhOMRf8g57GJsDjFxB0j9McQAJh5PIt7VRzq35EUHjboORRi
 P4mLtmGwEY+IMzYJ2iqMirDKpK8DbJ+5Al3CmnGYVlnaX2JqKJHGYE1/ySAk1sOSKnqzBuh
 NggTlD/BfiI8O9lV+T8IDJ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-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44724
Cc: 44724 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 >> 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?

 > 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

 > and I think that's why it gave an invalid result.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.

Message received at 44724 <at> debbugs.gnu.org:


Received: (at 44724) by debbugs.gnu.org; 18 Nov 2020 20:26:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 18 15:26:21 2020
Received: from localhost ([127.0.0.1]:36586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfU21-00026F-4v
	for submit <at> debbugs.gnu.org; Wed, 18 Nov 2020 15:26:21 -0500
Received: from colin.muc.de ([193.149.48.1]:17331 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kfU1y-000260-3k
 for 44724 <at> debbugs.gnu.org; Wed, 18 Nov 2020 15:26:20 -0500
Received: (qmail 39456 invoked by uid 3782); 18 Nov 2020 20:26:11 -0000
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 21:26:10 +0100
Received: (qmail 12530 invoked by uid 1000); 18 Nov 2020 20:26:10 -0000
Date: Wed, 18 Nov 2020 20:26:10 +0000
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#44724: Uninitialised variables in syntax.c cause trouble.
Message-ID: <20201118202610.GB10071@ACM>
References: <20201118171726.GA10071@ACM>
 <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44724
Cc: 44724 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Martin.

On Wed, Nov 18, 2020 at 18:57:37 +0100, martin rudalics wrote:
>  > 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.

> 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.

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, and I think that's why it gave an invalid result.

> martin

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.

Message received at 44724 <at> debbugs.gnu.org:


Received: (at 44724) by debbugs.gnu.org; 18 Nov 2020 17:57:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 18 12:57:50 2020
Received: from localhost ([127.0.0.1]:36425 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfRiI-0004nV-97
	for submit <at> debbugs.gnu.org; Wed, 18 Nov 2020 12:57:50 -0500
Received: from mout.gmx.net ([212.227.17.20]:51915)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1kfRiE-0004n8-3x
 for 44724 <at> debbugs.gnu.org; Wed, 18 Nov 2020 12:57:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1605722258;
 bh=01MqJrfQY/j5A9nz8vR/ae4/bC1uJp8KJhlPlFcWUJY=;
 h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To;
 b=S+RnW7DaIkMHSDqV2CXsw1B5+gaqK2+kkFtO/V63HD/EtikGkHAu+8CVX4t52N9K2
 SjC7PLccA8KauuRNT07TGaSTjOZT1WOR6xLmN+CeQz9kBlrKV/OcOqfZTiQGXqfrhh
 6A9EOHRN5CHRigaIfsNfFdwQXQZuF2o0BVywJIZM=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([46.125.249.84]) by mail.gmx.com (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MkYbu-1jzDTw2krm-00m2h8; Wed, 18
 Nov 2020 18:57:38 +0100
Subject: Re: bug#44724: Uninitialised variables in syntax.c cause trouble.
To: Alan Mackenzie <acm@HIDDEN>, 44724 <at> debbugs.gnu.org
References: <20201118171726.GA10071@ACM>
From: martin rudalics <rudalics@HIDDEN>
Message-ID: <1b64b1bf-b12e-7a13-2a33-4a308cf38873@HIDDEN>
Date: Wed, 18 Nov 2020 18:57:37 +0100
MIME-Version: 1.0
In-Reply-To: <20201118171726.GA10071@ACM>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:B5cCxpORs5Bk38cPeMoA15I1v1/j1bfZuJgf4mCBZCs864F8Y5i
 +59ThhQ2xZC8RdAcRKOmRIMNOukxnXOtiTBEsusg42ek/pYi/lsnSonDyGdNkViPKGs2xwo
 +CyesRvq0OFnXyRIK88VVszFUddiShQogbIJGtsMnYJOX8Xj/IUoerMn+DxtTzakesKQwGz
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 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > 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. [...]
 Content analysis details:   (4.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [46.125.249.84 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [212.227.17.20 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [212.227.17.20 listed in wl.mailspike.net]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [46.125.249.84 listed in dnsbl.sorbs.net]
X-Debbugs-Envelope-To: 44724
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.4 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > 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. [...]
    
 
 Content analysis details:   (3.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [212.227.17.20 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [46.125.249.84 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [212.227.17.20 listed in list.dnswl.org]
  1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
                             [46.125.249.84 listed in dnsbl.sorbs.net]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (rudalics[at]gmx.at)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

 > 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.

Just curious: Did current_buffer == find_start_buffer really succeed
in your scenario?

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Nov 2020 17:38:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 18 12:38:46 2020
Received: from localhost ([127.0.0.1]:36376 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfRPq-0004Im-O2
	for submit <at> debbugs.gnu.org; Wed, 18 Nov 2020 12:38:46 -0500
Received: from lists.gnu.org ([209.51.188.17]:40116)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kfRPn-0004Ic-Bz
 for submit <at> debbugs.gnu.org; Wed, 18 Nov 2020 12:38:45 -0500
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 <acm@HIDDEN>) id 1kfRPn-0003bL-4r
 for bug-gnu-emacs@HIDDEN; Wed, 18 Nov 2020 12:38:43 -0500
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 <acm@HIDDEN>)
 id 1kfRPj-0004fG-QM
 for bug-gnu-emacs@HIDDEN; Wed, 18 Nov 2020 12:38:42 -0500
Received: (qmail 23607 invoked by uid 3782); 18 Nov 2020 17:38:34 -0000
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
Received: (qmail 10314 invoked by uid 1000); 18 Nov 2020 17:38:34 -0000
Date: Wed, 18 Nov 2020 17:38:34 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Uninitialised variables in syntax.c cause trouble.
Message-ID: <20201118171726.GA10071@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@HIDDEN;
 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-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

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).




Acknowledgement sent to Alan Mackenzie <acm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44724; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 24 Nov 2020 08:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.