From unknown Mon Jun 23 06:02:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16157: 24.3.50; desktop-read doesn't claim the unused lock Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2013 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16157 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16157@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13871443669009 (code B ref -1); Sun, 15 Dec 2013 21:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Dec 2013 21:52:46 +0000 Received: from localhost ([127.0.0.1]:52188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VsJcE-0002LE-IG for submit@debbugs.gnu.org; Sun, 15 Dec 2013 16:52:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41471) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VsJcC-0002L3-3V for submit@debbugs.gnu.org; Sun, 15 Dec 2013 16:52:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsJc3-0002nk-DQ for submit@debbugs.gnu.org; Sun, 15 Dec 2013 16:52:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsJc3-0002ng-Aw for submit@debbugs.gnu.org; Sun, 15 Dec 2013 16:52:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsJbx-0005Lg-B1 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2013 16:52:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsJbr-0002kO-Al for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2013 16:52:29 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:37491 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsJbr-0002kD-5B for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2013 16:52:23 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A08CE258B9E937 for ; Sun, 15 Dec 2013 13:52:21 -0800 (PST) From: Juri Linkov Organization: JURTA Date: Sun, 15 Dec 2013 23:49:53 +0200 Message-ID: <878uvlhji6.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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? From unknown Mon Jun 23 06:02:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16157: 24.3.50; desktop-read doesn't claim the unused lock Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Feb 2014 07:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16157 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16157@debbugs.gnu.org Received: via spool by 16157-submit@debbugs.gnu.org id=B16157.13915006739657 (code B ref 16157); Tue, 04 Feb 2014 07:58:02 +0000 Received: (at 16157) by debbugs.gnu.org; 4 Feb 2014 07:57:53 +0000 Received: from localhost ([127.0.0.1]:48710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAatE-0002Vb-3C for submit@debbugs.gnu.org; Tue, 04 Feb 2014 02:57:52 -0500 Received: from [69.163.184.122] (port=39327 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAatB-0002VL-03 for 16157@debbugs.gnu.org; Tue, 04 Feb 2014 02:57:49 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 45CF4374150C5E for <16157@debbugs.gnu.org>; Mon, 3 Feb 2014 23:57:50 -0800 (PST) From: Juri Linkov Organization: JURTA References: <878uvlhji6.fsf@mail.jurta.org> Date: Tue, 04 Feb 2014 09:54:58 +0200 In-Reply-To: <878uvlhji6.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 15 Dec 2013 23:49:53 +0200") Message-ID: <87zjm7uxbh.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > 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? [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > 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? [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS > 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") From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 07 03:01:18 2014 Received: (at control) by debbugs.gnu.org; 7 Feb 2014 08:01:19 +0000 Received: from localhost ([127.0.0.1]:54214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBgNC-0006Wg-9J for submit@debbugs.gnu.org; Fri, 07 Feb 2014 03:01:18 -0500 Received: from [69.163.184.122] (port=58631 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBgNA-0006WV-3B for control@debbugs.gnu.org; Fri, 07 Feb 2014 03:01:16 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A14323009899EB for ; Fri, 7 Feb 2014 00:01:14 -0800 (PST) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#16157: 24.3.50; desktop-read doesn't claim the unused lock Organization: JURTA References: <878uvlhji6.fsf@mail.jurta.org> <87zjm7uxbh.fsf@mail.jurta.org> Date: Fri, 07 Feb 2014 10:01:01 +0200 In-Reply-To: <87zjm7uxbh.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 04 Feb 2014 09:54:58 +0200") Message-ID: <87ha8bwdvm.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 16157 stop [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 16157 stop [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS close 16157 stop