GNU bug report logs -
#79483
Segmentation fault: set-car! in compiled code
Previous Next
Full log
Message #11 received at 79483 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
<tomas <at> tuxteam.de> writes:
> On Mon, Sep 22, 2025 at 12:50:57AM +0300, var-vniiaes--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language wrote:
>>
>> Hello,
>>
>> Execution of (set-car! '(0) 1) *in compiled code* leads to segfault:
>
> First of all: you shouldn't be doing that :)
>
> You are mutating a constant. I don't know what the Scheme specification says
> to it (if at all).
--8<---------------cut here---------------start------------->8---
As noted in section 3.4, it is an error to attempt to alter
a constant (i.e. the value of a literal expression) using a
mutation procedure like set-car! or string-set!
--8<---------------cut here---------------end--------------->8---
> The other question is whether Guile should/could catch that and signal an
> error instead.
I believe it should not. Memory-safe languages (and, Guile is supposed
to be one) should never segfault but instead terminate with a sensible
error. I realize that 1.3.2 allows to "fail catastrophically", which
segfault probably qualifies as, but I believe we should do better.
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.