GNU bug report logs - #53343
29.0.50; assertion failure in diff--iterate-hunks

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Tue, 18 Jan 2022 11:04:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 53343 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53343 <at> debbugs.gnu.org
Subject: Re: bug#53343: 29.0.50; assertion failure in diff--iterate-hunks
Date: Fri, 21 Jan 2022 14:29:21 +0100
On Fri, 21 Jan 2022 12:07:49 +0100 Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> 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?)
>
> I tried
>
> (setq debug-on-error t)
>
> put the diff in a file, and got a backtrace when loading it.
>
> Debugger entered--Lisp error: (error "Unknown diff hunk type")
>   signal(error ("Unknown diff hunk type"))
>   error("Unknown diff hunk type")
>   diff-hunk-text("" nil nil)
>   diff-syntax-fontify-hunk(506 506 t)
> etc

Yes, I get this too.  I must have mistested that before.

> So I've now made that function less assertative, and that fixes this
> issue.

Thanks, and I confirm your fix avoids the error.  However, you added
this to the doc string of `diff-ignore-whitespace-hunk': "If
INHIBIT-ERROR, ignore malformed hunks."  But you didn't add an
INHIBIT-ERROR argument.

Steve Berman




This bug report was last modified 3 years and 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.