From: Alan Mackenzie <acm@muc.de>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: Philipp Stephani <phst@google.com>, emacs-devel@gnu.org
Subject: Re: [PATCH] Protect against an infloop in python-mode
Date: Fri, 24 Mar 2017 17:53:18 +0000 [thread overview]
Message-ID: <20170324175318.GA2254@acm> (raw)
In-Reply-To: <CAArVCkSt5GFttOb6q0=SsCwB7Fd2+DWk0veAv0dgh8t02BHaNA@mail.gmail.com>
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 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 syntax
> > 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.
> > * python.el (python-nav-end-of-statement): Protect against infloop.
> > * progmodes/python-tests.el
> > (python-tests--python-nav-end-of-statement--infloop): Add unit test.
> Pushed as 4fbd330fae.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2017-03-24 17:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 21:31 [PATCH] Protect against an infloop in python-mode Philipp Stephani
2017-03-23 22:08 ` Philipp Stephani
2017-03-24 17:53 ` Alan Mackenzie [this message]
2017-03-26 18:49 ` Philipp Stephani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170324175318.GA2254@acm \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=p.stephani2@gmail.com \
--cc=phst@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.