GNU bug report logs - #61256
master; Function `vc-find-revision-no-save' leaks buffers in case of errors

Previous Next

Package: emacs;

Reported by: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>

Date: Fri, 3 Feb 2023 16:26:01 UTC

Severity: normal

Fixed in version 29.0.60

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61256 in the body.
You can then email your comments to 61256 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61256; Package emacs. (Fri, 03 Feb 2023 16:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 03 Feb 2023 16:26:01 GMT) Full text and rfc822 format available.

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

From: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>
To: bug-gnu-emacs <at> gnu.org
Subject: master;
 Function `vc-find-revision-no-save' leaks buffers in case of errors
Date: Fri, 03 Feb 2023 17:24:45 +0100
I haven't actually a test case for this issue but found it by
re-indenting function `vc-find-revision-no-save'.  When doing so you
will notice that the following sexps (indented as in the original code)
are actually both UNWINDFORMS:

		(setq failed nil)
	    (when (and failed (unless buffer (get-file-buffer filename)))
	      (with-current-buffer (get-file-buffer filename)
		(set-buffer-modified-p nil))
	      (kill-buffer (get-file-buffer filename)))

Meaning that the failure-handling `when' will never be eval'ed.  I guess
this is a copy-and-paste error and the (setq failed nil) should be
rather placed in the preceeding (with-current-buffer ...).

Probably not a big deal but not hard to fix, either...






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61256; Package emacs. (Sun, 05 Feb 2023 18:26:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>
Cc: 61256 <at> debbugs.gnu.org
Subject: Re: bug#61256: master; Function `vc-find-revision-no-save' leaks
 buffers in case of errors
Date: Sun, 05 Feb 2023 20:24:35 +0200
close 61256 29.0.60
thanks

> I haven't actually a test case for this issue but found it by
> re-indenting function `vc-find-revision-no-save'.  When doing so you
> will notice that the following sexps (indented as in the original code)
> are actually both UNWINDFORMS:
>
> 		(setq failed nil)
> 	    (when (and failed (unless buffer (get-file-buffer filename)))
> 	      (with-current-buffer (get-file-buffer filename)
> 		(set-buffer-modified-p nil))
> 	      (kill-buffer (get-file-buffer filename)))
>
> Meaning that the failure-handling `when' will never be eval'ed.  I guess
> this is a copy-and-paste error and the (setq failed nil) should be
> rather placed in the preceeding (with-current-buffer ...).
>
> Probably not a big deal but not hard to fix, either...

Good catch, thanks.  Now fixed in emacs-29.




bug marked as fixed in version 29.0.60, send any further explanations to 61256 <at> debbugs.gnu.org and "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Sun, 05 Feb 2023 18:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 06 Mar 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 51 days ago.

Previous Next


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