From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.bugs Subject: bug#56271: lisp/progmodes/python.el; unmatched quotes cause infinite loop freezing emacs Date: Tue, 28 Jun 2022 19:45:58 -0700 Message-ID: References: <87lethroiv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000ceb54d05e28d2786" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: 56271@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 29 04:47:25 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 1o6Njg-000ASd-Bv for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 04:47:24 +0200 Original-Received: from localhost ([::1]:50272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Nje-0003tH-Sj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 22:47:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6NjK-0003t6-DE for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 22:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6NjK-0002RQ-4Z for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 22:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6NjJ-0001rK-Qc for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 22:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tom Gillespie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jun 2022 02:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56271 X-GNU-PR-Package: emacs Original-Received: via spool by 56271-submit@debbugs.gnu.org id=B56271.16564707787095 (code B ref 56271); Wed, 29 Jun 2022 02:47:01 +0000 Original-Received: (at 56271) by debbugs.gnu.org; 29 Jun 2022 02:46:18 +0000 Original-Received: from localhost ([127.0.0.1]:56778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6Nib-0001qM-SN for submit@debbugs.gnu.org; Tue, 28 Jun 2022 22:46:18 -0400 Original-Received: from mail-io1-f46.google.com ([209.85.166.46]:42883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6NiZ-0001q5-KG for 56271@debbugs.gnu.org; Tue, 28 Jun 2022 22:46:16 -0400 Original-Received: by mail-io1-f46.google.com with SMTP id a10so14712446ioe.9 for <56271@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) In-Reply-To: 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235591 Archived-At: --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: 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--