GNU bug report logs -
#70415
30.0.50; [Cygwin] `lock-file' creates a symlink with funny name
Previous Next
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
Done: Ken Brown <kbrown <at> cornell.edu>
Bug is archived. No further changes may be made.
Full log
Message #44 received at 70415 <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 1 year and 74 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.