* non-recursive recursive module segfault
@ 2006-08-09 13:51 Jeremy Yallop
2006-08-09 14:30 ` [Caml-list] " Alain Frisch
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Yallop @ 2006-08-09 13:51 UTC (permalink / raw)
To: caml-list
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.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Caml-list] non-recursive recursive module segfault 2006-08-09 13:51 non-recursive recursive module segfault Jeremy Yallop @ 2006-08-09 14:30 ` Alain Frisch 2006-08-09 14:56 ` Jeremy Yallop 0 siblings, 1 reply; 3+ messages in thread From: Alain Frisch @ 2006-08-09 14:30 UTC (permalink / raw) To: Jeremy Yallop; +Cc: caml-list 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] non-recursive recursive module segfault 2006-08-09 14:30 ` [Caml-list] " Alain Frisch @ 2006-08-09 14:56 ` Jeremy Yallop 0 siblings, 0 replies; 3+ messages in thread From: Jeremy Yallop @ 2006-08-09 14:56 UTC (permalink / raw) To: Alain Frisch; +Cc: caml-list Alain Frisch wrote: > Jeremy Yallop wrote: >> What behaviour should I expect for the following code? : [...] > > 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 Thanks! All of the above fixed the problem. I'd looked on mantis to see if was a known problem, but bug 4008 didn't show up when I searched for "recursive module" (for obvious reasons). Jeremy. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-09 14:54 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-08-09 13:51 non-recursive recursive module segfault Jeremy Yallop 2006-08-09 14:30 ` [Caml-list] " Alain Frisch 2006-08-09 14:56 ` Jeremy Yallop
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox