GNU bug report logs -
#43535
File locking on Windows
Previous Next
Reported by: Richard Copley <rcopley <at> gmail.com>
Date: Sun, 20 Sep 2020 15:56:02 UTC
Severity: normal
Tags: moreinfo
Done: Lars Ingebrigtsen <larsi <at> gnus.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 43535 in the body.
You can then email your comments to 43535 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sun, 20 Sep 2020 15:56:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Richard Copley <rcopley <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 20 Sep 2020 15:56:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Recipe from "emacs -Q", on Windows:
Visit a file "x.cpp". Modify the buffer and don't save.
M-! clang-format -i *.cpp RET
This has the effect of altering the contents of the lock file
".#x.cpp". Most Windows programs that accept wildcards and edit files
in place will do the same, since they don't usually skip dot files.
Now we are in a pickle:
M-x revert-buffer RET
yes RET
Error: Unlocking file: Invalid argument, c:/x.cpp
C-x k RET
yes RET
Error: Unlocking file: Invalid argument, c:/x.cpp
C-x C-c
n
yes RET
Emacs doesn't close or print an error but becomes unusable, having
apparently deleted all windows. You can still use the minibuffer.
Delete the lock file and kill Emacs:
M-! del .#x RET
C-x C-c
n
yes RET
This is quite a cruel punishment for an understandable mistake. I
assume it started happening when Paul fixed the error handling in
"filelock.c". It happens on master and Emacs 27.2, and not on Emacs
26.3.
There is more than one conceivable way to avoid this. E.g., use a
different lock file name, keep the lock file open in deny-share mode
to prevent accidents, ignore certain errors while unlocking. In fact
I'd like to have an option to permanently disable creating lock files.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sun, 20 Sep 2020 16:04:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 43535 <at> debbugs.gnu.org (full text, mbox):
> From: Richard Copley <rcopley <at> gmail.com>
> Date: Sun, 20 Sep 2020 16:54:56 +0100
>
> I'd like to have an option to permanently disable creating lock files.
I think you should be able to do that by customizing the variable
create-lockfiles.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sun, 20 Sep 2020 16:15:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 43535 <at> debbugs.gnu.org (full text, mbox):
> From: Richard Copley <rcopley <at> gmail.com>
> Date: Sun, 20 Sep 2020 16:54:56 +0100
>
> This is quite a cruel punishment for an understandable mistake. I
> assume it started happening when Paul fixed the error handling in
> "filelock.c". It happens on master and Emacs 27.2, and not on Emacs
> 26.3.
>
> There is more than one conceivable way to avoid this. E.g., use a
> different lock file name, keep the lock file open in deny-share mode
> to prevent accidents, ignore certain errors while unlocking.
I think ignoring errors, perhaps after asking for confirmation, is the
only way. Using a different file name will just move the problem
elsewhere, and keeping the file open will disallow stealing the lock,
and on MS-Windows will have other annoying effects (like keeping the
file's directory busy etc.).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sun, 20 Sep 2020 17:34:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 43535 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
> > I'd like to have an option to permanently disable creating lock files.
> I think you should be able to do that by customizing the variable
> create-lockfiles.
Thanks.
> I think ignoring errors, perhaps after asking for confirmation, is the
> only way. Using a different file name will just move the problem
> elsewhere, and keeping the file open will disallow stealing the lock,
> and on MS-Windows will have other annoying effects (like keeping the
> file's directory busy etc.).
Right.
Parse failure in "current_lock_owner" isn't handled well. You can
force the same issues to occur on a non-Windows system by deleting the
".#x" symlink and recreating it with a bad target.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sat, 31 Jul 2021 13:06:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 43535 <at> debbugs.gnu.org (full text, mbox):
Richard Copley <rcopley <at> gmail.com> writes:
> Parse failure in "current_lock_owner" isn't handled well. You can
> force the same issues to occur on a non-Windows system by deleting the
> ".#x" symlink and recreating it with a bad target.
I tried reproducing this in Debian:
cd tmp
touch foo
ln -s noexist .#foo
and then editing and saving /tmp/foo:
Warning (unlock-file): Unlocking file: Invalid argument, /tmp/foo, ignored
So a warning pops up here... which I think is reasonable?
Do you see something different?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 31 Jul 2021 13:06:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sat, 31 Jul 2021 13:37:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 43535 <at> debbugs.gnu.org (full text, mbox):
Lars wrote:
> Do you see something different?
No. Looks like this was fixed collateral to
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46397>.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sat, 31 Jul 2021 14:16:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 43535 <at> debbugs.gnu.org (full text, mbox):
Richard Copley <rcopley <at> gmail.com> writes:
>> Do you see something different?
>
> No. Looks like this was fixed collateral to
> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46397>.
OK; good. But does this mean that the reported bug on Windows is also
gone?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43535
; Package
emacs
.
(Sun, 29 Aug 2021 20:18:03 GMT)
Full text and
rfc822 format available.
Message #28 received at 43535 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Richard Copley <rcopley <at> gmail.com> writes:
>
>>> Do you see something different?
>>
>> No. Looks like this was fixed collateral to
>> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46397>.
>
> OK; good. But does this mean that the reported bug on Windows is also
> gone?
More information was requested, but no response was given within a
month, so I'm closing this bug report. If the problem still exists,
please respond to this email and we'll reopen the bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug closed, send any further explanations to
43535 <at> debbugs.gnu.org and Richard Copley <rcopley <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 29 Aug 2021 20:19:02 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
.
(Mon, 27 Sep 2021 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 211 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.