From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30964: python-mode failing "overlapping strings" assertion lately Date: Tue, 29 May 2018 20:29:26 -0400 Message-ID: <874liqc7fd.fsf@gmail.com> References: <5c3e75f096fae419224804c590805b9c.squirrel@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1527640090 25257 195.159.176.226 (30 May 2018 00:28:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 00:28:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Philipp Stephani , 30964@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 30 02:28:05 2018 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 1fNoyD-0006Rb-IT for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2018 02:28:05 +0200 Original-Received: from localhost ([::1]:35587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNp0I-0000yu-UK for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 May 2018 20:30:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNp0A-0000xC-5J for bug-gnu-emacs@gnu.org; Tue, 29 May 2018 20:30:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNp06-0007ov-RO for bug-gnu-emacs@gnu.org; Tue, 29 May 2018 20:30:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNp06-0007ok-Lh for bug-gnu-emacs@gnu.org; Tue, 29 May 2018 20:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fNp06-0003Ip-AZ for bug-gnu-emacs@gnu.org; Tue, 29 May 2018 20:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 May 2018 00:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30964 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30964-submit@debbugs.gnu.org id=B30964.152764017612640 (code B ref 30964); Wed, 30 May 2018 00:30:02 +0000 Original-Received: (at 30964) by debbugs.gnu.org; 30 May 2018 00:29:36 +0000 Original-Received: from localhost ([127.0.0.1]:54465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNozg-0003Ho-K0 for submit@debbugs.gnu.org; Tue, 29 May 2018 20:29:36 -0400 Original-Received: from mail-io0-f177.google.com ([209.85.223.177]:37003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNoze-0003Hb-E8 for 30964@debbugs.gnu.org; Tue, 29 May 2018 20:29:34 -0400 Original-Received: by mail-io0-f177.google.com with SMTP id e20-v6so19618983iof.4 for <30964@debbugs.gnu.org>; Tue, 29 May 2018 17:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=qfrLRzvm5tucfdVSuQ4VHoEswAGt27xiqbFlAh696z8=; b=t1QHud8vxhcgW4gOBvC/ImSLPHWJrZUvpfrxTWgd11YhvipnQ+2VkJzrhPjri033uO xjX1iYcST8OJpHSx3Xqh/PuhuEfgrX+ijkrUntsyrue/oqwRLF4VO1izEHvEnLSg4e+5 3LHQvxND2w7Pwlay2q7rjBdZINfl542wqeis75vBAEopbgOPWMyLihD2g6D0Dh160V+6 v/lKr9it+A5JTlYr7EOyr1YfgjpjpuF+VNwHaaILTr650D4CkPMYZ2FPkSedP1E7Z63m ofnWet92wygrAR5SCrMFWAthCJGSHiFaFM0t5raLoaxdblTUH0YjX5h8AwyRUTWSMLbg gF+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=qfrLRzvm5tucfdVSuQ4VHoEswAGt27xiqbFlAh696z8=; b=We3Vx22PhSDnl9ztkKjz1/IC9SUbpTqSZbyodrauzEhMyzP+ZaARThfguBxWB31wCG SnVkij3ONofgzrubAiRrNYMANmrZ9Q9Kvhv9jgCqJ2tANeh7S0qXawAz33SABpHbptrj 439J1iu4H2zAppp6AxWra5Hj/XuSsDYYuJ6Su1mkd531VHmbPCH2+44GrIgchhJ5NZT7 33W8puGSYN3Wp1WkmweKra8GZqLdiY9V1wpBC2/jcFRKyGwwawLCuzHzWtAzR5888StG zBWWlPercCrarT7KhOlffWBWeB5c2w6klh3NwjzuftT2Xvk9/KHRVoo/n9+sLH5XsryG 9DbQ== X-Gm-Message-State: APt69E3EIQknnugwQiZctMFU+wSbwEEgayu5hUJUTs/9wIExLdXmEnJ0 ZDXui+5soMVyxgaWjIb8pvs= X-Google-Smtp-Source: ADUXVKL6/MyHk2veuAcaMK7ZYaQcNXWMQvycggKXe2b64RZFCuypK/lk/EwR57idb8NsaXWrUVS2fw== X-Received: by 2002:a6b:c986:: with SMTP id z128-v6mr521456iof.266.1527640168892; Tue, 29 May 2018 17:29:28 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id x189-v6sm8076808ite.2.2018.05.29.17.29.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 17:29:27 -0700 (PDT) In-Reply-To: ("=?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel"'s message of "Fri, 18 May 2018 11:46:26 -0400") 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:146725 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cl=C3=A9ment Pit-Claudel writes: > Here's a reliable repro: > > def f(): > " > > def g(): > """That's a docstring""" > return '' It can be reduced a bit: --=-=-= Content-Type: text/x-python Content-Disposition: inline; filename=bug-30964-py-assert.py Content-Description: bug reproducer ' docstring'' --=-=-= Content-Type: text/plain Debugger entered--Lisp error: (cl-assertion-failed ((> string-start last-string-end) "Overlapping strings detected" 13 13)) cl--assertion-failed((> string-start last-string-end) "Overlapping strings detected" (13 13) nil) python-nav-end-of-statement() python-info-end-of-statement-p() python-info-end-of-block-p() python-nav--forward-sexp(-1 nil nil) python-nav-forward-sexp(-1 nil nil) python-nav-backward-sexp() python-info-docstring-p((0 nil nil t nil nil 0 nil 1 nil nil)) python-font-lock-syntactic-face-function((0 nil nil t nil nil 0 nil 1 nil nil)) font-lock-fontify-syntactically-region(1 15 nil) font-lock-default-fontify-region(1 15 nil) font-lock-fontify-region(1 15) font-lock-fontify-block(nil) funcall-interactively(font-lock-fontify-block nil) call-interactively(font-lock-fontify-block nil nil) command-execute(font-lock-fontify-block) I think the problem is that the assertion is off by 1, it currently asserts that there is at least one space between strings (because the end position goes *after* the string, while the start position is part of the string). I see the assertion was added in [1: 4fbd330fae]. Phillip, does my proposed change make sense to you? ('make -C test python-tests' still passes.) --- i/lisp/progmodes/python.el +++ w/lisp/progmodes/python.el @@ -1506,7 +1506,7 @@ python-nav-end-of-statement ;; are somehow out of whack. This has been ;; observed when using `syntax-ppss' during ;; narrowing. - (cl-assert (> string-start last-string-end) + (cl-assert (>= string-start last-string-end) :show-args "Overlapping strings detected") (goto-char string-start) [1: 4fbd330fae]: 2017-03-23 23:05:19 +0100 Protect against an infloop in python-mode https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4fbd330fae54a9c45d4a717127aa86d75e9938d5 --=-=-=--