GNU bug report logs - #56271
lisp/progmodes/python.el; unmatched quotes cause infinite loop freezing emacs

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Tom Gillespie <tgbugs@HIDDEN>; Keywords: patch; dated Tue, 28 Jun 2022 01:52:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 56271 <at> debbugs.gnu.org:


Received: (at 56271) by debbugs.gnu.org; 29 Jun 2022 10:14:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 29 06:14:16 2022
Received: from localhost ([127.0.0.1]:57536 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o6Ui8-0007JI-Aq
	for submit <at> debbugs.gnu.org; Wed, 29 Jun 2022 06:14:16 -0400
Received: from quimby.gnus.org ([95.216.78.240]:58022)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1o6Ui7-0007J4-Ix
 for 56271 <at> debbugs.gnu.org; Wed, 29 Jun 2022 06:14:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=T20ZXtVjvOT0LV+64quKEzhWtZvnejAKUlM+BMS/ogk=; b=MD8s1pRqF0ipfuz5tsAvhc4HcC
 fOwiOaLam3SK0hGZJ5J12N8OHOh6NnpsA1jyEGDhwOz1mz9+NX5sKZQ70pyorSZeMRnTU3gW/dnk4
 +j9+rgYZ38fDkwdQEif1sq90m4RU751l1h2bD5PZp1JTkoJFCV4NfWTua+4MsAbu4Cvc=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1o6Uhy-0006AL-S5; Wed, 29 Jun 2022 12:14:09 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Tom Gillespie <tgbugs@HIDDEN>
Subject: Re: lisp/progmodes/python.el; unmatched quotes cause infinite loop
 freezing emacs
References: <CA+G3_PMzbzK4W=Zrs+ksx0Z=vX1pp44aujC2z5+LmP_6bZc7eg@HIDDEN>
 <87lethroiv.fsf@HIDDEN>
 <CA+G3_POGKF-fDfBuxNcc93WSEaaYzAd4FSgk-vKy=tQYOXYtHg@HIDDEN>
 <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEUXExQhGxwuKi1Z
 LzkpJ2QjGygrK4lkU4jVnXTOLiCuSDmiJRzbTDLoa07////QtD2nAAAAAWJLR0QOb70wTwAAAAd0
 SU1FB+YGHQk1EwikkDoAAAF7SURBVDjLnZQxTwIxFMdfD1i4pWdgcIMT4ooysUG8wCpGPoGE+AEw
 YXRwcHBzau5ucHJwYjDmxMXBoaG3QwLfxV69wqW0Ufwnl7T9vff+fbm2gAAwcrLCgDDCYGGoglXB
 R4AqcMpHAAlogJSDHP4hHrojlIQ6zi7AODFDoEnhxRxNKYP+HrmveOd6UP11EwduzatduK6rhpZG
 XGPP8zoacH2XBdYWXGVABdAG9NqFodftKHsojYaTRr437Go8JreXvfFIBXnu0W4d3zT7slQuBV7z
 uWG/nZGp7Dw1L7LFg28/tsIvxdxmMfUPic+eFI8iDanfiqLwUwE2iVeEkCDYZKSd236wYmtGJcDS
 nAO+vs6AVDkSxWsaU6YBi/t5uGRTdbtkFi/mH0vZ4NZ8NQuoH5Ft57LUy0zo/VVM0QaUkytTHtQH
 AzHVnPkfGc82Mh04fAIFfUbf5GEy/8d1qZtA1bC+v4VMsZKi/Lmp8xF/a4SHaAWlf1/EnYuMb6sp
 Z/wCmHAZAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA2LTI5VDA5OjUzOjE5KzAwOjAw8pBinAAA
 ACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNi0yOVQwOTo1MzoxOSswMDowMIPN2iAAAAAASUVORK5C
 YII=
X-Now-Playing: Django Django's _Glowing In The Dark_: "Hold Fast"
Date: Wed, 29 Jun 2022 12:14:06 +0200
In-Reply-To: <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@HIDDEN>
 (Tom Gillespie's message of "Tue, 28 Jun 2022 19:45:58 -0700")
Message-ID: <87k08zlqtt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Tom Gillespie <tgbugs@HIDDEN> writes: > I have attached
 a patch the resolves this issue but there may be other > lurking issues due
 to the removal of cl-assert because there are now > all sorts of code paths
 that will run that never ran b [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56271
Cc: 56271 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Tom Gillespie <tgbugs@HIDDEN> writes:

> I have attached a patch the resolves this issue but there may be other
> lurking issues due to the removal of cl-assert because there are now
> all sorts of code paths that will run that never ran before because
> they would hit that assertion and bail out, usually all the way back
> to the top.

Tom Gillespie <tgbugs@HIDDEN> writes:

> Patch to add a test using the evil file as an example.

Thanks; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56271; Package emacs. Full text available.

Message received at 56271 <at> debbugs.gnu.org:


Received: (at 56271) by debbugs.gnu.org; 29 Jun 2022 03:00:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 28 23:00:46 2022
Received: from localhost ([127.0.0.1]:56782 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o6Nwc-0002ES-7L
	for submit <at> debbugs.gnu.org; Tue, 28 Jun 2022 23:00:46 -0400
Received: from mail-io1-f50.google.com ([209.85.166.50]:40485)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tgbugs@HIDDEN>) id 1o6NwY-0002EC-AC
 for 56271 <at> debbugs.gnu.org; Tue, 28 Jun 2022 23:00:45 -0400
Received: by mail-io1-f50.google.com with SMTP id s17so14743847iob.7
 for <56271 <at> debbugs.gnu.org>; Tue, 28 Jun 2022 20:00:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=vT66Mr/CgnJcjz4dp651nsJyCe2fZHuTnnoaKbZwSKA=;
 b=jx3D9fi/GvXKsGVXfPwV7oIqxoKwvke8hbt+tbDFn91aitgVHLrd561QMHzMuibxce
 f82GKhPZ+FOp9rZUEvu1AxLASJBnnSC6xGdAGSO1KaBPHbAHcIGTfeo1hcgiR43D0WCM
 dEPnOaeFRz2WBQTavR0mmg3uG+Ua15ios0UtAyujlE9YXUOUBpDWatUu52+vbbeus5je
 CJPys2Q96BKgbU+N8TY0N2YfeNeMvc/ZyqxIikjz90A6tWMFUNeqcudtjSlbbogrXu4y
 PuWktS86HQuiCUnmOFa75qbyLRicF0I7ZcuC/1a/jw4ng4jfrxF4Tqo6wk/mWWSty/mo
 caiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=vT66Mr/CgnJcjz4dp651nsJyCe2fZHuTnnoaKbZwSKA=;
 b=ffnj/WgPvNCvh9W/jFt75rG2WvSbjWyVd9oabhkbWqlCyn74vkzrD5lEtTqMcnYY19
 eHLv1K0Hejanm89hlnkgi0To0QWilJNFYs1p/6h8nc9GqsG6NoJZDL42NLy2X4XMXheo
 wH3bAf/SAGdbPrzEdsMG37nP/UKD78qYpz6nkVNQqWiubC3aDWJMXdZs7JXf0j5TYO2r
 s8xlDPE2nZG5/EvUbxiufA9jKwbjNszsiil1v6LRHK4AobYbrZICnhfsKDh1QYRoEmrV
 A1qGhUwNHxJ1GJBjPIh9zpbzufJWJvtYXGsw8/F7N2an8ea2hrQwIA6/MIRHqiOnZnlq
 82vg==
X-Gm-Message-State: AJIora9/INrXPaIeb7w/bacjigCMQDzrG+dI9zYz6D1iyXYklfEbHhwx
 HdQi0kEnTFubVTxQowtBjAZjVjF7KO8Ln/Y9wrf1WC1z
X-Google-Smtp-Source: AGRyM1vyV/ucns9OlmkbKnCdhiEXR5EKe6jSHI1AfX8WNXGFVaf9Aa/u9E1pP/am2Dw1ThvI4tCT2/jl37kBrB5Emg8=
X-Received: by 2002:a05:6602:2e8d:b0:64f:b683:c70d with SMTP id
 m13-20020a0566022e8d00b0064fb683c70dmr630357iow.62.1656471636185; Tue, 28 Jun
 2022 20:00:36 -0700 (PDT)
MIME-Version: 1.0
References: <CA+G3_PMzbzK4W=Zrs+ksx0Z=vX1pp44aujC2z5+LmP_6bZc7eg@HIDDEN>
 <87lethroiv.fsf@HIDDEN>
 <CA+G3_POGKF-fDfBuxNcc93WSEaaYzAd4FSgk-vKy=tQYOXYtHg@HIDDEN>
 <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@HIDDEN>
In-Reply-To: <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@HIDDEN>
From: Tom Gillespie <tgbugs@HIDDEN>
Date: Tue, 28 Jun 2022 20:00:24 -0700
Message-ID: <CA+G3_PO9frF19sA5GEnSeHZTjYhrNotgaHJAJ2fEmni0nm9+sw@HIDDEN>
Subject: Re: lisp/progmodes/python.el; unmatched quotes cause infinite loop
 freezing emacs
To: 56271 <at> debbugs.gnu.org
Content-Type: multipart/mixed; boundary="00000000000074db6905e28d5b59"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56271
Cc: Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--00000000000074db6905e28d5b59
Content-Type: text/plain; charset="UTF-8"

Patch to add a test using the evil file as an example.

--00000000000074db6905e28d5b59
Content-Type: text/x-patch; charset="US-ASCII"; 
	name="0001-test-lisp-progmodes-python-tests.el-add-test-for-nav.patch"
Content-Disposition: attachment; 
	filename="0001-test-lisp-progmodes-python-tests.el-add-test-for-nav.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_l4z0e4py0>
X-Attachment-Id: f_l4z0e4py0

RnJvbSAyYzZlYjc3OTNiODkzOGQyY2NlNDEzNDk5YTYyNzE2YTg3MTYzYTI5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBUb20gR2lsbGVzcGllIDx0Z2J1Z3NAZ21haWwuY29tPgpEYXRl
OiBUdWUsIDI4IEp1biAyMDIyIDE5OjU1OjMxIC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gdGVzdC9s
aXNwL3Byb2dtb2Rlcy9weXRob24tdGVzdHMuZWw6IGFkZCB0ZXN0IGZvciBuYXYgZW5kIG9mCiBi
bG9jawoKQWRkIHRlc3QgZm9yIHB5dGhvbi1uYXYtZW5kLW9mLWJsb2NrIHRvIHByZXZlbnQgcmVn
cmVzc2lvbiBvZiBidWcjNTYyNzEuCi0tLQogdGVzdC9saXNwL3Byb2dtb2Rlcy9weXRob24tdGVz
dHMuZWwgfCAxMiArKysrKysrKysrKysKIDEgZmlsZSBjaGFuZ2VkLCAxMiBpbnNlcnRpb25zKCsp
CgpkaWZmIC0tZ2l0IGEvdGVzdC9saXNwL3Byb2dtb2Rlcy9weXRob24tdGVzdHMuZWwgYi90ZXN0
L2xpc3AvcHJvZ21vZGVzL3B5dGhvbi10ZXN0cy5lbAppbmRleCBlMTdiYzBkZjkyLi5jNTlhMmU3
OTUzIDEwMDY0NAotLS0gYS90ZXN0L2xpc3AvcHJvZ21vZGVzL3B5dGhvbi10ZXN0cy5lbAorKysg
Yi90ZXN0L2xpc3AvcHJvZ21vZGVzL3B5dGhvbi10ZXN0cy5lbApAQCAtMjU2NSw2ICsyNTY1LDE4
IEBAIHB5dGhvbi1uYXYtZW5kLW9mLWJsb2NrLTEKICAgICAgICAgICAgICAgICAocHl0aG9uLXRl
c3RzLWxvb2stYXQgInByaW50ICdBZnRlciBmKCphcmdzKSciKQogICAgICAgICAgICAgICAgIChs
aW5lLWVuZC1wb3NpdGlvbikpKSkpKQogCisoZXJ0LWRlZnRlc3QgcHl0aG9uLW5hdi1lbmQtb2Yt
YmxvY2stMiAoKQorICAiRW5zdXJlIHRoYXQgYHB5dGhvbi1uYXYtZW5kLW9mLWJsb2NrJyBkb2Vz
IG5vdCBlbnRlciBhbiBpbmZpbml0ZSBsb29wLiIKKyAgKHB5dGhvbi10ZXN0cy13aXRoLXRlbXAt
YnVmZmVyCisgICAiZGVmCisgICAgPScnCisgJworXCJcIlwiXCJcIlwiCisgIworJycKKyIKKyAg
IChweXRob24tbmF2LWVuZC1vZi1ibG9jaykpKQorCiAoZXJ0LWRlZnRlc3QgcHl0aG9uLW5hdi1m
b3J3YXJkLWJsb2NrLTEgKCkKICAgIlRoaXMgYWxzbyBhY2NvdW50cyBhcyBhIHRlc3QgZm9yIGBw
eXRob24tbmF2LWJhY2t3YXJkLWJsb2NrJy4iCiAgIChweXRob24tdGVzdHMtd2l0aC10ZW1wLWJ1
ZmZlcgotLSAKMi4zNS4xCgo=
--00000000000074db6905e28d5b59--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56271; Package emacs. Full text available.

Message received at 56271 <at> debbugs.gnu.org:


Received: (at 56271) by debbugs.gnu.org; 29 Jun 2022 02:46:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 28 22:46:18 2022
Received: from localhost ([127.0.0.1]:56778 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o6Nib-0001qM-SN
	for submit <at> debbugs.gnu.org; Tue, 28 Jun 2022 22:46:18 -0400
Received: from mail-io1-f46.google.com ([209.85.166.46]:42883)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tgbugs@HIDDEN>) id 1o6NiZ-0001q5-KG
 for 56271 <at> debbugs.gnu.org; Tue, 28 Jun 2022 22:46:16 -0400
Received: by mail-io1-f46.google.com with SMTP id a10so14712446ioe.9
 for <56271 <at> debbugs.gnu.org>; Tue, 28 Jun 2022 19:46:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=F3WiRGMbCIjXPTsgE9AuOkodkT4YLNBRTXuBKGsFR4M=;
 b=ELHcdha2RFpX1Oj6zdKT3Av/u4BSWLtChrJSFXNZz7IjCO5H/Xls8yDoaQHM66URlP
 NNVaHFtWRz2w+M979G/H//mS5tAgfLBKnQSRVI0VpGBVj4dV1Xqwm60vlmnlK+IgJMD6
 pjLnaMEy+AOPoYrPxUWWRZkBh+CIAKr7YL55SO4TsTImTJMqF4+WWbvQWuoXEGBa+TYr
 RqNFtUNlyMMLGp/ZP35S5q4PsGmeoIPHASWPmvs704DNs3xMwvaYsB7i7PS3tV0yqjyg
 bZ/GjIJ3Jq2x24hvUc08ky9FJxVZTJqJg8gn9vOAwZwgcaCzwhYsXtY4PnOJmqh4Us0C
 ezZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=F3WiRGMbCIjXPTsgE9AuOkodkT4YLNBRTXuBKGsFR4M=;
 b=Ltbg0vhaR+lmL/9mpjVNvQ9I5Bd5kXW8GySr9J28mk24WleYpwOG0+h5uNHpB8FZwx
 M5mxpUuctR4RzpintHSufELypiBdUJUuUCfBGeh9bU/4Nh+OvCxqfCawaU05pVSo+mvg
 dqs7+EIHFc7R59TWTambRURgaoMTqkh6XZqE0e8/CDJBAV27yF+E5KrfWKJtEVQGZzyA
 L4wqILBEUauSDiMq0/o6R6+bWiOLPaMVxEMY8+iU9V2q7C1TT2iYghc0s6na+nigQBp9
 laR+7TSH91YxYNnQTaP8YuOQycZ5c1y4qnRDjMXPl/TOGnJeggEZAo3FE9P0rIqUnOvw
 7iVg==
X-Gm-Message-State: AJIora/sEzVXhSNc1i4Mfl2tsF3OBs6AwxMtC5ioNznw+Wl9YLeIEP14
 4iDR115C9DGp3gLVadf201gs2DdadkBs/z/fxGX/MRTB
X-Google-Smtp-Source: AGRyM1u001rmS+awfgzvxg15e2piG3EihhyCrhppfP+bkVM/C7hSlCL7paiU0ifWUakH/NFOeTMY+x8wxBsygt9TxMQ=
X-Received: by 2002:a05:6638:25cd:b0:33c:b17e:d621 with SMTP id
 u13-20020a05663825cd00b0033cb17ed621mr688716jat.61.1656470769671; Tue, 28 Jun
 2022 19:46:09 -0700 (PDT)
MIME-Version: 1.0
References: <CA+G3_PMzbzK4W=Zrs+ksx0Z=vX1pp44aujC2z5+LmP_6bZc7eg@HIDDEN>
 <87lethroiv.fsf@HIDDEN>
 <CA+G3_POGKF-fDfBuxNcc93WSEaaYzAd4FSgk-vKy=tQYOXYtHg@HIDDEN>
In-Reply-To: <CA+G3_POGKF-fDfBuxNcc93WSEaaYzAd4FSgk-vKy=tQYOXYtHg@HIDDEN>
From: Tom Gillespie <tgbugs@HIDDEN>
Date: Tue, 28 Jun 2022 19:45:58 -0700
Message-ID: <CA+G3_PNpJOkCu0iEdtzd0jTZ0DbBUcLJrS6nMwti8-NW7E0uKQ@HIDDEN>
Subject: Re: lisp/progmodes/python.el; unmatched quotes cause infinite loop
 freezing emacs
To: 56271 <at> debbugs.gnu.org
Content-Type: multipart/mixed; boundary="000000000000ceb54d05e28d2786"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56271
Cc: Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ceb54d05e28d2786
Content-Type: text/plain; charset="UTF-8"

I was able to hunt down the issue.

The problem is in python-nav-end-of-block where there is an implicit
assumption that python-nav-end-of-statement always makes forward
progress, which is violated when the buffer contains e.g. a single
quote.

I have attached a patch the resolves this issue but there may be other
lurking issues due to the removal of cl-assert because there are now
all sorts of code paths that will run that never ran before because
they would hit that assertion and bail out, usually all the way back
to the top.

--000000000000ceb54d05e28d2786
Content-Type: text/x-patch; charset="US-ASCII"; 
	name="0001-lisp-progmodes-python.el-python-nav-end-of-block-pre.patch"
Content-Disposition: attachment; 
	filename="0001-lisp-progmodes-python.el-python-nav-end-of-block-pre.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_l4yzwl760>
X-Attachment-Id: f_l4yzwl760

RnJvbSAwYjM3ZTc4ZDYzM2FmNjZkOTZlNDk2NTVlM2JiODQxODQzM2E2MTY0IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBUb20gR2lsbGVzcGllIDx0Z2J1Z3NAZ21haWwuY29tPgpEYXRl
OiBUdWUsIDI4IEp1biAyMDIyIDE5OjI4OjA1IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gbGlzcC9w
cm9nbW9kZXMvcHl0aG9uLmVsIChweXRob24tbmF2LWVuZC1vZi1ibG9jayk6IHByZXZlbnQKIGlu
ZmluaXRlIGxvb3AKCmxpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCAocHl0aG9uLW5hdi1lbmQtb2Yt
YmxvY2spOiBGaXggYSBiYWQKYXNzdW1wdGlvbiB0aGF0IHB5dGhvbi1uYXYtZW5kLW9mLXN0YXRl
bWVudCBhbHdheXMgbWFrZXMgZm9yd2FyZApwcm9ncmVzcyBieSB0ZXN0aW5nIHRoYXQgaXQgYWN0
dWFsbHkgZG9lcy4gSWYgdGhpcyBjaGVjayBpcyBub3QgbWFkZQp0aGVuIGl0IGlzIHBvc3NpYmxl
IGZvciBweXRob24tbmF2LWVuZC1vZi1ibG9jayB0byBlbnRlciBhbiBpbmZpbml0ZQpsb29wLiAo
YnVnIzU2MjcxKQotLS0KIGxpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCB8IDExICsrKysrKysrKy0t
CiAxIGZpbGUgY2hhbmdlZCwgOSBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQoKZGlmZiAt
LWdpdCBhL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCBiL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5l
bAppbmRleCBlMGM5MzdkN2NlLi4xNmNkZjU4NjExIDEwMDY0NAotLS0gYS9saXNwL3Byb2dtb2Rl
cy9weXRob24uZWwKKysrIGIvbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsCkBAIC0xNjM2LDExICsx
NjM2LDE1IEBAIHB5dGhvbi1uYXYtZW5kLW9mLXN0YXRlbWVudAogICAgICh3aGlsZSAoYW5kIChv
ciBub2VuZCAoZ290by1jaGFyIChsaW5lLWVuZC1wb3NpdGlvbikpKQogICAgICAgICAgICAgICAg
IChub3QgKGVvYnApKQogICAgICAgICAgICAgICAgIChjb25kICgoc2V0cSBzdHJpbmctc3RhcnQg
KHB5dGhvbi1zeW50YXgtY29udGV4dCAnc3RyaW5nKSkKLSAgICAgICAgICAgICAgICAgICAgICAg
OzsgVGhlIGFzc2VydGlvbiBjYW4gb25seSBmYWlsIGlmIHN5bnRheCB0YWJsZQorICAgICAgICAg
ICAgICAgICAgICAgICA7OyBUaGUgY29uZGl0aW9uIGNhbiBiZSBuaWwgaWYgc3ludGF4IHRhYmxl
CiAgICAgICAgICAgICAgICAgICAgICAgIDs7IHRleHQgcHJvcGVydGllcyBhbmQgdGhlIGBzeW50
YXgtcHBzcycgY2FjaGUKICAgICAgICAgICAgICAgICAgICAgICAgOzsgYXJlIHNvbWVob3cgb3V0
IG9mIHdoYWNrLiAgVGhpcyBoYXMgYmVlbgogICAgICAgICAgICAgICAgICAgICAgICA7OyBvYnNl
cnZlZCB3aGVuIHVzaW5nIGBzeW50YXgtcHBzcycgZHVyaW5nCiAgICAgICAgICAgICAgICAgICAg
ICAgIDs7IG5hcnJvd2luZy4KKyAgICAgICAgICAgICAgICAgICAgICAgOzsgSXQgY2FuIGFsc28g
ZmFpbCBpbiBjYXNlcyB3aGVyZSB0aGUgYnVmZmVyIGlzIGluCisgICAgICAgICAgICAgICAgICAg
ICAgIDs7IHRoZSBwcm9jZXNzIG9mIGJlaW5nIG1vZGlmaWVkLCBlLmcuIHdoZW4gY3JlYXRpbmcK
KyAgICAgICAgICAgICAgICAgICAgICAgOzsgYSBzdHJpbmcgd2l0aCBgZWxlY3RyaWMtcGFpci1t
b2RlJyBkaXNhYmxlZCBzdWNoCisgICAgICAgICAgICAgICAgICAgICAgIDs7IHRoYXQgdGhlcmUg
Y2FuIGJlIGFuIHVubWF0Y2hlZCBzaW5nbGUgcXVvdGUKICAgICAgICAgICAgICAgICAgICAgICAg
KHdoZW4gKD49IHN0cmluZy1zdGFydCBsYXN0LXN0cmluZy1lbmQpCiAgICAgICAgICAgICAgICAg
ICAgICAgICAgKGdvdG8tY2hhciBzdHJpbmctc3RhcnQpCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgKGlmIChweXRob24tc3ludGF4LWNvbnRleHQgJ3BhcmVuKQpAQCAtMTcyMyw3ICsxNzI3LDEw
IEBAIHB5dGhvbi1uYXYtZW5kLW9mLWJsb2NrCiAgICAgICAod2hpbGUgKGFuZCAoZm9yd2FyZC1s
aW5lIDEpCiAgICAgICAgICAgICAgICAgICAobm90IChlb2JwKSkKICAgICAgICAgICAgICAgICAg
IChvciAoYW5kICg+IChjdXJyZW50LWluZGVudGF0aW9uKSBibG9jay1pbmRlbnRhdGlvbikKLSAg
ICAgICAgICAgICAgICAgICAgICAgICAgIChvciAocHl0aG9uLW5hdi1lbmQtb2Ytc3RhdGVtZW50
KSB0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIChsZXQgKChzdGFydCAocG9pbnQpKSkK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHB5dGhvbi1uYXYtZW5kLW9mLXN0YXRlbWVu
dCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgbXVzdCBtb3ZlIGZvcndhcmQgb3Ro
ZXJ3aXNlIGluZmluaXRlIGxvb3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKD4gKHBv
aW50KSBzdGFydCkpKQogICAgICAgICAgICAgICAgICAgICAgIChweXRob24taW5mby1jdXJyZW50
LWxpbmUtY29tbWVudC1wKQogICAgICAgICAgICAgICAgICAgICAgIChweXRob24taW5mby1jdXJy
ZW50LWxpbmUtZW1wdHktcCkpKSkKICAgICAgIChweXRob24tdXRpbC1mb3J3YXJkLWNvbW1lbnQg
LTEpCi0tIAoyLjM1LjEKCg==
--000000000000ceb54d05e28d2786--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56271; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jun 2022 01:51:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 27 21:51:53 2022
Received: from localhost ([127.0.0.1]:53654 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o60OP-0000tS-8t
	for submit <at> debbugs.gnu.org; Mon, 27 Jun 2022 21:51:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:57786)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tgbugs@HIDDEN>) id 1o60OL-0000tJ-BI
 for submit <at> debbugs.gnu.org; Mon, 27 Jun 2022 21:51:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43970)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <tgbugs@HIDDEN>) id 1o60OL-0005c5-3G
 for bug-gnu-emacs@HIDDEN; Mon, 27 Jun 2022 21:51:49 -0400
Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:42584)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <tgbugs@HIDDEN>) id 1o60O6-0008PF-RW
 for bug-gnu-emacs@HIDDEN; Mon, 27 Jun 2022 21:51:48 -0400
Received: by mail-io1-xd33.google.com with SMTP id a10so11472055ioe.9
 for <bug-gnu-emacs@HIDDEN>; Mon, 27 Jun 2022 18:51:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:from:date:message-id:subject:to:cc;
 bh=C6droOTt7DJ4ewmoa3KiuraRe9lEwswkIVOCwxHFjLE=;
 b=X8yyQvqhrgcRZNTx+38LKQg4fYvtWGOGqaqEWIRbnexFUNEn24AZew/Wd/bZHAi3pz
 GB0k3q2ATtu5O2ulukfy72T+2VxrLisQgU9TpcGMsV1SPHJsCZvu84Tl92D3Sd/oq3n4
 NebyfeygB+56N9RRGQrMLtby7I3RbXQi6DQ3t9tUT+Ag6nHxJ5KSMEg5qfiqkoJxD2kB
 srr+MLMs7TykifTRLtCR+sQCa/AqqIfbLDCS7q0TeywkLCcd0WHh1O2G4Ft7GidKvMSt
 xwuE6rCk1FiDfAIuvVhYxggvoFGTgvIyvFGLgrY85hvdNZZGCos1bUPtJMbF07A9YjEx
 JrRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc;
 bh=C6droOTt7DJ4ewmoa3KiuraRe9lEwswkIVOCwxHFjLE=;
 b=6tnFXuYnqqwQ8eHgub5X5uenz4Qq086ifzZGv8gZkXjruPDrhkph/ycNXF9ncqHra9
 FO/sSQ0nWiAkl9daIZF94VSZGdvgHly7CZjKYsfXgl9zjDeCgUGQ9ZRs/3EXeDRG7aV1
 fD9bcn9tkZ6VQzSYoQB97BQegdd9TorfbvGqPnPowhCdS8meJ2Wbx4n6YHgqh0p7Lvul
 mjpY0HvRoUbSlSWC76vpxBJrH7AAgntNfvjT1e0OHAAB3qkAA6YMtDaOKAlNfEhocbOI
 JlJsxfZGhaFUKlRm0adG6YhLphQ43aG5FiEnLw3fb4uVoaFeqnbM5kIV9s9gV1OJGW/U
 eD1g==
X-Gm-Message-State: AJIora/ZU+2vqmTTIEcC7KxtzyL8+8HXRTm8foaCfpqXw/2hS8TjNBZs
 BT67ZBdvAhGMGTmXqAmY/sUp8shOGOM+O1hfW3xmMWS81s4=
X-Google-Smtp-Source: AGRyM1tGzGpAV6SDytmsjeU4oorcMKTi9gR344nccoqzkAWkZIxld2N3w1L7UaCLfZpc8RmYlq+wFtn61lUITzOXW+c=
X-Received: by 2002:a5d:914b:0:b0:672:6629:bfa2 with SMTP id
 y11-20020a5d914b000000b006726629bfa2mr8230520ioq.159.1656381093188; Mon, 27
 Jun 2022 18:51:33 -0700 (PDT)
MIME-Version: 1.0
From: Tom Gillespie <tgbugs@HIDDEN>
Date: Mon, 27 Jun 2022 18:51:21 -0700
Message-ID: <CA+G3_PMzbzK4W=Zrs+ksx0Z=vX1pp44aujC2z5+LmP_6bZc7eg@HIDDEN>
Subject: lisp/progmodes/python.el; unmatched quotes cause infinite loop
 freezing emacs
To: Emacs Bug Report <bug-gnu-emacs@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=2607:f8b0:4864:20::d33;
 envelope-from=tgbugs@HIDDEN; helo=mail-io1-xd33.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01,
 WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 54996 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Using git bisect shows 85db21b94b23b4701930892d1eecc9a1167ed968 is the
source of this issue, all commits following it on master show the same
issue. Reverting that commit fixes the issue.

While editing python files if a single quote occurs in the file during
the course of editing then emacs will enter an infinite loop. The
exact location of the single quote is important, but the pattern that
triggers it happens frequently in python files.

You can get a traceback pinpointing the issue by sending SIGUSR2 to
the hung emacs process.

Below is a minimal python file that will trigger the issue.
Run with emacs -Q evil-python-file.py
#+begin_verbatim
def
    =''
 '
""""""
 # there must be at least one space on this line, comment not needed
''
#+end_verbatim

The full pattern that causes the issue is something like the following.

#+begin_verbatim
<keyword>
<exactly-python-indent-offset-number-of-spaces>=<zero-or-more-not-quotes>''
<at-least-one-space>'
<zero-or-more-lines-with-any-contents-except-single-quote-marks*>
<zero-or-more-spaces><triple-double-quote-string><any-but-single-quote>
<at-least-one-space><any-but-single-quote>
<single-quote-string>
#+end_verbatim

Any keyword should work I have tested with class, def, and with.

The zero or more lines at any indentation can also have single quote
marks that are paired, but there is some weirdness when you have 4 on
a line that makes it possible to avoid the issue.

I can fix the issue by reverting to the cl-assert pattern using unless
to raise an error (unless (>= string-start last-string-end) (error
"oops")) and running the code after that unconditionally. This
prevents jit-lock from trying to run infinitely on a malformed buffer.

That said, this may simply reintroduce bug#54996, and the change
unmasked some other issue with what is going on during the call to
jit-lock-function which needed that error to be throw by cl-assert to
avoid infinite loops/retries.




Acknowledgement sent to Tom Gillespie <tgbugs@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#56271; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 29 Jun 2022 15:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.