caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Claire Dross <claire.dross@lri.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Problem with the compiler 3.12.1
Date: Fri, 27 Apr 2012 12:54:03 +0200	[thread overview]
Message-ID: <4F9A7ACB.1030009@lri.fr> (raw)
In-Reply-To: <4F97B005.3090005@lri.fr>

On 25/04/2012 10:04, Claire Dross wrote:
> On 16/04/2012 17:52, Claire Dross wrote:
>> Hello,
>>
>> I am new to caml-list, so sorry in advance if it is not the right 
>> place to make this post. In a quite important piece of ocaml code, I 
>> have a function:
>>
>> let matching_term terms env uf id (pats, subst) (seen, forms) =
>>     match pats, subst with
>>       | _, [] | [], _ -> seen, forms
>>       | t :: pats, _ -> fprintf fmt "   %a@." T.print t;
>>         let acc = matchpats env terms uf (subst, seen, id+1) t in
>>         let acc, seen, _ = List.fold_left (matchpats env env.fils uf)
>>           acc pats in
>>         seen, List.rev_append acc forms
>>
>> Removing the print in the second case of the match changes the result 
>> of the compiled file (compiler 3.12.1 byte code and for linux)) on 
>> one of my tests. T.print does not have side effects, it recursively 
>> prints a hashconsed term structure.
>>
> Using the compiler 3.11.2 instead of the 3.12.1 removes the problem. 
> My function returns the correct result with and without the print.
>
> Thanks again to everyone that took time to help me,
>
> Claire Dross
>
The problem is caused by the garbage collector (launched because Format 
creates a lot of things) that introduces non-determinism in the order of 
elements in a weak hash table.

      reply	other threads:[~2012-04-27 10:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 15:52 Claire Dross
2012-04-18  9:04 ` Arnaud Spiwack
2012-04-25  8:04 ` Claire Dross
2012-04-27 10:54   ` Claire Dross [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=4F9A7ACB.1030009@lri.fr \
    --to=claire.dross@lri.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;
as well as URLs for NNTP newsgroup(s).