From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#53343: 29.0.50; assertion failure in diff--iterate-hunks Date: Tue, 18 Jan 2022 13:20:18 +0100 Message-ID: <878rvdkzgd.fsf@gmx.net> References: <87czkpl32e.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4836"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 53343@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 18 13:32: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 1n9nez-00019l-Oy for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 13:32:25 +0100 Original-Received: from localhost ([::1]:44146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9ney-0006wN-Mn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 07:32:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9nTz-0002um-69 for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 07:21:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9nTy-0000vS-1b for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 07:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9nTx-0005Dg-Po for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 07:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jan 2022 12:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53343 X-GNU-PR-Package: emacs Original-Received: via spool by 53343-submit@debbugs.gnu.org id=B53343.164250843220011 (code B ref 53343); Tue, 18 Jan 2022 12:21:01 +0000 Original-Received: (at 53343) by debbugs.gnu.org; 18 Jan 2022 12:20:32 +0000 Original-Received: from localhost ([127.0.0.1]:49150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9nTT-0005Cg-A3 for submit@debbugs.gnu.org; Tue, 18 Jan 2022 07:20:32 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:42923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9nTN-0005CO-C1 for 53343@debbugs.gnu.org; Tue, 18 Jan 2022 07:20:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642508419; bh=kKO4TMyyCMc6jn2QWcR5uGq38ZAooT3KQ2tkDoUorqI=; h=X-UI-Sender-Class:From:To:Subject:References:Date:In-Reply-To; b=hSDv//wIeojlzYQK3xupcuXSdzoaCFR5lDaQScn1fGKaHGZL5K2peH9skZvfa2DUf 4eAo2uYTXvRuQM3ajaLbvpMtITGiCRyd7xt+qoZkqrFJfhye3MQal6MIe9NocOTVoo 7rEw3a6rTlacuoHQwmV++YADr2mGazdzduvHDsGk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobelfs2 ([89.246.38.66]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgNh1-1mfgWS0xFH-00hxml for <53343@debbugs.gnu.org>; Tue, 18 Jan 2022 13:20:19 +0100 In-Reply-To: <87czkpl32e.fsf@gmx.net> (Stephen Berman's message of "Tue, 18 Jan 2022 12:02:17 +0100") X-Provags-ID: V03:K1:sGbqN5qQ7RT5gX5GjO8cMyi+vq5Ny3ui2f03/uLFM8EcHZsAkO/ UBG8DH0AdpyyWfw7nS9x2folCEGVoER1Ozkp8MHZm76YnaXMWPRWuvcVyORuuKosTx//JDl fdL2Z8yXyb5EsiIijI0KKRQtKWQWq9cz2SwayilJxjOx2xYlVvuQ2oXMyZHGJ9OEKofenAK 1Cz0PWt9YWBqGGegeFzyg== X-UI-Out-Filterresults: notjunk:1;V03:K0:l55/8QISCqM=:PzdUK6r7aWH9bnlEFnLIbE vXbB8wb7LzV/JxzwsgwZ0wGjzzCUWZYB77Z2ZgI0FMliiyL9LxY4a7wghvEDrQkjfYKp2W3ys SkJMyj7DZm8x6NgOuxBI4F9SlNlSPtEwKWa9TCUosz6RgrQ+OjXkMfXUKZSU8LnqUofy6XR+K KDiMOOKV8QS0IcBUU34/8anLJZJwl96nqYdPbXtlfXvHVVzvCDsG03cepscv/zhfRihbZtip5 LMaSpS5/R7zuzHNGyY9Ao5LQKZh9N0rU+AvN//0aIfKQ0toOxmFfI9xvPuHt6QvvoL+mDFLjA CJik4hIqeXz/9ZMl2MecZG0F6Bp46sn13gMSKIstTYxzehccJMufv7d+ti6fKsokveMUwlnRh Hmkv+Fa1/p8xx0KsmU3kfLBBB6i2IPg1ZrP1pFXcwQZpr0pG8mp2TO+/mzT/AZU+YdjWUxiDT D8cAh+qA3Ii2wyniQM7wOFv4S0E994rbptMNEXHIGxwm+lTzvmnHmfudCCPpGgLmXg8MjNXz/ oeeOeSsjh75/cpjc1vXdoI/bxJKPmXPmGE1Gu3zC5rGBV7rSB3HiM5xLkD1SeCRmEyySixB+u q09mY1hUVkHbGfIMUFJeUMOrnhtMbIrHmKfvIkt+atrzQ+BxbG3fcrCd2uh+BauHDHWA9hlth HPLywdjUa9SZxFkUKP84XOqlm4Hic6TqdomBJd6NiGlkVjnFn5qrTXjgOxr/SNa61JHsSzsOQ PZXnzEPtnUbVwzk8Azv2rfP7HVEsxv2HM5Lw/9/Q3SJVHBpOIVk1WTeHAV41gKADyP78ySX+ 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:224505 Archived-At: On Tue, 18 Jan 2022 12:02:17 +0100 Stephen Berman wrote: > Trying to view in Gnus an attached and buttonized diff in a certain > article raises an assertion failure. To reproduce: > > 0. emacs -Q > 1. M-x gnus > 2. Type `y' at prompt > 3. Type `B RET news.gmane.io RET' > 4. Type `C-s gmane.emacs.bugs RET RET' > 5. Type `1 RET' at prompt > 6. Type `j' and enter `<87fspm0z47.fsf@stranik.org> RET' at the prompt > 7. Click on the Options menu and check "Enter Debugger on Error" > 8. Type `2 b' > => > Debugger entered--Lisp error: (cl-assertion-failed ((looking-at diff-hunk-header-re) nil)) [...] > The assertion fails when point is at the beginning of the last line in > the following excerpt from the diff (in buffer " *temp*") > > *** /var/home/janstranik/src/emacs-27.2/lib-src/ebrowse.c~ 2021-01-28 11:52:16.000000000 -0600 > --- /var/home/janstranik/src/emacs-27.2/lib-src/ebrowse.c 2021-09-24 09:31:49.136287028 -0500 > *************** > *** 1924,1931 **** > > This happens because diff-beginning-of-hunk calls re-search-forward on > diff-hunk-header-re, which puts point at the end the line "*** 1924,1931 > ****" and then calls (forward-line 0), putting point at the beginning of > that line. But then (looking-at diff-hunk-header-re) returns nil, > raising the assertion in diff--iterate-hunks. Replacing (forward-line > 0) in diff-beginning-of-hunk with (forward-line -1) makes the assertion > succeed. > > I'm not sure if this is a bug or if the diff is malformed. But evidence > that the diff is not malformed is that if the diff in the article is > saved to a file (by typing `2 K o' in the *Summary* buffer), then > visiting that file in diff-mode with -Q does not raise an assertion > failure. On the other hand, I get the assertion failure with the above recipe in emacs-28 and emacs-27, and it seems unlikely that such a bug in diff-mode would have gone unnoticed till now, so maybe the diff is malformed. (Though if so, why does the failure not happen when visiting the file containing the diff?) Steve Berman