From: Damien Doligez <damien.doligez@inria.fr>
To: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Trouble with doubly-linked, circular list using lazy evaluation
Date: Fri, 17 Nov 2006 16:02:31 +0100 [thread overview]
Message-ID: <EE591BC3-E6CE-4500-984C-281CA2952CFB@inria.fr> (raw)
In-Reply-To: <6dbd4d000610241846g5a19a56u4630c7b10e5fbffb@mail.gmail.com>
On 2006-10-25, at 03:46, Denis Bueno wrote:
> I get a "Bus error" when running a unit test on a doubly-linked
> circular list (of length 2). A self-contained test case is included
> [1]. I have 8 fields in a record which includes two left & right
> pointers (not ref types).
>
> I am running a PowerMac G5 2.5GHz (uname -a: Darwin ford.local 8.8.0
> Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006;
> root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc) and
> ocaml 3.09.3.
>
> Interestingly, if I remove a field (such as the mark field), the test
> case succeeds.
That was an interesting bug. Thanks for reporting it.
It has nothing to do with lazy values: it's an interference between
"let rec" of values and an optimization in the implementation of
the { ... with ... } construct.
To work around the bug, you can remove all instances of
let rec ... = { ... with ... }
(i.e. the "with" construct as the toplevel expression of a letrec-bound
variable) by expanding the "with" construct by hand.
I am fixing it in the 3.09 branch (3.09.4+dev1).
-- Damien
prev parent reply other threads:[~2006-11-17 15:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-25 1:46 Denis Bueno
2006-10-25 9:01 ` [Caml-list] " Richard Jones
2006-10-25 10:59 ` Denis Bueno
2006-10-25 12:10 ` skaller
2006-11-17 15:02 ` Damien Doligez [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EE591BC3-E6CE-4500-984C-281CA2952CFB@inria.fr \
--to=damien.doligez@inria.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox