GNU bug report logs - #16157
24.3.50; desktop-read doesn't claim the unused lock

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sun, 15 Dec 2013 21:53:01 UTC

Severity: normal

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

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 16157 in the body.
You can then email your comments to 16157 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#16157; Package emacs. (Sun, 15 Dec 2013 21:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 15 Dec 2013 21:53:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; desktop-read doesn't claim the unused lock
Date: Sun, 15 Dec 2013 23:49:53 +0200
When the previous session crashes or freezes, and .emacs.desktop.lock
contains the PID of the previous process, then `desktop-read' asks

  Warning: desktop file appears to be in use by PID...
  Using it may cause conflicts.  Use it anyway? (y or n)  y

But answering `y' doesn't claim the ownership of the lock,
desktop-owner is still an old nonexistent process, and thus
auto-saving doesn't save the desktop.

Maybe `desktop-read' should call `desktop-claim-lock' in this case?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16157; Package emacs. (Tue, 04 Feb 2014 07:58:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: 16157 <at> debbugs.gnu.org
Subject: Re: bug#16157: 24.3.50; desktop-read doesn't claim the unused lock
Date: Tue, 04 Feb 2014 09:54:58 +0200
> When the previous session crashes or freezes, and .emacs.desktop.lock
> contains the PID of the previous process, then `desktop-read' asks
>
>   Warning: desktop file appears to be in use by PID...
>   Using it may cause conflicts.  Use it anyway? (y or n)  y
>
> But answering `y' doesn't claim the ownership of the lock,
> desktop-owner is still an old nonexistent process, and thus
> auto-saving doesn't save the desktop.
>
> Maybe `desktop-read' should call `desktop-claim-lock' in this case?

I guess the right thing to do here is what its comment suggests to do:
"mark it as in-use, to bother other desktop instances".  Actually it
shouldn't bother other desktop instances when other instances crashed.

=== modified file 'lisp/desktop.el'
--- lisp/desktop.el	2014-01-01 07:43:34 +0000
+++ lisp/desktop.el	2014-02-04 07:53:37 +0000
@@ -1103,9 +1106,12 @@ (defun desktop-read (&optional dirname)
 	    ;; Evaluate desktop buffer and remember when it was modified.
 	    (load (desktop-full-file-name) t t t)
 	    (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name))))
-	    ;; If it wasn't already, mark it as in-use, to bother other
+	    ;; If it wasn't already owned, mark it as in-use, to bother other
 	    ;; desktop instances.
-	    (unless owner
+	    (unless (eq (emacs-pid) owner)
 	      (condition-case nil
 		  (desktop-claim-lock)
 		(file-error (message "Couldn't record use of desktop file")




bug closed, send any further explanations to 16157 <at> debbugs.gnu.org and Juri Linkov <juri <at> jurta.org> Request was from Juri Linkov <juri <at> jurta.org> to control <at> debbugs.gnu.org. (Fri, 07 Feb 2014 08:02:06 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. (Fri, 07 Mar 2014 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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