all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* {file} "locked by ... pid NNN", but there is no process NNN
@ 2016-01-09 16:12 djc
  2016-01-09 16:36 ` djc
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: djc @ 2016-01-09 16:12 UTC (permalink / raw)
  To: help-gnu-emacs

With a single instance of emacs running a function of my own on a file that makes no use of external activities, I get the message

    ...{file} locked by AB@CDE (pid 3964): (s, q, p, ?)?

but there is no process with PID 3964 and no other emacs running.  There *is* another buffer open on the file under a different pathname ("~/..." vs "X:\..."), though I don't know how that happened, since I dragged the file from a Windows Explorer window to visit it.

I found myself facing this message while debugging that function, which blocked or looped with high CPU usage when run in batch mode on that file or a similar one.

The message seems wrongheaded to me, but what's the best response to the problem?

GNU Emacs 24.5.1 (x86_64_mingw32) of 2015-04-12 on KAEL

djc


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: {file} "locked by ... pid NNN", but there is no process NNN
  2016-01-09 16:12 {file} "locked by ... pid NNN", but there is no process NNN djc
@ 2016-01-09 16:36 ` djc
  2016-01-09 16:55 ` Eli Zaretskii
  2016-01-19 10:40 ` djc
  2 siblings, 0 replies; 5+ messages in thread
From: djc @ 2016-01-09 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

Could it be play a part that the filename begins "$06..."?

djc


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: {file} "locked by ... pid NNN", but there is no process NNN
  2016-01-09 16:12 {file} "locked by ... pid NNN", but there is no process NNN djc
  2016-01-09 16:36 ` djc
@ 2016-01-09 16:55 ` Eli Zaretskii
  2016-01-19 10:40 ` djc
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2016-01-09 16:55 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 9 Jan 2016 08:12:05 -0800 (PST)
> From: djc <peter.kaiser@gmail.com>
> 
> With a single instance of emacs running a function of my own on a file that makes no use of external activities, I get the message
> 
>     ...{file} locked by AB@CDE (pid 3964): (s, q, p, ?)?
> 
> but there is no process with PID 3964 and no other emacs running.  There *is* another buffer open on the file under a different pathname ("~/..." vs "X:\..."), though I don't know how that happened, since I dragged the file from a Windows Explorer window to visit it.
> 
> I found myself facing this message while debugging that function, which blocked or looped with high CPU usage when run in batch mode on that file or a similar one.
> 
> The message seems wrongheaded to me, but what's the best response to the problem?

Can you give a reproducible recipe for the problem, preferably
starting from "emacs -Q"?

When I drag a file from Explorer, Emacs correctly detects that
X:\foo\bar and ~/bar are the same file, and doesn't create another
buffer for the same file.  So some other factor(s) is/are at work
here.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: {file} "locked by ... pid NNN", but there is no process NNN
  2016-01-09 16:12 {file} "locked by ... pid NNN", but there is no process NNN djc
  2016-01-09 16:36 ` djc
  2016-01-09 16:55 ` Eli Zaretskii
@ 2016-01-19 10:40 ` djc
  2016-01-19 18:01   ` Eli Zaretskii
  2 siblings, 1 reply; 5+ messages in thread
From: djc @ 2016-01-19 10:40 UTC (permalink / raw)
  To: help-gnu-emacs

The situation was too complex and too intermittent to simplify easily for diagnosis, but I think I know generally what's happening: emacs is failing to delete its own lock of a file that I was working on once, but either (1) whose buffer has been killed or (2) where the lock has survived exiting and re-opening emacs.

On Windows, emacs also doesn't necessarily release Windows handles of files and directories for which it no longer has any associated buffer.  I've seen this repeatedly.

djc


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: {file} "locked by ... pid NNN", but there is no process NNN
  2016-01-19 10:40 ` djc
@ 2016-01-19 18:01   ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2016-01-19 18:01 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 19 Jan 2016 02:40:21 -0800 (PST)
> From: djc <peter.kaiser@gmail.com>
> Injection-Date: Tue, 19 Jan 2016 10:40:22 +0000
> 
> The situation was too complex and too intermittent to simplify easily for diagnosis, but I think I know generally what's happening: emacs is failing to delete its own lock of a file that I was working on once, but either (1) whose buffer has been killed or (2) where the lock has survived exiting and re-opening emacs.

This never happens to me, except if my system crashes in the middle of
editing a file.  I have just searched my entire filesystem for
user-lock files, and found none.  This is my main development machine
where a large Emacs session runs for weeks on end, in which I edit
hundreds of files.  If something like that was happening even with a
small probability, I should have had several such files around.  But I
don't.

> On Windows, emacs also doesn't necessarily release Windows handles of files and directories for which it no longer has any associated buffer.  I've seen this repeatedly.

In what Emacs version is that, in what version of Windows, and with
what kind of filesystem (NTFS, FAT32, network)?  I have here Emacs
24.5 on XPSP3 with NTFS volumes, which in this case runs for 11 days
and 9 hours, and Process Explorer shows it holds a handle for a single
directory -- my home directory -- and none of the almost 200 files
this session visits.

Of course, if you can at least describe under which circumstances
these problems tend to happen, please do.  And please report that
using "M-x report-emacs-bug", not here.

Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-19 18:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-09 16:12 {file} "locked by ... pid NNN", but there is no process NNN djc
2016-01-09 16:36 ` djc
2016-01-09 16:55 ` Eli Zaretskii
2016-01-19 10:40 ` djc
2016-01-19 18:01   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.