Subject: bug#75209: 30.0.93; Emacs reader failed to read data in "/home/nlj/.cache/org-persist/gc-lock.eld"

From: Eli Zaretskii <[email-masked]>
Date: Sat, 15 Mar 2025 14:45:44 +0200

> From: Ihor Radchenko <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>, [email-masked]
> Date: Sat, 15 Mar 2025 12:19:07 +0000
> 
> Ihor Radchenko <[email-masked]> writes:
> 
> > Never returned likely means that it threw an error.
> > Most likely because
> >
> > (setf (alist-get before-init-time alist nil nil #'equal)
> >             (current-time))
> > will fail when ALIST is nil. I should fix this.
> 
> I was wrong. if ALIST is nil, the above code should work just fine.
> So, it looks like all the problems boil down to incomplete read.

Could the code which writes the file do it in atomic fashion,
i.e. write a temporary file, then rename the original file, then move
the new to the original's name, then delete the original file?

(On Posix filesystems moving a file to the original name is an atomic
operation, but not on MS-Windows, which is why I suggest a slightly
more complicated procedure.)