GNU bug report logs - #62009
29.0.60; Emacs crashes on setf symbol-name

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Mon, 6 Mar 2023 19:28:01 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: philipk <at> posteo.net, michael_heerdegen <at> web.de, mail <at> daniel-mendler.de, gregory <at> heytings.org, monnier <at> iro.umontreal.ca, 62009 <at> debbugs.gnu.org
Subject: bug#62009: 29.0.60; Emacs crashes on setf symbol-name
Date: Fri, 10 Mar 2023 14:09:41 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: Gregory Heytings <gregory <at> heytings.org>,  Eli Zaretskii <eliz <at> gnu.org>,
>   Philip Kaludercic <philipk <at> posteo.net>,  michael_heerdegen <at> web.de,
>   monnier <at> iro.umontreal.ca,  62009 <at> debbugs.gnu.org
> Date: Fri, 10 Mar 2023 12:23:54 +0100
> 
> On Fri, 10 Mar 2023 at 12:09, Daniel Mendler wrote:
> 
> > On 3/10/23 11:59, Gregory Heytings wrote:
> >> That would also come with a performance overhead, as there is currently no 
> >> way to distinguist strings that are used for symbol names from other 
> >> strings.  Not to mention the added complexity in the code.
> >
> > One could check if the string is located in read-only memory. Or one
> > could add a flag bit to the string data structure (and possibly to other
> > data structures too). Freezing data structures such that they become
> > read-only is a generally useful feature. There won't be any performance
> > overhead of the check since a branch not taken is fast thanks to the
> > branch predictor.
> 
> Note also that in-place modification of strings is arbitrarily costly,
> cf. (aset "ascii" 0 ?😼).  Not to mention that it's rarely a good or
> necessary move to make, as far as programming style is concerned.

Be this tru as it may, we will not constrain what Lisp programs can
legitimately do just because we think it is "rarely a good move".
That's against our long-time policy, which is explain why something
might not be a good idea, but otherwise don't block that, letting the
unwise cope with the consequences of their unwise actions.

IOW, we encourage Lisp programmers to DTRT and not use dangerous
practices, but don't block them if they want to.




This bug report was last modified 2 years and 88 days ago.

Previous Next


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