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: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: michael_heerdegen <at> web.de, monnier <at> iro.umontreal.ca, 62009 <at> debbugs.gnu.org
Subject: bug#62009: 29.0.60; Emacs crashes on setf symbol-name
Date: Tue, 07 Mar 2023 19:39:51 +0200
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 62009 <at> debbugs.gnu.org
> Date: Tue, 7 Mar 2023 18:08:43 +0100
> From: Daniel Mendler <mail <at> daniel-mendler.de>
> 
> On 3/7/23 16:45, Michael Heerdegen wrote:
> > Daniel Mendler <mail <at> daniel-mendler.de> writes:
> > 
> >> Execute the following in the scratch buffer:
> >>
> >> (setf (aref (symbol-name 'car) 1) ?o)
> >>
> >> Emacs crashes with a segmentation fault. Is this a well-known issue? I
> >> could reproduce the problem on Emacs 27 and 29. Should there be some
> >> mechanism to protect the strings of symbols?
> >
> > Maybe the outcome was something like that we can't protect everybody in
> > every case from shooting in the own foot, I don't recall.
> 
> Maybe it would be possible to introduce a flag which marks strings as
> "frozen"? Then we could ensure that no mutations of such frozen string
> happen.

AFAICT, they _are_ frozen.  These names are in read-only memory, where
you cannot write.  That's why Emacs crashes, AFAIU: the code is trying
to write to protected memory.

Just don't do that, cause it's gonna hurt...




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.