caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: OCaml List <caml-list@inria.fr>
Subject: Sending compiler into an infinite loop or stack overflow.
Date: Fri, 16 Apr 2010 15:24:03 +0200	[thread overview]
Message-ID: <4BC864F3.9020307@citycable.ch> (raw)

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/


                 reply	other threads:[~2010-04-16 13:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC864F3.9020307@citycable.ch \
    --to=guillaume.yziquel@citycable.ch \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).