GNU bug report logs -
#46972
28.0.50; [feature/native-comp] Emacs locks itself during native compilation because of permission denied
Previous Next
Reported by: Matt M <mmerino <at> outlook.fr>
Date: Sat, 6 Mar 2021 17:43:01 UTC
Severity: normal
Found in version 28.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 46972 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
If I understand correctly, this is what happens currently :
1. Rename oldfile to new temporary name
2. Rename newfile to oldfile
3. If rename in 2) failed because oldfile has been recreated, go back to 1)
With my change it becomes :
1. Delete oldfile
2. Rename newfile to oldfile
3. If rename in 2) failed because oldfile has been recreated, go back to 1)
The only difference being that oldfile is deleted instead of keeping an .eln.old file.
In the non Windows version of the code no .eln.old file is created anyway.
The problem on Windows is that the oldfile could reappear and block step 2),
so the while loop is necessary, but I keep it in my proposed change.
Or maybe I misunderstood entirely
De : Eli Zaretskii<mailto:eliz <at> gnu.org>
Envoyé le :vendredi 12 mars 2021 08:36
À : Matt M<mailto:MMERINO <at> OUTLOOK.FR>
Cc : akrl <at> sdf.org<mailto:akrl <at> sdf.org>; 46972 <at> debbugs.gnu.org<mailto:46972 <at> debbugs.gnu.org>
Objet :Re: RE : RE : RE : bug#46972: 28.0.50; [feature/native-comp] Emacs locks itself during native compilation because of permission denied
> From: Matt M <mmerino <at> outlook.fr>
> CC: "46972 <at> debbugs.gnu.org" <46972 <at> debbugs.gnu.org>
> Date: Fri, 12 Mar 2021 00:26:18 +0000
>
> The Following patch seems to fix my problem :
> --- a/lisp/emacs-lisp/comp.el
> +++ b/lisp/emacs-lisp/comp.el
> @@ -3778,13 +3778,7 @@ comp-delete-or-replace-file
> (while
> (condition-case _
> (progn
> - ;; oldfile maybe recreated by another Emacs in
> - ;; between the following two rename-file calls
> - (if (file-exists-p oldfile)
> - (rename-file oldfile (make-temp-file-internal
> - (file-name-sans-extension oldfile)
> - nil ".eln.old" nil)
> - t))
> + (delete-file oldfile)
> (when newfile
> (rename-file newfile oldfile nil))
> ;; Keep on trying.
> Changed the call to rename-file to delete-file.
Thanks, but I don't think we can use this solution, due to the reason
explained in the comment there. (You can, of course, use it locally,
if the danger described there is not relevant for your usage.)
I apologize that I didn't yet have time to recreate the problem you
described and look into it: the native-comp branch is still not stable
enough for me to try such non-trivial situations. I didn't forget,
though.
[Message part 2 (text/html, inline)]
This bug report was last modified 4 years and 132 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.