From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#22983: syntax-ppss returns wrong result. Date: Tue, 5 Sep 2017 02:34:15 +0300 Message-ID: References: <20160311151512.GD2888@acm.fritz.box> <44b4fa9e-ec8e-98a4-d8ad-e799fffa7959@yandex.ru> <20160319122759.GA2644@acm.fritz.box> <9f36a39b-ea9f-2f61-5400-68de18526ab1@yandex.ru> <9fc66395-045c-1984-f530-033c2ff706f6@yandex.ru> <83h8wlz1kf.fsf@gnu.org> <20170902174027.GB4267@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1504568133 23675 195.159.176.226 (4 Sep 2017 23:35:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Sep 2017 23:35:33 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: jwiegley@gmail.com, Philipp Stephani , 22983@debbugs.gnu.org To: Alan Mackenzie , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 05 01:35:19 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dp0tb-00056G-PD for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Sep 2017 01:35:12 +0200 Original-Received: from localhost ([::1]:56082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp0th-0005Mr-B4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Sep 2017 19:35:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp0tW-0005Fd-Vn for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2017 19:35:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dp0tS-0008Rj-An for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2017 19:35:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dp0tS-0008RY-73 for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2017 19:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dp0tR-0000AL-Q8 for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2017 19:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Sep 2017 23:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22983 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22983-submit@debbugs.gnu.org id=B22983.1504568067585 (code B ref 22983); Mon, 04 Sep 2017 23:35:01 +0000 Original-Received: (at 22983) by debbugs.gnu.org; 4 Sep 2017 23:34:27 +0000 Original-Received: from localhost ([127.0.0.1]:49621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dp0st-00009N-B0 for submit@debbugs.gnu.org; Mon, 04 Sep 2017 19:34:27 -0400 Original-Received: from mail-lf0-f67.google.com ([209.85.215.67]:38096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dp0sq-00009A-P3 for 22983@debbugs.gnu.org; Mon, 04 Sep 2017 19:34:25 -0400 Original-Received: by mail-lf0-f67.google.com with SMTP id m199so899087lfe.5 for <22983@debbugs.gnu.org>; Mon, 04 Sep 2017 16:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3GYGTxqCj/J04CsDSwJkyJb+nFwyTStANzSR/7f/GQA=; b=jO0dzZcm8WA3hLwRGmspH2guMItaZwNKeHRTQU2TDW8Eiao6c5jL9jVuDNJwTqFced 1Q/CFyScwRMre17kM1cgpH+l0f/WlEmdaBYSHy7k89a9RNF9hgbh0lVe0lv6vKWzOGAd PFz0cb6rVFVe1oqGl4X8Ol6Bw4hDw6RFD/zgXxdEBsGB1uHwwFKCXHkDG9HXCmc1pXUu pP+WxJEEwePMWywzPMbGlOrQX+mqHBU/D7csb+LxuSL7SDc8uzhExtYDJzuvg1hzbLCx Dsc+sqPb1UBiudFIMzWY2kU9nE0uCGa6ozOfn7KIq90Ujtgc/kY+DhG4cXm8cV7XmiS2 NZug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3GYGTxqCj/J04CsDSwJkyJb+nFwyTStANzSR/7f/GQA=; b=CdGTCR2XYwTVcOvQV6TPTGKsP0CySUL62rR1rRVUvV0oTauYDbVWgKF6hlCekmSFTE 55QDByTQSMUPsY/vw4hmhDSmJZ8zlNuZGCsWC08Qg29XjkobO3GTnhwwauXJH7fPxKpg OLsmxxGVcs4uL1sTQfCloTQi0Bv0vEiY/lnwSldIVBok1wWdq7I3qYmgOQwYrwdXvr9Y TzxxAIfahabcNy46Qb66OBPCxN6JYbEreELDqi48JHOppJtFIA2Lm6vuFZLY27fMh9A3 gIVHuEinAWaB2Q3CWlYD84KAGbH8/yl6FUrmgZaAvkztKK1gk3NLCd8EQQpTTRz8XKAh 0Z1g== X-Gm-Message-State: AHPjjUjYisBK0Uk1AkUiF/kN5kqJ17cZ3vAtZsc7bqfVgL8r+Kv9MqKQ /pSY1Au3RX3o2g== X-Google-Smtp-Source: ADKCNb5NmCNxQUJacxwn4rPRwEaeCyDO/bu0akbdSjzhb/ip1sff3B6nNW2qgFH91+SSs5TN5lswaA== X-Received: by 10.46.68.65 with SMTP id r62mr713411lja.136.1504568058808; Mon, 04 Sep 2017 16:34:18 -0700 (PDT) Original-Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id 9sm1552989ljc.68.2017.09.04.16.34.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Sep 2017 16:34:17 -0700 (PDT) In-Reply-To: <20170902174027.GB4267@ACM> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136588 Archived-At: On 9/2/17 8:40 PM, Alan Mackenzie wrote: > I'm not happy about this. 22983 is a serious design flaw, which has had > deleterious effects deep within Emacs. I'm sure we want to fix design flaws. As long as there is a solid plan that does not swap one flaw for another. > One recorded example, resulting > in an infinite loop, is: > > ######################################################################### > From: Philipp Stephani > To: emacs-devel@gnu.org > Subject: [PATCH] Protect against an infloop in python-mode > Date: Tue, 28 Feb 2017 22:31:49 +0100 > > There appears to be an edge case caused by using `syntax-ppss' in a > narrowed buffer during JIT lock inside of Python triple-quote strings. > Unfortunately it is impossible to reproduce without manually > destroying the syntactic information in the Python buffer, but it has > been observed in practice. In that case it can happen that the syntax > caches get sufficiently out of whack so that there appear to be > overlapping strings in the buffer. As Python has no nested strings, > this situation is impossible and leads to an infloop in > `python-nav-end-of-statement'. Protect against this by checking > whether the search for the end of the current string makes progress. > ######################################################################### > > In this case, Philipp had to apply a workaround. The problem manifested during jit-lock. Do we understand why the (widen) call inside font-lock-default-fontify-region didn't help?