Subject: Re: bug#54996: Emacs hangs when editing Python code with debug-on-error set to t

From: Philipp Stephani <[email-masked]>
Date: Mon, 18 Apr 2022 16:17:46 +0200

Am Mo., 18. Apr. 2022 um 13:19 Uhr schrieb Lars Ingebrigtsen <[email-masked]>:
>
> But here we go -- I instrumented Fsignal after loading everything.
>
> gdb) xbacktrace
> "signal" (0xeabde738)
> "error" (0xffff8378)
> "apply" (0xeabde6e0)
> "cl--assertion-failed" (0xeabde668)
> "python-nav-end-of-statement" (0xeabde620)
> "python-info-end-of-statement-p" (0xeabde5f0)
> "python-info-end-of-block-p" (0xeabde598)
> "python-nav--forward-sexp" (0xeabde518)
> "python-nav-forward-sexp" (0xeabde4c0)
> "python-nav-backward-sexp" (0xeabde468)
> "python-info-docstring-p" (0xeabde408)
> "python-font-lock-syntactic-face-function" (0xeabde3a8)
> "font-lock-fontify-syntactically-region" (0xeabde320)
> "font-lock-default-fontify-region" (0xeabde2b0)
> "font-lock-fontify-region" (0xeabde240)
> 0x566c35a8 PVEC_COMPILED
> "run-hook-wrapped" (0xeabde1c8)
>
> I've now fixed this by avoiding cl-assert (which probably should never
> be used inside a function called from font-lock).
>

The assertion was added to protect against a subtle but nasty bug, see
commit 4fbd330fae54a9c45d4a717127aa86d75e9938d5. Please don't remove
the assertion without first ensuring that the bug won't reoccur.