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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 82BE2BB83 for ; Wed, 19 Apr 2006 12:57:04 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k3JAv3Y4004458 for ; Wed, 19 Apr 2006 12:57:03 +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 MAA00457 for ; Wed, 19 Apr 2006 12:57:03 +0200 (MET DST) Received: from gw-eur4.philips.com (gw-eur4.philips.com [161.85.125.10]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k3JAv2r7002672 for ; Wed, 19 Apr 2006 12:57:02 +0200 Received: from smtpscan-eur4.philips.com (smtpscan-eur4.mail.philips.com [130.144.57.167]) by gw-eur4.philips.com (Postfix) with ESMTP id 1AA064970E; Wed, 19 Apr 2006 10:57:02 +0000 (UTC) Received: from smtpscan-eur4.philips.com (localhost [127.0.0.1]) by localhost.philips.com (Postfix) with ESMTP id B209B1ACF; Wed, 19 Apr 2006 10:57:01 +0000 (GMT) Received: from smtprelay-eur2.philips.com (smtprelay-eur2.philips.com [130.144.57.171]) by smtpscan-eur4.philips.com (Postfix) with ESMTP id 4BE2D1AC3; Wed, 19 Apr 2006 10:57:01 +0000 (GMT) Received: from ehvrmh02.diamond.philips.com (ehvrmh02-srv.diamond.philips.com [130.139.27.125]) by smtprelay-eur2.philips.com (Postfix) with ESMTP id 8ACC236; Wed, 19 Apr 2006 10:56:56 +0000 (GMT) In-Reply-To: To: caml-list@inria.fr Cc: "Jonathan Roewen" Subject: Re: [Caml-list] Bug in ocamlc or in ocamlrun. MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.0.3 September 26, 2003 Message-ID: From: Sebastian Egner Date: Wed, 19 Apr 2006 12:55:52 +0200 X-MIMETrack: Serialize by Router on ehvrmh02/H/SERVER/PHILIPS(Release 6.5.3FP1HF291 | September 19, 2005) at 19/04/2006 12:55:54, Serialize complete at 19/04/2006 12:55:54 Content-Type: multipart/alternative; boundary="=_alternative 003C2439C1257155_=" X-j-chkmail-Score: MSGID : 4446177F.000 on concorde : j-chkmail score : X : 0/20 1 X-j-chkmail-Score: MSGID : 4446177E.001 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 4446177F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4446177E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bug:01 ocamlc:01 ocamlrun:01 segfaults:01 ocamlc:01 sig:01 val:01 struct:01 stack:01 rec:01 struct:01 segfaults:01 sig:01 val:01 stack: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=HTML_60_70,HTML_MESSAGE autolearn=disabled version=3.0.3 This is a multipart message in MIME format. --=_alternative 003C2439C1257155_= Content-Type: text/plain; charset="US-ASCII" Besides the point or not, here is a much simpler version of Marc's program which also segfaults (ocamlc 3.09.1), and probably due to the same reason: --- module type Aut = sig type t val f : t -> t end module Map(A : Aut) = struct type t = A.t list let f = List.map A.f (* => Segmentation fault *) (* let f x = List.map A.f x *) (* => Stack overflow (correct) *) end module rec M : (Aut with type t = int) = struct type t let f x = match MapM.f [x] with | [y] -> y | _ -> assert false end and MapM : (Aut with type t = M.t list) = Map(M) open M;; M.f 0 --- Sebastian --=_alternative 003C2439C1257155_= Content-Type: text/html; charset="US-ASCII"
Besides the point or not, here is a much simpler version of
Marc's program which also segfaults (ocamlc 3.09.1), and
probably due to the same reason:

---

module type Aut =
  sig
    type t
    val f : t -> t
  end

module Map(A : Aut) =
  struct
    type t = A.t list
    let f = List.map A.f (* => Segmentation fault *)
(*  let f x = List.map A.f x *) (* => Stack overflow (correct) *)
  end

module rec M : (Aut with type t = int) =
  struct
    type t
    let f x =
      match MapM.f [x] with
      | [y] -> y
      | _   -> assert false
  end
and MapM : (Aut with type t = M.t list) =
  Map(M)

open M;;
M.f 0

---

Sebastian --=_alternative 003C2439C1257155_=--