From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30421: 25.3; desktop.el: Steal lock when no living "emacs" process owns it Date: Sun, 11 Feb 2018 17:50:02 +0200 Message-ID: <83mv0f1q6t.fsf@gnu.org> References: <871shram2i.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1518364186 20303 195.159.176.226 (11 Feb 2018 15:49:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Feb 2018 15:49:46 +0000 (UTC) Cc: 30421@debbugs.gnu.org To: Pierre Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 11 16:49:41 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ektsP-0003G4-5g for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 16:49:13 +0100 Original-Received: from localhost ([::1]:52694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ektuP-0006eG-8Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 10:51:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ektuF-0006cZ-1e for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 10:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ektuA-0005lG-5j for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 10:51:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ektuA-0005kt-1g for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 10:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ektu9-0002Aa-P7 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 10:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2018 15:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30421 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30421-submit@debbugs.gnu.org id=B30421.15183642288301 (code B ref 30421); Sun, 11 Feb 2018 15:51:01 +0000 Original-Received: (at 30421) by debbugs.gnu.org; 11 Feb 2018 15:50:28 +0000 Original-Received: from localhost ([127.0.0.1]:38486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekttb-00029p-VU for submit@debbugs.gnu.org; Sun, 11 Feb 2018 10:50:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ektta-00029d-OS for 30421@debbugs.gnu.org; Sun, 11 Feb 2018 10:50:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekttQ-000506-HJ for 30421@debbugs.gnu.org; Sun, 11 Feb 2018 10:50:21 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekttQ-0004zj-Ci; Sun, 11 Feb 2018 10:50:16 -0500 Original-Received: from [176.228.60.248] (port=4985 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ekttP-0008Bp-R6; Sun, 11 Feb 2018 10:50:16 -0500 In-reply-to: <871shram2i.fsf@gmail.com> (message from Pierre Neidhardt on Sun, 11 Feb 2018 10:54:13 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143139 Archived-At: > From: Pierre Neidhardt > Date: Sun, 11 Feb 2018 10:54:13 +0100 > > > By default, desktop-save-mode will not save (and will set > desktop-dirname to nil) if a lock file exists with a PID in it. > > It's problematic however when Emacs gets killed and does not release the > lock. Upon next start, desktop-save-mode will refuse to save because > the lock exists, even though no process is using it. In terms of user > experience, it's pretty bad considering the error feedback is just one > line in the *Messages* buffer (I almost never notice it when it happens) > and the problem is persistent across reboots (the lock file will remain > as long as the user does not remove it manually). When this happens to me, the next time I start Emacs, I'm asked whether to use the desktop file that appears to be locked, and if I answer YES, desktop.el goes on to restore the session, no other questions asked, and saves the desktop upon exit with no problems. I'm confused as to why you see something different. Could it be that your activation of desktop-save-mode is somehow different from mine? > Furthermore, isn't it strange to just check if there lock file contains > a number and not actually check if it's an existing PID? You are assuming that the locking process runs on the same machine, but that is not guaranteed. The directory where the desktop file lives could be mounted via the network, I think.