GNU bug report logs - #49261
28.0.50; File Locking Breaks Presumptuous Toolchains

Previous Next

Package: emacs;

Reported by: Mallchad Skeghyeph <ncaprisunfan <at> gmail.com>

Date: Mon, 28 Jun 2021 18:28:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael.albinus <at> gmx.de, ncaprisunfan <at> gmail.com, 49261 <at> debbugs.gnu.org
Subject: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains
Date: Wed, 07 Jul 2021 20:58:29 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Even if it currently works, it's unsafe, IMO, to not have any
> protection there.  No one will remember that we rely on this not being
> called early enough.

Right.  My reasoning was that it seemed unlikely to be a problem here,
since the same function also (possibly) calls the Lisp functions
userlock--ask-user-about-supersession-threat and ask-user-about-lock.
But those are only called in some cases, so we're calling out to Lisp
more now than before, and that may indeed be a problem.

I can add a check to whether the Lisp function is defined before calling
(and then not do locking if it isn't) to be more defensive here?

> My point is that this simplicity comes at a price.  We've been
> consistently moving code from C primitives to Lisp, and by doing that
> significantly increase the consing during even the simplest editing
> operations.  All this consing adds up, with the result that Emacs
> nowadays produces much more garbage, which then triggers frequent GC
> cycles, which slow down Emacs.  It's a small wonder we see so many
> people out there raising the GC threshold to dangerous levels.
>
> So I'm asking whether the simplicity justifies the costs, here and
> elsewhere.

I agree with you 100% that it's important to take this into
consideration when moving things from C to Lisp.  In this particular
case, I think the cost is justified, because this isn't a function
that's called in a loop, and the other things it does (calling
Fverify_visited_file_modtime and Ffile_exists_p, and actually creating
the lock file) totally swamps any extra string consing, I think.  (That
is, it won't take measurably longer.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 305 days ago.

Previous Next


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