Subject: bug#24905: 25.1.50; Lock-up in python-mode

From: Daniel Colascione <[email-masked]>
Date: Tue, 08 Nov 2016 14:45:07 -0800

On Tue, Nov 08 2016, Daniel Colascione wrote:
> On Tue, Nov 08 2016, Philipp Stephani wrote:
>> echo ' "' > /tmp/a.py
>> emacs -Q /tmp/a.py
>>
>> Emacs locks up immediately.
>> Given that this is so easy to trigger, it should block the 25.2
>> release.
>
> Can repro. Thanks for coming up with a small testcase.

FWIW, the Lisp traceback is this:

"syntax-ppss" (0xffff2978)
"python-info-line-ends-backslash-p" (0xffff2e80)
"python-nav-beginning-of-statement" (0xffff3388)
"python-info-beginning-of-statement-p" (0xffff3840)
"python-info-beginning-of-block-p" (0xffff3d38)
"python-nav--forward-sexp" (0xffff43d8)
"python-nav-forward-sexp" (0xffff4918)
"python-nav-backward-sexp" (0xffff4e20)
"python-info-docstring-p" (0xffff5378)
"python-font-lock-syntactic-face-function" (0xffff5850)
"font-lock-fontify-syntactically-region" (0xffff5e00)
"font-lock-default-fontify-region" (0xffff6380)
"font-lock-fontify-region" (0xffff6858)
0x1c27368 PVEC_COMPILED
"run-hook-wrapped" (0xffff6f30)
"jit-lock--run-functions" (0xffff74b0)
"jit-lock-fontify-now" (0xffff7b08)
"jit-lock-function" (0xffff80b8)
"redisplay_internal (C function)" (0x0)

We're actually finishing GC, by the way: this isn't a problem with
the alloc.c guts, fortunately.  We're just generating tons of
garbage. I've seen infloops in python.el's syntactic analysis
before. This one looks worse than usual because it happens in redisplay.

(Maybe redisplay should impose time limits on lisp that it runs?)