unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#62583: Guile 3.0.9 crashes when calling set-car! on the last node of '(...)
@ 2023-04-01  0:12 Rui Zhang
  2023-04-01  6:46 ` Jean Abou Samra
  0 siblings, 1 reply; 2+ messages in thread
From: Rui Zhang @ 2023-04-01  0:12 UTC (permalink / raw)
  To: 62583

Reproduction:

    (let ((xs '(1)))
      (set-car! xs 0))

or

    (let ((xs '(1 2)))
      (set-car! (cdr xs) 0))

Guile will segfault executing this code, and only when set-car! is called on the last node.  I believe the expectation is that it does not segfault and xs will be modified to (0) or (1 0) in these two examples.

If I use (list 1) instead of '(1), Guile does not seem to segfault.  Maybe '(1) is constructed differently?


$ guile --version
guile (GNU Guile) 3.0.9
Copyright (C) 2023 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ ./config.guess
x86_64-pc-linux-gnu


Best regards,
-Rui




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#62583: Guile 3.0.9 crashes when calling set-car! on the last node of '(...)
  2023-04-01  0:12 bug#62583: Guile 3.0.9 crashes when calling set-car! on the last node of '(...) Rui Zhang
@ 2023-04-01  6:46 ` Jean Abou Samra
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Abou Samra @ 2023-04-01  6:46 UTC (permalink / raw)
  To: Rui Zhang; +Cc: 62583-done

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]



> Le 1 avr. 2023 à 08:22, Rui Zhang <zrui16@hotmail.com> a écrit :
> 
> Reproduction:
> 
>    (let ((xs '(1)))
>      (set-car! xs 0))
> 
> or
> 
>    (let ((xs '(1 2)))
>      (set-car! (cdr xs) 0))
> 
> Guile will segfault executing this code, and only when set-car! is called on the last node.  I believe the expectation is that it does not segfault and xs will be modified to (0) or (1 0) in these two examples.
> 
> If I use (list 1) instead of '(1), Guile does not seem to segfault.  Maybe '(1) is constructed differently?
> 
> 
> $ guile --version
> guile (GNU Guile) 3.0.9
> Copyright (C) 2023 Free Software Foundation, Inc.
> 
> License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> $ ./config.guess
> x86_64-pc-linux-gnu


A duplicate of https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16060

[-- Attachment #2: Type: text/html, Size: 1874 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-01  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01  0:12 bug#62583: Guile 3.0.9 crashes when calling set-car! on the last node of '(...) Rui Zhang
2023-04-01  6:46 ` Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).