caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Sending compiler into an infinite loop or stack overflow.
@ 2010-04-16 13:24 Guillaume Yziquel
  0 siblings, 0 replies; only message in thread
From: Guillaume Yziquel @ 2010-04-16 13:24 UTC (permalink / raw)
  To: OCaml List

Hello.

Here is a compiler infinite loop / stack overflow error. In the 
toplevelm yuo get the following, but using ocamlc, you get an infinite loop.

> yziquel@seldon:~$ ocaml
>         Objective Caml version 3.11.2
> 
> # type untyped;;
> type untyped
> # type -'a typed = private untyped;;
> type 'a typed = private untyped
> # type -'typing wrapped = private sexp
>   and +'a t = 'a typed wrapped
>   and sexp = private untyped wrapped;;
> type 'a wrapped = private sexp
> and 'a t = 'a typed wrapped
> and sexp = private untyped wrapped
> # class type ['a] s3 = object 
>     val underlying : 'a t
>   end;;
> class type ['a] s3 = object val underlying : 'a t end
> # class ['a] s3object r : ['a] s3 = object
>     val underlying = r
>   end;;
> Fatal error: exception Stack_overflow

I've tracked it down it down on some other but similar code to the Ctype 
module.

> 	Objective Caml Debugger version 3.11.1
> 
> (ocd) start
> Loading program... done.
> `start not meaningful in outermost frame.
> (ocd) step 6516537
> Time : 6516537 - pc : 392692 - module Ctype
> 134   let name = match path with Path.Pident id -> <|b|>Ident.name id
> (ocd) run
> Time : 6516782
> Program end.
> Uncaught exception: Stack_overflow
> (ocd) 

Unfortunately, I'm getting quite lost in the compiler source code, so 
I'd appreciate some background information on how to deal with this issue.

All the best,

Guillaume Yziquel.

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-16 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-16 13:24 Sending compiler into an infinite loop or stack overflow Guillaume Yziquel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).