GNU bug report logs - #18373
desktop-create-buffer: may call bury-buffer on a just killed buffer (?)

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Sun, 31 Aug 2014 21:32:01 UTC

Severity: minor

Tags: patch

Fixed in version 24.4

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

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 18373 in the body.
You can then email your comments to 18373 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#18373; Package emacs. (Sun, 31 Aug 2014 21:32:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Shmakov <ivan <at> siamics.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 31 Aug 2014 21:32:02 GMT) Full text and rfc822 format available.

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

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: desktop-create-buffer: may call bury-buffer on a just killed buffer
 (?) 
Date: Sun, 31 Aug 2014 21:31:41 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: minor
Tags: patch

	Currently, desktop-create-buffer calls bury-buffer on every
	buffer listed in a saved version of (buffer-list) so to restore
	the order of buffers:

  1375 	;; Restore buffer list order with new buffer at end. Don't change
  1376 	;; the order for old desktop files (old desktop module behavior).
  1377 	(unless (< desktop-file-version 206)
  1378 	  (mapc 'bury-buffer buffer-list)
  1379 	  (when result (bury-buffer result)))

	This, however, fails – should one or more of these buffers be
	killed after the list is saved but before it’s processed, – as
	happens with some (presumably temporary) buffers used by
	url-retrieve, which is in turn used while restoring EWW buffers
	per [1].  (Please note that the patch there is broken, though.)

	The patch MIMEd seems to fix the issue for me, although I’m not
	as of yet certain that no buffer can be killed in between the
	buffer-live-p check and the bury-buffer call.

[1] http://debbugs.gnu.org/18010

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
[Message part 2 (text/diff, inline)]
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1375,7 +1375,10 @@ after that many seconds of idle time."
 	;; Restore buffer list order with new buffer at end. Don't change
 	;; the order for old desktop files (old desktop module behavior).
 	(unless (< desktop-file-version 206)
-	  (mapc 'bury-buffer buffer-list)
+	  (mapc (lambda (buf)
+		  (and (buffer-live-p buf)
+		       (bury-buffer buf)))
+		buffer-list)
 	  (when result (bury-buffer result)))
 	(when result
 	  (unless (or desktop-first-buffer (< desktop-file-version 206))

Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Wed, 10 Sep 2014 00:49:01 GMT) Full text and rfc822 format available.

Notification sent to Ivan Shmakov <ivan <at> siamics.net>:
bug acknowledged by developer. (Wed, 10 Sep 2014 00:49:02 GMT) Full text and rfc822 format available.

Message #10 received at 18373-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: 18373-done <at> debbugs.gnu.org
Subject: Re: bug#18373: desktop-create-buffer: may call bury-buffer on a just
 killed buffer (?)
Date: Tue, 09 Sep 2014 20:48:36 -0400
Version:24.4

> 	This, however, fails – should one or more of these buffers be
> 	killed after the list is saved but before it’s processed, – as
> 	happens with some (presumably temporary) buffers used by
> 	url-retrieve, which is in turn used while restoring EWW buffers
> 	per [1].  (Please note that the patch there is broken, though.)
> 	The patch MIMEd seems to fix the issue for me, although I’m not
> 	as of yet certain that no buffer can be killed in between the
> 	buffer-live-p check and the bury-buffer call.

Thanks, the patch looks good and safe, so I installed it into `emacs-24'.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18373; Package emacs. (Wed, 10 Sep 2014 00:54:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: 18373 <at> debbugs.gnu.org
Subject: Re: bug#18373: desktop-create-buffer: may call bury-buffer on a just
 killed buffer (?)
Date: Tue, 09 Sep 2014 20:53:18 -0400
While this patch was sufficiently small that we could accept it as is,
if you intend to send us further patches (which I hope you do), you may
soon bump into the limit of what we can accept without paperwork.

So I think it might be worthwhile to sign the paperwork now, so that
it's out of the way.  If you agree, then please fill the form below and
send it to the FSF as instructed so they can send you the relevant
paperwork to sign.

And if I already asked you this, then please accept my apologies for
repeating myself.  I'm having a hard time keeping track of these, for
some reason (I guess I should write it down somewhere).


        Stefan


Please email the following information to assign <at> gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18373; Package emacs. (Tue, 16 Sep 2014 14:00:03 GMT) Full text and rfc822 format available.

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

From: Ivan Shmakov <ivan <at> siamics.net>
To: 18373 <at> debbugs.gnu.org
Subject: Re: bug#18373: desktop-create-buffer: may call bury-buffer on a just
 killed buffer (?)
Date: Tue, 16 Sep 2014 13:59:30 +0000
>>>>> Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

[…]

 > So I think it might be worthwhile to sign the paperwork now, so that
 > it's out of the way.  If you agree, then please fill the form below
 > and send it to the FSF as instructed so they can send you the
 > relevant paperwork to sign.

	I’ve just got confirmation that my assignment papers are
	processed (at last!)  FTR, the rt.gnu.org ticket is #874240.

[…]

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18373; Package emacs. (Wed, 24 Sep 2014 18:56:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: 18373 <at> debbugs.gnu.org
Subject: Re: bug#18373: desktop-create-buffer: may call bury-buffer on a just
 killed buffer (?)
Date: Wed, 24 Sep 2014 14:55:08 -0400
> 	I’ve just got confirmation that my assignment papers are
> 	processed (at last!)  FTR, the rt.gnu.org ticket is #874240.

OK, I see them now.  Great, thank you.
Waiting for your patches now ;-)


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Oct 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 326 days ago.

Previous Next


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