GNU bug report logs - #70415
30.0.50; [Cygwin] `lock-file' creates a symlink with funny name

Previous Next

Package: emacs;

Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>

Date: Tue, 16 Apr 2024 12:34:04 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 70415 AT debbugs.gnu.org.

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#70415; Package emacs. (Tue, 16 Apr 2024 12:34:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Katsumi Yamaoka <yamaoka <at> jpl.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 16 Apr 2024 12:34:05 GMT) Full text and rfc822 format available.

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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [Cygwin] `lock-file' creates a symlink with funny name
Date: Tue, 16 Apr 2024 21:33:07 +0900
Hi,

As you know, Emacs creates a lock file when start editing a FILE
by default, it is a symbolic link that is linked to a name
looking like this:

.#FILE -> username <at> hostname.1234

Where 1234 is Emacs' pid.  It will be removed after saving
the FILE.  Even if the lock file is left, Emacs will remove it
when opening the FILE for the next time.  However, recently lock
files no longer got deleted on at least the latest Cygwin on
Windows 11.  It is (probably) because Emacs came to create lock
files with a funny name like this:

.#FILE -> username <at> hostname.1234:-11644473599

For that case `(unlock-file "FILE")' issues this warning:

Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored

I don't know what ":-11644473599" is, but I did the bisection
and found that it started with this change:

,----
| commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
| Author: Adam Porter <adam <at> alphapapa.net>
| Date:   Fri Mar 8 23:43:14 2024 -0600
|
|     'vtable-update-object' can now be called with one argument
|
|     It's often necessary to update the representation of a single
|     object in a table (e.g a struct, whose identity does not change
|     when its slots'
|     values are changed).  To do so, now the function may be called
|     like this:
|
|       (vtable-update-object table object)
|
|     Instead of like this:
|
|       (vtable-update-object table object object)
|
|     This also documents the behavior of the just-discovered limitation filed
|     as bug#69837.
|     * lisp/emacs-lisp/vtable.el (vtable-update-object): Make 'old-object'
|     argument optional.  (Bug#69666)
|
|     * doc/misc/vtable.texi (Interface Functions): Update documentation.
|
|     * etc/NEWS: Add news entry.
|
| commit 689f04a2ddfae856153bed762cc1461d66ec88de
| [...]
`----

Though it doesn't seem helpful since `git diff 689f04a..393f58c'
reports a huge amount of diff.  Hmm.

Thanks in advance.
Regards,


In GNU Emacs 30.0.50 (build 1, x86_64-pc-cygwin, GTK+ Version
 3.24.41, cairo version 1.17.4) of 2024-04-15 built on localhost
Windowing system distributor 'The Cygwin/X Project', version 11.0.12101012




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 16 Apr 2024 13:33:04 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50;
 [Cygwin] `lock-file' creates a symlink with funny name
Date: Tue, 16 Apr 2024 16:32:17 +0300
> Date: Tue, 16 Apr 2024 21:33:07 +0900
> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
> 
> As you know, Emacs creates a lock file when start editing a FILE
> by default, it is a symbolic link that is linked to a name
> looking like this:
> 
> .#FILE -> username <at> hostname.1234
> 
> Where 1234 is Emacs' pid.  It will be removed after saving
> the FILE.  Even if the lock file is left, Emacs will remove it
> when opening the FILE for the next time.  However, recently lock
> files no longer got deleted on at least the latest Cygwin on
> Windows 11.  It is (probably) because Emacs came to create lock
> files with a funny name like this:
> 
> .#FILE -> username <at> hostname.1234:-11644473599
> 
> For that case `(unlock-file "FILE")' issues this warning:
> 
> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored

Does Cygwin support file names with a colon, such as the above?

The part after the colon is the system boot time, and is used on all
Posix hosts.  I don't know why it prints as a negative value on
Cygwin, but the question is: does Cygwin support such file names?  If
not, what are the restrictions on Cygwin file names that we need to
observe when we create lock files?  This is likely a question for the
Cygwin mailing list, or maybe you already know the answer.

Several internal functions in filelock.c know about the
USER <at> HOST.PID:BOOT_TIME format of the lock file names, so if there are
any Cygwin-specific restrictions, they will all need to be patched
accordingly.

> I don't know what ":-11644473599" is, but I did the bisection
> and found that it started with this change:
> 
> ,----
> | commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
> | Author: Adam Porter <adam <at> alphapapa.net>
> | Date:   Fri Mar 8 23:43:14 2024 -0600
> |
> |     'vtable-update-object' can now be called with one argument

This is extremely unlikely to have caused the problem.  It is more
likely that some change in Cygwin and/or in the Gnulib's boot-time
module causes this now.

Also, do you see this in "emacs -Q"?  If not, perhaps some local
customizations cause this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 16 Apr 2024 18:03:03 GMT) Full text and rfc822 format available.

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

From: Pierre Téchoueyres <pierre.techoueyres <at> free.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Katsumi Yamaoka <yamaoka <at> jpl.org>, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 16 Apr 2024 20:01:56 +0200
Le mardi 16 avril 2024 à 16:32, Eli Zaretskii <eliz <at> gnu.org> a écrit :

>> Date: Tue, 16 Apr 2024 21:33:07 +0900
>> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
>> 
>> As you know, Emacs creates a lock file when start editing a FILE
>> by default, it is a symbolic link that is linked to a name
>> looking like this:
>> 
>> .#FILE -> username <at> hostname.1234
>> 
>> Where 1234 is Emacs' pid.  It will be removed after saving
>> the FILE.  Even if the lock file is left, Emacs will remove it
>> when opening the FILE for the next time.  However, recently lock
>> files no longer got deleted on at least the latest Cygwin on
>> Windows 11.  It is (probably) because Emacs came to create lock
>> files with a funny name like this:
>> 
>> .#FILE -> username <at> hostname.1234:-11644473599
>> 
>> For that case `(unlock-file "FILE")' issues this warning:
>> 
>> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
>
> Does Cygwin support file names with a colon, such as the above?
>
> The part after the colon is the system boot time, and is used on all
> Posix hosts.  I don't know why it prints as a negative value on
> Cygwin, but the question is: does Cygwin support such file names?  If
> not, what are the restrictions on Cygwin file names that we need to
> observe when we create lock files?  This is likely a question for the
> Cygwin mailing list, or maybe you already know the answer.
>
> Several internal functions in filelock.c know about the
> USER <at> HOST.PID:BOOT_TIME format of the lock file names, so if there are
> any Cygwin-specific restrictions, they will all need to be patched
> accordingly.
>

May be this has something to do with NTFS Streams ?
See : https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/c54dec26-1551-4d3a-a0ea-4fa40f848eb3

Disregard if not relevant.

>> I don't know what ":-11644473599" is, but I did the bisection
>> and found that it started with this change:
>> 
>> ,----
>> | commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
>> | Author: Adam Porter <adam <at> alphapapa.net>
>> | Date:   Fri Mar 8 23:43:14 2024 -0600
>> |
>> |     'vtable-update-object' can now be called with one argument
>
> This is extremely unlikely to have caused the problem.  It is more
> likely that some change in Cygwin and/or in the Gnulib's boot-time
> module causes this now.
>
> Also, do you see this in "emacs -Q"?  If not, perhaps some local
> customizations cause this?
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 16 Apr 2024 22:58:03 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 16 Apr 2024 18:57:21 -0400
On 4/16/2024 9:32 AM, Eli Zaretskii wrote:
>> Date: Tue, 16 Apr 2024 21:33:07 +0900
>> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
>>
>> As you know, Emacs creates a lock file when start editing a FILE
>> by default, it is a symbolic link that is linked to a name
>> looking like this:
>>
>> .#FILE -> username <at> hostname.1234
>>
>> Where 1234 is Emacs' pid.  It will be removed after saving
>> the FILE.  Even if the lock file is left, Emacs will remove it
>> when opening the FILE for the next time.  However, recently lock
>> files no longer got deleted on at least the latest Cygwin on
>> Windows 11.  It is (probably) because Emacs came to create lock
>> files with a funny name like this:
>>
>> .#FILE -> username <at> hostname.1234:-11644473599
>>
>> For that case `(unlock-file "FILE")' issues this warning:
>>
>> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
> 
> Does Cygwin support file names with a colon, such as the above?

I'm traveling at the moment, and it will be a while until I have a 
chance to look at this report closely or try to reproduce it.  But I can 
answer your question: Cygwin does support file names with a colon.  This 
is documented at

  https://cygwin.com/cygwin-ug-net/using-specialnames.html

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Wed, 17 Apr 2024 00:00:04 GMT) Full text and rfc822 format available.

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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Wed, 17 Apr 2024 08:58:42 +0900
On Tue, 16 Apr 2024 16:32:17 +0300, Eli Zaretskii wrote:
>> .#FILE -> username <at> hostname.1234:-11644473599
>> For that case `(unlock-file "FILE")' issues this warning:
>> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored

> The part after the colon is the system boot time, and is used on all
> Posix hosts.

Oh, I had never seen it until recently.  Thanks.

[...]

>>| commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
>>| Author: Adam Porter <adam <at> alphapapa.net>
>>| Date:   Fri Mar 8 23:43:14 2024 -0600

> This is extremely unlikely to have caused the problem.  It is more
> likely that some change in Cygwin and/or in the Gnulib's boot-time
> module causes this now.

Indeed.  But the fact is that Emacs built with that revno adds
a colon and a negative number to a link name and the one built
with just before it does not.  No problem on 29.3.50 and earlier,
either (i.e., not add a colon and numbers).

> Also, do you see this in "emacs -Q"?  If not, perhaps some local
> customizations cause this?

Yes, I use -Q for the test.

;; I need to alter the default value of `create-lockfiles' in
;; src/filelock.c to build Emacs from git master nowadays.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Wed, 17 Apr 2024 12:09:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Wed, 17 Apr 2024 15:08:18 +0300
> Date: Tue, 16 Apr 2024 18:57:21 -0400
> Cc: 70415 <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> On 4/16/2024 9:32 AM, Eli Zaretskii wrote:
> >> Date: Tue, 16 Apr 2024 21:33:07 +0900
> >> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
> >>
> >> As you know, Emacs creates a lock file when start editing a FILE
> >> by default, it is a symbolic link that is linked to a name
> >> looking like this:
> >>
> >> .#FILE -> username <at> hostname.1234
> >>
> >> Where 1234 is Emacs' pid.  It will be removed after saving
> >> the FILE.  Even if the lock file is left, Emacs will remove it
> >> when opening the FILE for the next time.  However, recently lock
> >> files no longer got deleted on at least the latest Cygwin on
> >> Windows 11.  It is (probably) because Emacs came to create lock
> >> files with a funny name like this:
> >>
> >> .#FILE -> username <at> hostname.1234:-11644473599
> >>
> >> For that case `(unlock-file "FILE")' issues this warning:
> >>
> >> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
> > 
> > Does Cygwin support file names with a colon, such as the above?
> 
> I'm traveling at the moment, and it will be a while until I have a 
> chance to look at this report closely or try to reproduce it.  But I can 
> answer your question: Cygwin does support file names with a colon.  This 
> is documented at
> 
>    https://cygwin.com/cygwin-ug-net/using-specialnames.html

That's what I thought.  But in that case, someone will have to step
through the code in filelock.c and tell why removing these lock files
fails in the Cygwin build of Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Wed, 17 Apr 2024 12:22:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Wed, 17 Apr 2024 15:21:18 +0300
> Date: Wed, 17 Apr 2024 08:58:42 +0900
> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
> Cc: 70415 <at> debbugs.gnu.org
> 
> On Tue, 16 Apr 2024 16:32:17 +0300, Eli Zaretskii wrote:
> >> .#FILE -> username <at> hostname.1234:-11644473599
> >> For that case `(unlock-file "FILE")' issues this warning:
> >> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
> 
> > The part after the colon is the system boot time, and is used on all
> > Posix hosts.
> 
> Oh, I had never seen it until recently.  Thanks.

The question is: why it started appearing only recently?  The code in
filelock.c hasn't changed since last December, if not earlier, so if
this started happening recently, it could only be because Gnulib's
get_boot_time or its Cygwin implementation changed, such that it was
previously returning zero whereas now it returns non-zero (which
triggers the addition of the ":BOOT_TIME" part to the file name).

> >>| commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
> >>| Author: Adam Porter <adam <at> alphapapa.net>
> >>| Date:   Fri Mar 8 23:43:14 2024 -0600
> 
> > This is extremely unlikely to have caused the problem.  It is more
> > likely that some change in Cygwin and/or in the Gnulib's boot-time
> > module causes this now.
> 
> Indeed.  But the fact is that Emacs built with that revno adds
> a colon and a negative number to a link name and the one built
> with just before it does not.  No problem on 29.3.50 and earlier,
> either (i.e., not add a colon and numbers).

Then please step with a debugger through the relevant code in
filelock.c, before and after that change, and see why they are
different.  I cannot explain that, even after doing "git log -L" on
all of filelock.c: the most recent change of the related code was in
Aug 2023, AFAICT, which is a very far cry from Mar 2024.

And even if we understand why you now get the ":BOOT_TIME" part,
there's still the question why it cannot be unlinked, if Cygwin
supports file names with a colon.  Maybe it's because Emacs creates a
symlink, and symlinks with such names are not supported by Cygwin?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Mon, 22 Apr 2024 16:17:01 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Mon, 22 Apr 2024 12:15:42 -0400
On 4/17/2024 8:21 AM, Eli Zaretskii wrote:
>> Date: Wed, 17 Apr 2024 08:58:42 +0900
>> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
>> Cc: 70415 <at> debbugs.gnu.org
>>
>> On Tue, 16 Apr 2024 16:32:17 +0300, Eli Zaretskii wrote:
>>>> .#FILE -> username <at> hostname.1234:-11644473599
>>>> For that case `(unlock-file "FILE")' issues this warning:
>>>> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
>>
>>> The part after the colon is the system boot time, and is used on all
>>> Posix hosts.
>>
>> Oh, I had never seen it until recently.  Thanks.
> 
> The question is: why it started appearing only recently?  The code in
> filelock.c hasn't changed since last December, if not earlier, so if
> this started happening recently, it could only be because Gnulib's
> get_boot_time or its Cygwin implementation changed, such that it was
> previously returning zero whereas now it returns non-zero (which
> triggers the addition of the ":BOOT_TIME" part to the file name).
> 
>>>> | commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
>>>> | Author: Adam Porter <adam <at> alphapapa.net>
>>>> | Date:   Fri Mar 8 23:43:14 2024 -0600
>>
>>> This is extremely unlikely to have caused the problem.  It is more
>>> likely that some change in Cygwin and/or in the Gnulib's boot-time
>>> module causes this now.
>>
>> Indeed.  But the fact is that Emacs built with that revno adds
>> a colon and a negative number to a link name and the one built
>> with just before it does not.  No problem on 29.3.50 and earlier,
>> either (i.e., not add a colon and numbers).
> 
> Then please step with a debugger through the relevant code in
> filelock.c, before and after that change, and see why they are
> different.  I cannot explain that, even after doing "git log -L" on
> all of filelock.c: the most recent change of the related code was in
> Aug 2023, AFAICT, which is a very far cry from Mar 2024.
> 
> And even if we understand why you now get the ":BOOT_TIME" part,
> there's still the question why it cannot be unlinked, if Cygwin
> supports file names with a colon.  Maybe it's because Emacs creates a
> symlink, and symlinks with such names are not supported by Cygwin?

I'm still traveling for another week and won't have time to try to 
reproduce and debug this until I return.  But I did do one quick test in 
a Cygwin shell.  I created a symlink

  .#FILE -> username <at> hostname.1234:-11644473599

and deleted it with rm.  So symlinks like this are indeed supported by 
Cygwin.

To be continued...

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Mon, 29 Apr 2024 23:07:01 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Mon, 29 Apr 2024 19:05:35 -0400
On 4/22/2024 12:15 PM, Ken Brown wrote:
> On 4/17/2024 8:21 AM, Eli Zaretskii wrote:
>>> Date: Wed, 17 Apr 2024 08:58:42 +0900
>>> From: Katsumi Yamaoka <yamaoka <at> jpl.org>
>>> Cc: 70415 <at> debbugs.gnu.org
>>>
>>> On Tue, 16 Apr 2024 16:32:17 +0300, Eli Zaretskii wrote:
>>>>> .#FILE -> username <at> hostname.1234:-11644473599
>>>>> For that case `(unlock-file "FILE")' issues this warning:
>>>>> Warning (unlock-file): Unlocking file: Invalid argument, FILE, ignored
>>>
>>>> The part after the colon is the system boot time, and is used on all
>>>> Posix hosts.
>>>
>>> Oh, I had never seen it until recently.  Thanks.
>>
>> The question is: why it started appearing only recently?  The code in
>> filelock.c hasn't changed since last December, if not earlier, so if
>> this started happening recently, it could only be because Gnulib's
>> get_boot_time or its Cygwin implementation changed, such that it was
>> previously returning zero whereas now it returns non-zero (which
>> triggers the addition of the ":BOOT_TIME" part to the file name).
>>
>>>>> | commit 393f58c85aeb78f814866ccaad9ae7efd3fa6766
>>>>> | Author: Adam Porter <adam <at> alphapapa.net>
>>>>> | Date:   Fri Mar 8 23:43:14 2024 -0600
>>>
>>>> This is extremely unlikely to have caused the problem.  It is more
>>>> likely that some change in Cygwin and/or in the Gnulib's boot-time
>>>> module causes this now.
>>>
>>> Indeed.  But the fact is that Emacs built with that revno adds
>>> a colon and a negative number to a link name and the one built
>>> with just before it does not.  No problem on 29.3.50 and earlier,
>>> either (i.e., not add a colon and numbers).
>>
>> Then please step with a debugger through the relevant code in
>> filelock.c, before and after that change, and see why they are
>> different.  I cannot explain that, even after doing "git log -L" on
>> all of filelock.c: the most recent change of the related code was in
>> Aug 2023, AFAICT, which is a very far cry from Mar 2024.
>>
>> And even if we understand why you now get the ":BOOT_TIME" part,
>> there's still the question why it cannot be unlinked, if Cygwin
>> supports file names with a colon.  Maybe it's because Emacs creates a
>> symlink, and symlinks with such names are not supported by Cygwin?
> 
> I'm still traveling for another week and won't have time to try to 
> reproduce and debug this until I return.  But I did do one quick test in 
> a Cygwin shell.  I created a symlink
> 
>    .#FILE -> username <at> hostname.1234:-11644473599
> 
> and deleted it with rm.  So symlinks like this are indeed supported by 
> Cygwin.
> 
> To be continued...

I finally had a chance to look at this, and I can't reproduce the 
problem.  The autosave file does not have the ":BOOT_TIME" part, and it 
gets deleted properly when the file is saved.  I'm running the latest 
stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build 
22631.3447).

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 30 Apr 2024 02:36:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 30 Apr 2024 05:34:25 +0300
> Date: Mon, 29 Apr 2024 19:05:35 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> Cc: 70415 <at> debbugs.gnu.org
> 
> I finally had a chance to look at this, and I can't reproduce the 
> problem.  The autosave file does not have the ":BOOT_TIME" part, and it 
> gets deleted properly when the file is saved.  I'm running the latest 
> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build 
> 22631.3447).

This is not about autosave files, this is about lock files.  Those are
created once you modify a file-visiting buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 30 Apr 2024 06:47:01 GMT) Full text and rfc822 format available.

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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 30 Apr 2024 15:45:32 +0900
On Tue, 30 Apr 2024 05:34:25 +0300, Eli Zaretskii wrote:
>> Date: Mon, 29 Apr 2024 19:05:35 -0400
>> From: Ken Brown <kbrown <at> cornell.edu>
>> Cc: 70415 <at> debbugs.gnu.org

>> I finally had a chance to look at this, and I can't reproduce the 
>> problem.  The autosave file does not have the ":BOOT_TIME" part, and it 
>> gets deleted properly when the file is saved.  I'm running the latest 
>> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build 
>> 22631.3447).

> This is not about autosave files, this is about lock files.  Those are
> created once you modify a file-visiting buffer.

Thank you for following this up.  I also found another PC in which
Emacs that was built there has no problem (i.e., the boot-time
part does not appear in a lock file symlink name).
Both that PC [B] and the PC I normally use [A] run the latest Cygwin
3.5.3-1 on Windows 11 23H2.  Though I haven't found out the cause
of [A] yet, I should check the differences between them one by one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 30 Apr 2024 15:24:01 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 30 Apr 2024 11:23:21 -0400
On 4/29/2024 10:34 PM, Eli Zaretskii wrote:
>> Date: Mon, 29 Apr 2024 19:05:35 -0400
>> From: Ken Brown <kbrown <at> cornell.edu>
>> Cc: 70415 <at> debbugs.gnu.org
>>
>> I finally had a chance to look at this, and I can't reproduce the
>> problem.  The autosave file does not have the ":BOOT_TIME" part, and it
>> gets deleted properly when the file is saved.  I'm running the latest
>> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build
>> 22631.3447).
> 
> This is not about autosave files, this is about lock files.  Those are
> created once you modify a file-visiting buffer.

Sorry, I didn't write what I meant.  I meant to refer to the lock file.

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Tue, 30 Apr 2024 16:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Tue, 30 Apr 2024 19:20:40 +0300
> Date: Tue, 30 Apr 2024 11:23:21 -0400
> Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> On 4/29/2024 10:34 PM, Eli Zaretskii wrote:
> >> Date: Mon, 29 Apr 2024 19:05:35 -0400
> >> From: Ken Brown <kbrown <at> cornell.edu>
> >> Cc: 70415 <at> debbugs.gnu.org
> >>
> >> I finally had a chance to look at this, and I can't reproduce the
> >> problem.  The autosave file does not have the ":BOOT_TIME" part, and it
> >> gets deleted properly when the file is saved.  I'm running the latest
> >> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build
> >> 22631.3447).
> > 
> > This is not about autosave files, this is about lock files.  Those are
> > created once you modify a file-visiting buffer.
> 
> Sorry, I didn't write what I meant.  I meant to refer to the lock file.

OK.  So it sounds like on some Cygwin systems this call in filelock.c:

  static int
  lock_file_1 (Lisp_Object lfname, bool force)
  {
    intmax_t boot = get_boot_sec ();

yields a non-zero (and negative!) value of 'boot', and on other Cygwin
systems it yields zero.  Because that's how Emacs decides whether to
append that ":-NNNN" part:

    char const *lock_info_fmt = (boot
				 ? "%s@%s.%"PRIdMAX":%"PRIdMAX
				 : "%s@%s.%"PRIdMAX);
    int len = snprintf (lock_info_str, sizeof lock_info_str,
			lock_info_fmt, user_name, host_name, pid, boot);

get_boot_sec calls get_boot_time, which is a Gnulib function (see
lib/boot-time.c).  So I guess the key to unlock this puzzle is
somewhere there.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Wed, 01 May 2024 21:22:02 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Wed, 1 May 2024 17:20:20 -0400
On 4/30/2024 12:20 PM, Eli Zaretskii wrote:
>> Date: Tue, 30 Apr 2024 11:23:21 -0400
>> Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
>> From: Ken Brown <kbrown <at> cornell.edu>
>>
>> On 4/29/2024 10:34 PM, Eli Zaretskii wrote:
>>>> Date: Mon, 29 Apr 2024 19:05:35 -0400
>>>> From: Ken Brown <kbrown <at> cornell.edu>
>>>> Cc: 70415 <at> debbugs.gnu.org
>>>>
>>>> I finally had a chance to look at this, and I can't reproduce the
>>>> problem.  The autosave file does not have the ":BOOT_TIME" part, and it
>>>> gets deleted properly when the file is saved.  I'm running the latest
>>>> stable release of Cygwin (3.5.3) on Windows 11 (version 23H2, build
>>>> 22631.3447).
>>>
>>> This is not about autosave files, this is about lock files.  Those are
>>> created once you modify a file-visiting buffer.
>>
>> Sorry, I didn't write what I meant.  I meant to refer to the lock file.
> 
> OK.  So it sounds like on some Cygwin systems this call in filelock.c:
> 
>    static int
>    lock_file_1 (Lisp_Object lfname, bool force)
>    {
>      intmax_t boot = get_boot_sec ();
> 
> yields a non-zero (and negative!) value of 'boot', and on other Cygwin
> systems it yields zero.  Because that's how Emacs decides whether to
> append that ":-NNNN" part:
> 
>      char const *lock_info_fmt = (boot
> 				 ? "%s@%s.%"PRIdMAX":%"PRIdMAX
> 				 : "%s@%s.%"PRIdMAX);
>      int len = snprintf (lock_info_str, sizeof lock_info_str,
> 			lock_info_fmt, user_name, host_name, pid, boot);
> 
> get_boot_sec calls get_boot_time, which is a Gnulib function (see
> lib/boot-time.c).  So I guess the key to unlock this puzzle is
> somewhere there.

I took a quick look at get_boot_time and found a bug, which may explain 
why some Cygwin systems behave differently from others.  I've reported 
it here:

  https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00008.html

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Thu, 02 May 2024 06:23:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Thu, 02 May 2024 09:21:36 +0300
> Date: Wed, 1 May 2024 17:20:20 -0400
> Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> >      char const *lock_info_fmt = (boot
> > 				 ? "%s@%s.%"PRIdMAX":%"PRIdMAX
> > 				 : "%s@%s.%"PRIdMAX);
> >      int len = snprintf (lock_info_str, sizeof lock_info_str,
> > 			lock_info_fmt, user_name, host_name, pid, boot);
> > 
> > get_boot_sec calls get_boot_time, which is a Gnulib function (see
> > lib/boot-time.c).  So I guess the key to unlock this puzzle is
> > somewhere there.
> 
> I took a quick look at get_boot_time and found a bug, which may explain 
> why some Cygwin systems behave differently from others.  I've reported 
> it here:
> 
>    https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00008.html

Thanks.  This probably explains why the ":-NNNN" part sometimes
appears and sometimes doesn't appear in Cygwin builds of Emacs, but
AFAIU it does NOT explain why unlinking the symlink (when the file is
unlocked) fails when the lock file name includes the ":-NNNN" part.
Right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70415; Package emacs. (Thu, 02 May 2024 14:28:01 GMT) Full text and rfc822 format available.

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

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
Subject: Re: bug#70415: 30.0.50; [Cygwin] `lock-file' creates a symlink with
 funny name
Date: Thu, 2 May 2024 10:26:31 -0400
On 5/2/2024 2:21 AM, Eli Zaretskii wrote:
>> Date: Wed, 1 May 2024 17:20:20 -0400
>> Cc: yamaoka <at> jpl.org, 70415 <at> debbugs.gnu.org
>> From: Ken Brown <kbrown <at> cornell.edu>
>>
>>>       char const *lock_info_fmt = (boot
>>> 				 ? "%s@%s.%"PRIdMAX":%"PRIdMAX
>>> 				 : "%s@%s.%"PRIdMAX);
>>>       int len = snprintf (lock_info_str, sizeof lock_info_str,
>>> 			lock_info_fmt, user_name, host_name, pid, boot);
>>>
>>> get_boot_sec calls get_boot_time, which is a Gnulib function (see
>>> lib/boot-time.c).  So I guess the key to unlock this puzzle is
>>> somewhere there.
>>
>> I took a quick look at get_boot_time and found a bug, which may explain
>> why some Cygwin systems behave differently from others.  I've reported
>> it here:
>>
>>     https://lists.gnu.org/archive/html/bug-gnulib/2024-05/msg00008.html
> 
> Thanks.  This probably explains why the ":-NNNN" part sometimes
> appears and sometimes doesn't appear in Cygwin builds of Emacs, but
> AFAIU it does NOT explain why unlinking the symlink (when the file is
> unlocked) fails when the lock file name includes the ":-NNNN" part.
> Right?

Yes, that's right.  I still need to look into that.

Ken




This bug report was last modified 1 day ago.

Previous Next


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