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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 48944BC57 for ; Fri, 16 Apr 2010 15:27:52 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoEFAL4CyEtQDPKjWmdsb2JhbACDE5hpARYJCgYVAh+sdZE5gSyCdG4EikQ X-IronPort-AV: E=Sophos;i="4.52,219,1270418400"; d="scan'208";a="57167552" Received: from smtp-wifi-out.orange.fr (HELO smtp-wifi.orange.fr) ([80.12.242.163]) by mail1-smtp-roc.national.inria.fr with ESMTP; 16 Apr 2010 15:27:52 +0200 Received: from [172.18.185.213] (unknown [81.253.3.69]) by mwinf5909 (SMTP Server) with ESMTP id 4CA1BA697; Fri, 16 Apr 2010 15:27:51 +0200 (CEST) X-ME-UUID: 20100416132751313.4CA1BA697@mwinf5909 Message-ID: <4BC864F3.9020307@citycable.ch> Date: Fri, 16 Apr 2010 15:24:03 +0200 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: OCaml List Subject: Sending compiler into an infinite loop or stack overflow. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; guillaume:01 guillaume:01 compiler:01 compiler:01 ocamlc:01 ocaml:01 untyped:01 untyped:01 -'a:01 sexp:01 sexp:01 val:01 val:01 ctype:01 debugger:01 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/