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


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: michael.albinus <at> gmx.de, ncaprisunfan <at> gmail.com, 49261 <at> debbugs.gnu.org
Subject: Re: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains
Date: Wed, 07 Jul 2021 22:20:50 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: michael.albinus <at> gmx.de,  ncaprisunfan <at> gmail.com,  49261 <at> debbugs.gnu.org
> 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.

Right, the call to userlock--ask-user-about-supersession-threat is
under some conditions that are rarely satisfied.

> 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?

I guess so.

> > 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.)

If it triggers GC, it _will_ take significantly longer.  But I won't
argue more about this, it's a lost battle anyway with current Emacs
development trends.




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

Previous Next


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