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 37A93BC29 for ; Wed, 9 Aug 2006 15:48:46 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k79Dmjll010653 for ; Wed, 9 Aug 2006 15:48:45 +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 PAA09594 for ; Wed, 9 Aug 2006 15:48:45 +0200 (MET DST) Received: from mcr-smtp-002.bulldogdsl.com (smtp.bulldogdsl.com [212.158.248.8]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k79DmiP1010594 for ; Wed, 9 Aug 2006 15:48:44 +0200 Received: by mcr-smtp-002.bulldogdsl.com (Postfix, from userid 1010) id 6154A845E86; Wed, 9 Aug 2006 14:48:34 +0100 (BST) Received: from [192.168.123.191] (host-84-9-233-56.bulldogdsl.com [84.9.233.56]) by mcr-smtp-002.bulldogdsl.com (Postfix) with ESMTP id B1121845E84 for ; Wed, 9 Aug 2006 14:48:33 +0100 (BST) Message-ID: <44D9E864.4000303@ed.ac.uk> Date: Wed, 09 Aug 2006 14:51:32 +0100 From: Jeremy Yallop User-Agent: Thunderbird 1.5.0.4 (X11/20060713) MIME-Version: 1.0 To: caml-list@inria.fr Subject: non-recursive recursive module segfault Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 44D9E7BD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44D9E7BC.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; recursive:01 segfault:01 rec:01 sig:01 val:01 struct:01 recursive:01 segfaults:01 rec':01 rec':01 trivial:01 compiler:01 bug:01 ocaml:01 exception: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 What behaviour should I expect for the following code? : module rec M : sig val m : unit -> unit end = struct let h _ _ = () let m = h () end let _ = M.m () According to the documentation this could trigger the exception "Undefined_recursive_module", but instead it segfaults. If I remove the `rec' keyword then it "works", i.e. simply returns unit. I was rather hoping that M would be treated as a non-recursive module, despite the `rec', since it's not actually recursive. It's easy enough to avoid the segmentation fault: eta-expanding m, adding a trivial value component to the signature, removing `rec', etc., but I was hoping the compiler would help out in this case. In any case, should the segmentation fault be considered a bug? This is on OCaml 3.09.2/Linux/x86. Jeremy.