From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Protect against an infloop in python-mode Date: Sun, 26 Mar 2017 18:49:18 +0000 Message-ID: References: <20170228213149.15842-1-phst@google.com> <20170324175318.GA2254@acm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11436048bc4f14054ba6af9e X-Trace: blaine.gmane.org 1490554278 9621 195.159.176.226 (26 Mar 2017 18:51:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Mar 2017 18:51:18 +0000 (UTC) Cc: Philipp Stephani , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 26 20:51:12 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csDFr-0001Ub-03 for ged-emacs-devel@m.gmane.org; Sun, 26 Mar 2017 20:51:07 +0200 Original-Received: from localhost ([::1]:41936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csDFx-0008QT-45 for ged-emacs-devel@m.gmane.org; Sun, 26 Mar 2017 14:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csDEJ-0007vP-Aq for emacs-devel@gnu.org; Sun, 26 Mar 2017 14:49:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csDEI-0003ks-2W for emacs-devel@gnu.org; Sun, 26 Mar 2017 14:49:31 -0400 Original-Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:36142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1csDEH-0003kS-OZ for emacs-devel@gnu.org; Sun, 26 Mar 2017 14:49:29 -0400 Original-Received: by mail-wr0-x230.google.com with SMTP id w11so15507446wrc.3 for ; Sun, 26 Mar 2017 11:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=g6sW45FnM2qT+Jf+uHU6zfWsMeOlKTtHAQomw5sEiEw=; b=dSz9Nz4ad09Bl1PpapYeHT8MnUqTsr0ETKXbP4lJCbfNTFksso+yEGVDQRacvi0uGF xMMlNsnjIxR9Qen8Ghv+2Kz3SPA2tTgQ/shKdxsMpkbBeTRuA6m/c3dHuVvj27zW5Has zUXh/giz0saI7HAqL4yubx+bJ/H8exc6tzhDjDdqz9fEM5LYsXxWn5yIYAdP3l3G+1a1 hvSPksljc/BcHrAi+yKSqHY570HKmBHKtQ/XwOTNEbWUShl4M6Qrh/LF2Q7RlYgxU1Xi ewYA9qjjZPyq2Gkzwtl/TlpEfW1S0HWn/+rhrjG3e3XzHhtZKh62/U9UL9ZC0aY8Yi/U 0u3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g6sW45FnM2qT+Jf+uHU6zfWsMeOlKTtHAQomw5sEiEw=; b=gkwAp5nOZy33vlCD7gtYd75tnojrtBfDghdPGW2Ccr+Uj9/qTV+PYwZ9dsH+Gjm99P CrLnmdpmQIVlJxdYL319Gn0Zk6jCpnR1jkyH3CpoE53k2TkgB+CMKSuOSxFZs4I8D1vM UfzkHSO9qwOfI0hmNifz6Ni81bcL54oaFQwuhwupsj1zqPbU4ML8Pm4cdPHvYuyzCDe8 Pp6C8KZ4Gt23oHiKp+SUZJihCJzFDGnsC7VMgjGYQ2yjzMcdX/IG5L/zoXaN4yiFva9D 9nFwj3J+GNP10o8kPDy5O8ixHzyjdHphxh/EkDcxXOYnebKY70vIc8SLB2V7tcLxJWfX 5jRg== X-Gm-Message-State: AFeK/H3uJD83IqNtofgQLC0bt2J7NmD7mKpzNUhIlTWMx8c4tnNBuE9L+4PDIjNuLS7PDIXZ/GCndTmj9oNBOg== X-Received: by 10.28.44.66 with SMTP id s63mr6430061wms.46.1490554168558; Sun, 26 Mar 2017 11:49:28 -0700 (PDT) In-Reply-To: <20170324175318.GA2254@acm> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:213385 Archived-At: --001a11436048bc4f14054ba6af9e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Alan Mackenzie schrieb am Fr., 24. M=C3=A4rz 2017 um 18:53 Uhr= : > Hello, Philipp. > > On Thu, Mar 23, 2017 at 22:08:15 +0000, Philipp Stephani wrote: > > Philipp Stephani schrieb am Di., 28. Feb. 2017 > um > > 22:32 Uhr: > > > > There appears to be an edge case caused by using `syntax-ppss' in a > > > narrowed buffer during JIT lock inside of Python triple-quote strings= . > > > Unfortunately it is impossible to reproduce without manually > > > destroying the syntactic information in the Python buffer, but it has > > > been observed in practice. In that case it can happen that the synta= x > > > caches get sufficiently out of whack so that there appear to be > > > overlapping strings in the buffer. As Python has no nested strings, > > > this situation is impossible and leads to an infloop in > > > `python-nav-end-of-statement'. Protect against this by checking > > > whether the search for the end of the current string makes progress. > > I think it's fair to say that syntax-ppss doesn't work in narrowed > buffers. This has been known for a long time now - I raised bug #22983 > about this topic over a year ago, yet despite repeated requests from > myself, there are no signs this is going to be fixed any time soon. > > I "welcome" your misfortune, as it shows that the flaws in syntax-ppss > in narrowed buffers occur in real situations, not just test cases. > Presumably, diagnosing the bug took up quite a lot of your valuable > time. > > Let's get bug #22983 fixed. > > Agreed. I'm not 100% positive that it's the same bug, but it's very likely. --001a11436048bc4f14054ba6af9e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Alan M= ackenzie <acm@muc.de> schrieb am Fr= ., 24. M=C3=A4rz 2017 um 18:53=C2=A0Uhr:
Hello, Philipp.

On Thu, Mar 23, 2017 at 22:08:15 +0000, Philipp Stephani wrote:
> Philipp Stephani <p.stephani2@gmail.com> schrieb am Di.,= 28. Feb. 2017 um
> 22:32 Uhr:

> > There appears to be an edge case caused by using `syntax-ppss'= ; in a
> > narrowed buffer during JIT lock inside of Python triple-quote str= ings.
> > Unfortunately it is impossible to reproduce without manually
> > destroying the syntactic information in the Python buffer, but it= has
> > been observed in practice.=C2=A0 In that case it can happen that = the syntax
> > caches get sufficiently out of whack so that there appear to be > > overlapping strings in the buffer.=C2=A0 As Python has no nested = strings,
> > this situation is impossible and leads to an infloop in
> > `python-nav-end-of-statement'.=C2=A0 Protect against this by = checking
> > whether the search for the end of the current string makes progre= ss.

I think it's fair to say that syntax-ppss doesn't work in narrowed<= br class=3D"gmail_msg"> buffers.=C2=A0 This has been known for a long time now - I raised bug #2298= 3
about this topic over a year ago, yet despite repeated requests from
myself, there are no signs this is going to be fixed any time soon.

I "welcome" your misfortune, as it shows that the flaws in syntax= -ppss
in narrowed buffers occur in real situations, not just test cases.
Presumably, diagnosing the bug took up quite a lot of your valuable
time.

Let's get bug #22983 fixed.


Agreed. I'm no= t 100% positive that it's the same bug, but it's very likely.=C2=A0=
--001a11436048bc4f14054ba6af9e--