Article View: fa.caml
Article #147Re: [Caml-list] Problem with the compiler 3.12.1
From: Claire Dross
Date: Fri, 27 Apr 2012 10:54
Date: Fri, 27 Apr 2012 10:54
38 lines
4100 bytes
4100 bytes
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. -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Technical Details
Message-ID:
<fa.+uXeXiom2Nwue5sD9YKbm6y9w/Q@ifi.uio.no>Path:
arc1-ca.pugleaf.net!r9ni104101pbh.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!newsfeed3.funet.fi!newsfeeds.funet.fi!uio.no!nntp.uio.no!.POSTED!not-for-mailReferences:
<fa.M8WQQfeGA6zwPg847g4LPWuc7BU@ifi.uio.no> <fa.8eOQeqeDOQ7eL00qlTfSkkU2yMU@ifi.uio.no>Show Full Headers
Complete Article Headers
X-Google-Thread: ff861,f44fe6ed6acb1a46
X-Google-NewGroupId: yes
X-Google-Attributes: gidc0fe4b917e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.68.227.230 with SMTP id sd6mr8840565pbc.8.1335524069587;
Fri, 27 Apr 2012 03:54:29 -0700 (PDT)
Path: arc1-ca.pugleaf.net!r9ni104101pbh.0!nntp.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!newsfeed3.funet.fi!newsfeeds.funet.fi!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: Claire Dross <claire.dross@lri.fr>
Newsgroups: fa.caml
Subject: Re: [Caml-list] Problem with the compiler 3.12.1
Date: Fri, 27 Apr 2012 10:54:29 UTC
Organization: Internet mailing list
Lines: 39
Message-ID: <fa.+uXeXiom2Nwue5sD9YKbm6y9w/Q@ifi.uio.no>
References: <fa.M8WQQfeGA6zwPg847g4LPWuc7BU@ifi.uio.no> <fa.8eOQeqeDOQ7eL00qlTfSkkU2yMU@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1335524069 12520 129.240.7.9 (27 Apr 2012 10:54:29 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Fri, 27 Apr 2012 10:54:29 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1
To: caml-list@inria.fr
X-IronPort-AV: E=Sophos;i="4.75,490,1330902000";
d="scan'208";a="155891606"
X-Authentication-Warning: walapai.inria.fr: sympa set sender to caml-list-owner@inria.fr using -f
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"
X-Virus-Scanned: amavisd-new at eu.adacore.com
In-Reply-To: <4F97B005.3090005@lri.fr>
X-Sequence: 3977
List-Id: <caml-list.inria.fr>
List-Archive: <https://sympa-roc.inria.fr/wws/arc/caml-list>
List-Help: <mailto:sympa@inria.fr?subject=help>
List-Owner: <mailto:caml-list-request@inria.fr>
List-Post: <mailto:caml-list@inria.fr>
List-Subscribe: <mailto:sympa@inria.fr?subject=subscribe%20caml-list>
List-Unsubscribe: <mailto:sympa@inria.fr?subject=unsubscribe%20caml-list>
Original-Date: Fri, 27 Apr 2012 12:54:03 +0200
Original-Message-Id: <4F9A7ACB.1030009@lri.fr>
Original-References: <4F8C4054.6010407@lri.fr> <4F97B005.3090005@lri.fr>
X-Received-Bytes: 3701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit