Version française
Home     About     Download     Resources     Contact us    
Browse thread
non-recursive recursive module segfault
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <Alain.Frisch@i...>
Subject: Re: [Caml-list] non-recursive recursive module segfault
Jeremy Yallop wrote:
> 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.

That's probably the bug 4008:

http://caml.inria.fr/mantis/view.php?id=4008

which is fixed in the 3.09 CVS branch (but not in the 3.10 branch, in
case you tried).

To get rid of the problem, you can either:

- use the CVS version (release309 branch);

- download, compile and link with the following files:

http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/~checkout~/ocaml/stdlib/camlinternalMod.mli?rev=1.1.8.2
http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/~checkout~/ocaml/stdlib/camlinternalMod.ml?rev=1.4.2.1

- use ocamlopt


-- Alain