unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#19415: Compiler shares storage for assoc-lists even if some of them are mutated
@ 2014-12-19 23:53 Panicz Maciej Godek
  2014-12-22  7:08 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Panicz Maciej Godek @ 2014-12-19 23:53 UTC (permalink / raw)
  To: 19415

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

This bug was traced by Matt Wette and described here:

http://lists.gnu.org/archive/html/guile-user/2014-12/msg00023.html

In short, the bug manifests itself when at least two consecutive let forms
are used with an assoc list argument which starts with identical elements,
and the first appearance gets mutated before the second:

(begin
  (let ((l '((a . X)(b . Y)(c . 7))))
    (assoc-set! l 'b 'Z))
  (let ((l '((a . X)(b . Y))))
    l))
===> ((a . X) (b . Z))

The issue is known to appear in guile 2.0.11 and 2.0.5

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

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

* bug#19415: Compiler shares storage for assoc-lists even if some of them are mutated
  2014-12-19 23:53 bug#19415: Compiler shares storage for assoc-lists even if some of them are mutated Panicz Maciej Godek
@ 2014-12-22  7:08 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2014-12-22  7:08 UTC (permalink / raw)
  To: Panicz Maciej Godek; +Cc: request, 19415

tags 19415 + notabug
close 19415
merge 19415 19417
thanks

Panicz Maciej Godek <godek.maciek@gmail.com> writes:

> This bug was traced by Matt Wette and described here:
>
> http://lists.gnu.org/archive/html/guile-user/2014-12/msg00023.html
>
> In short, the bug manifests itself when at least two consecutive let
> forms are used with an assoc list argument which starts with identical
> elements, and the first appearance gets mutated before the second:
>
> (begin
> (let ((l '((a . X)(b . Y)(c . 7))))
> (assoc-set! l 'b 'Z))
> (let ((l '((a . X)(b . Y))))
> l))
> ===> ((a . X) (b . Z))
>
> The issue is known to appear in guile 2.0.11 and 2.0.5

As later explained on guile-user, mutating literal data is not permitted
in scheme and leads to unspecified behavior.  Our compiler aggressively
shares data between literals in the same compilation unit.

See <http://bugs.gnu.org/16060> for a related wishlist item.

     Thanks,
       Mark





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

end of thread, other threads:[~2014-12-22  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-19 23:53 bug#19415: Compiler shares storage for assoc-lists even if some of them are mutated Panicz Maciej Godek
2014-12-22  7:08 ` Mark H Weaver

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