From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58752: jit-lock-function infinite loop? Date: Thu, 27 Oct 2022 19:17:47 +0300 Message-ID: <83o7txkzpw.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32142"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58752-done@debbugs.gnu.org To: Alex Holehouse Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 27 18:20:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oo5c1-00085m-1X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Oct 2022 18:20:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo5bT-0007hZ-VL; Thu, 27 Oct 2022 12:19:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo5ax-00048T-Oh for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:19:15 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo5ax-0006Sd-2l for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo5aw-0001dL-Tv for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 12:19:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Oct 2022 16:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 58752 X-GNU-PR-Package: emacs Mail-Followup-To: 58752@debbugs.gnu.org, eliz@gnu.org, alex.holehouse@gmail.com Original-Received: via spool by 58752-done@debbugs.gnu.org id=D58752.16668874966192 (code D ref 58752); Thu, 27 Oct 2022 16:19:02 +0000 Original-Received: (at 58752-done) by debbugs.gnu.org; 27 Oct 2022 16:18:16 +0000 Original-Received: from localhost ([127.0.0.1]:59083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5aB-0001bo-Mg for submit@debbugs.gnu.org; Thu, 27 Oct 2022 12:18:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo5Zx-0001b8-4k for 58752-done@debbugs.gnu.org; Thu, 27 Oct 2022 12:18:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo5Zr-0006IG-Kq; Thu, 27 Oct 2022 12:17:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xi7d6ax37l0WZd+eMzvo7MkcXF9EbI0iJoZlkXmxTb4=; b=ieZpFy52lOq1 Wzlc63uefv5WoPfmIeacYFWovjoq/YDeBMz7DZ8D7bYCmschMYA/zqZyvCawOCkGz7ycDddmCNb/w zI7NHHoRq/qDxUAIfkvqAE3mDbotzxbUTTudh3rxUhxAjlCXWFr2P3EtD+NlUkr2kdeCpcaE3iKc1 1pithnHweHejuzop0XC989f0AqDTvprYMM5B9xRErjLTzgYkbFaEVjIy5C1WFCfOqGaHQzl6ewmP5 i8+y9jdqBgYkG5UdI7+If5nKM/regLNmDLYqG6GSbf3Qjp1YCdAMoZhWJc66vVxhDbA96Sj+QHQyn qL1QATD0DbEvl31IBN1j3A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo5Zq-0007AS-Dl; Thu, 27 Oct 2022 12:17:55 -0400 In-Reply-To: (message from Alex Holehouse on Sun, 23 Oct 2022 18:37:37 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246323 Archived-At: > From: Alex Holehouse > Date: Sun, 23 Oct 2022 18:37:37 -0500 > > Apologies if this is a reported and known issue, but after several hours of tracking this down, I think I've found > a bug in the font-lock module when working with Python code on Emacs28 (macOS 12.6 on Apple Silicon > (M1)). This is an issue certainly in Emacs 28 but not in earlier versions, so my temporary fix here is just to > revert back to emacs 26; I haven't tested 27. > > I think the issue stems from inside the jit-lock-function in font-lock.el, although my experience in hunting down > emacs issues is limited. > > Specifically, it seems that the function falls into an infinite loop when trying to format ill-behaving Python code. > The issue arises when a specific combination of things are true: an un-closed docstring that opens with three > double quotes (but does not close) followed by docstrings in other functions with 4 or more examples of single > quotation marks that are unsatisfied. These unsatisfied single quotation marks are, of course, allowed inside a > docstring, which means even when editing a Python file, if the unclosed triple double-quote docstring appears > event temporarily (e.g. as you're writing the docstring) the entire program freezes. > > I've narrowed this down to a minimal example that, at least in my setup (nothing fancy, vanilla emacs from > both emacsformacosx and from homebrew), reproduces the issue. The code snippet can be found here: > https://gist.github.com/alexholehouse/2259580ed2cb2caf75a16ee31d927465 > > If you open this file in emacs, the code renders but if you scroll down emacs freezes, but can be unfrozen by > running kill -SIGUSR2 from another terminal window. Thank you very much for your efforts to provide a minimal example. I can reproduce this bug in Emacs 28, but not in Emacs 29. So I think the underlying bug was already fixed, and I'm therefore closing this bug.