From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3RAsAKV003444 for ; Fri, 27 Apr 2012 12:54:10 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkYEAGJ6mk/CYk3SgWdsb2JhbABFgx2rMYMvIgEBFiYnggkBAQUnEUARCxgJFg8JAwIBAgFFEwgBAYgNvR6OHoMlBJtxjTY X-IronPort-AV: E=Sophos;i="4.75,490,1330902000"; d="scan'208";a="155891503" Received: from mel.act-europe.fr ([194.98.77.210]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-CAMELLIA256-SHA; 27 Apr 2012 12:54:04 +0200 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id E6EE42900DE for ; Fri, 27 Apr 2012 12:54:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MJFNGplbR+s8 for ; Fri, 27 Apr 2012 12:54:09 +0200 (CEST) Received: from [10.10.127.248] (dhcp-guest-248.act-europe.fr [10.10.127.248]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id D3DC72900D9 for ; Fri, 27 Apr 2012 12:54:09 +0200 (CEST) Message-ID: <4F9A7ACB.1030009@lri.fr> Date: Fri, 27 Apr 2012 12:54:03 +0200 From: Claire Dross User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: caml-list@inria.fr References: <4F8C4054.6010407@lri.fr> <4F97B005.3090005@lri.fr> In-Reply-To: <4F97B005.3090005@lri.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Problem with the compiler 3.12.1 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.