From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B0EC9BB83 for ; Wed, 19 Apr 2006 10:45:31 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3J8jVK1021217 for ; Wed, 19 Apr 2006 10:45:31 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA31015 for ; Wed, 19 Apr 2006 10:45:30 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3J8jSS6021204 for ; Wed, 19 Apr 2006 10:45:29 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.6/8.13.6) with ESMTP id k3J8jN6h001909; Wed, 19 Apr 2006 17:45:23 +0900 (JST) Date: Wed, 19 Apr 2006 17:45:23 +0900 (JST) Message-Id: <20060419.174523.68533574.keiko@kurims.kyoto-u.ac.jp> To: titmarc@free.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Bug in ocamlc or in ocamlrun. From: Keiko Nakata In-Reply-To: <4445734B.6030004@free.fr> References: <4445734B.6030004@free.fr> X-Mailer: Mew version 4.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4445F8AB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4445F8A8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bug:01 ocamlc:01 ocamlrun:01 bug:01 ocamlc:01 ocamlrun:01 ocaml:01 sig:01 val:01 struct:01 rec:01 sig:01 val:01 struct:01 failwith:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 From: Marc Lasson Subject: [Caml-list] Bug in ocamlc or in ocamlrun. Date: Wed, 19 Apr 2006 01:16:27 +0200 > When i compile the following program with ocamlc i get a segmentation fault. > > Is it a bug in the ocaml system ? I did not succeed to isolate it. > ---------------------- > module LL (R : sig > type t > val add : t -> t -> t > end) = > struct > type t = R.t list > let add = List.map2 (R.add) > end > > module rec M : sig > type t = P of int | L of LS.t > val add : t -> t -> t > val to_string : t -> string > end = struct > type param = () > type t = P of int > | L of LS.t > let add a b = match a, b with > P a', P b' -> P (a'+b') > | L a', L b' -> L (LS.add a' b') > | _ -> failwith "incompatible" > > let rec to_string = function > P i -> string_of_int i > | L l -> List.fold_left (fun r x -> r^" "^(to_string x)) "" l > end > and LS : sig type t = M.t list val add : t -> t -> t end = LL(M) > > open M > let p = L [P 1; P 2] > let q = add p p > let () = > print_endline (to_string p); > print_endline (to_string q) Strangely, OCaml version 3.08.0 can handle this code. So, the developer team must know the reason. Did you write a bug report ? Keiko NAKATA