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 12:02:17 +0100 Message-ID: <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="3201"; 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 12:04:12 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 1n9mHc-0000aw-LL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 12:04:12 +0100 Original-Received: from localhost ([::1]:60906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9mHb-00028t-8a for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 06:04:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9mHS-00025E-9M for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 06:04:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9mHR-0004ve-W8 for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 06:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9mHR-00038C-Ti for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 06:04: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 11:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53343 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164250379311962 (code B ref -1); Tue, 18 Jan 2022 11:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jan 2022 11:03:13 +0000 Original-Received: from localhost ([127.0.0.1]:49073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9mGe-00036r-Lc for submit@debbugs.gnu.org; Tue, 18 Jan 2022 06:03:13 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9mGZ-00036e-I3 for submit@debbugs.gnu.org; Tue, 18 Jan 2022 06:03:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9mGZ-0001R2-6G for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 06:03:07 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:49875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9mFs-0004mB-Aq for bug-gnu-emacs@gnu.org; Tue, 18 Jan 2022 06:03:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1642503738; bh=1rFQBZ8taPWcij2wD32ib5VviTPmmuXqm5n0Q3NwhqA=; h=X-UI-Sender-Class:From:To:Subject:Date; b=hsWuPxcXk+11xEj2rVmm0xHtvHypaOPh8sfhQ0O6naHt2QI5KfGRDH9AHFpmPeqL+ pCgfCfUpFfcoxmFaUN+GZGtPtjQ5hZ5up7VreIMVVtjJ2yCwuvDLG7FgaHM9IqEN9a 8IFwOGKaqzoa3DzMGeDKecaGygW6wKD5VKhlRcBs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobelfs2 ([89.246.38.66]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mi2Jt-1mf6KZ0SsD-00e0iq for ; Tue, 18 Jan 2022 12:02:18 +0100 X-Provags-ID: V03:K1:r5lPX2DSj2oA8CwTsMMgmd5PxpgBKoY2o9Ps/REydccQoavQu91 6Fr3BuHmQs0xz0zD8zr4xGibG9nv9UfFP1kdWvTj48SDeXPQu3VKPSJ9eF148Ji8igcqLHQ dxYMquU9gM36FS/adxSMqO0kA9uq/7DBNYkzwccZgQalrShy7cBOeYBHCNvhFlWhhYL62I+ BXE0knSkVuQPrJYU/BGaA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Uq0QaD+8Pls=:aL4NsCW+yfjrg1gdpABSBW KaJfzGLaQaue8xqnx33A37FJ5TlgfCh5yR01fYUPYUzCQUt6Mj5h32pJ4zl52TK03Cdi7yDnr smVOTEISrbkquNGmGKT3FXotqpF/oj870Rmy5ZTOWvVWUb0o8xOD8QWzzsXSpD7DnW6yhzO8d a0pECG7dpqEh5IFGGPdPMAM5z/ECEZsPZyms77ycsF4TnMB9qQ7Fu/k+duHgV4OA9y8b2Zkvs BjlxlMvgTu04vro2NWz5jQAjSAjZe1XKg68y/L21z8Wd5lFaKg6M2xCrQOF9BbhH8YzXYTq2T XJV1n6ezcj0PKfkhXD6Jk5medYor7fMovpPfCSKuepdY0F0qzrgsPJekMZfulhRTEXMl+o/Ld 9C4D1N709ECNt2FchBMyBl1a+UY0jRCaZVWJ/A+OTzqxslXoNFm8RsQd9DcPXe0MXq8CXLLRs Rv/+k6lY4XbPx3MSB/lf2mOWFHdobyNo7vUSbFvr/1y4nzGiFaZ5q2fRk4KOVgNxGvYm4FJQF SY3uTiUKUljoscc8fdQxYAYak4DFOu02cDjUYLtkg57k4mUf8oBa2bcf9yd1y+1kQ+VHoyQrm JK+nVAWcGBBmI03BipdGXdblJlGlKThMbSB1l3fO35o6hYjv2ZGgaAquaJnEgZ49G+Y5xO87e wdIZ8COk6hF+e7OpzGgGGehQSvHqs1PjXiqe4IXx0pedty119Zns61G22SancCAg0Hrri2Dnf ++yFa+Uk9cEUhrs4ZfI3LfM7ZjFgNThByp4kKC+SK5R0QT/tvbwdGtNbThwHTbTqoiMMhQGD Received-SPF: pass client-ip=212.227.17.20; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:224499 Archived-At: 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)) cl--assertion-failed((looking-at diff-hunk-header-re)) diff--iterate-hunks(975 #f(compiled-function (beg end) #)) diff--font-lock-syntax(975) font-lock-fontify-keywords-region(1 975 nil) font-lock-default-fontify-region(1 975 nil) font-lock-fontify-region(1 975) #f(compiled-function (beg end) #)(1 975) font-lock-ensure() mm-display-inline-fontify((# ("text/x-diff") nil nil ("attachment" (filename . "ebrowse-emacs-27.2-fix.diff")) nil nil nil) diff-mode) mm-display-patch-inline((# ("text/x-diff") nil nil ("attachment" (filename . "ebrowse-emacs-27.2-fix.diff")) nil nil nil)) mm-display-inline((# ("text/x-diff") nil nil ("attachment" (filename . "ebrowse-emacs-27.2-fix.diff")) nil nil nil)) gnus-mm-display-part((# ("text/x-diff") nil nil ("attachment" (filename . "ebrowse-emacs-27.2-fix.diff")) nil nil nil)) gnus-article-view-part(2) funcall-interactively(gnus-article-view-part 2) call-interactively(gnus-article-view-part nil nil) command-execute(gnus-article-view-part) 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. In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4) of 2022-01-18 built on strobelfs2 Repository revision: 68472c12e7acdb6e9f55a10eecf02a4ace26465a Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Linux From Scratch r11.0-115 Configured using: 'configure --with-xwidgets 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB