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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 81D93BC29 for ; Wed, 9 Aug 2006 13:55:59 +0200 (CEST) Received: from pih-relay05.plus.net (pih-relay05.plus.net [212.159.14.132]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k79BtwsQ017028 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 9 Aug 2006 13:55:59 +0200 Received: from [80.229.56.224] (helo=[10.0.0.5]) by pih-relay05.plus.net with esmtp (Exim) id 1GAmey-0007Ex-Ov for caml-list@yquem.inria.fr; Wed, 09 Aug 2006 12:55:42 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamlc Stack_overflow Date: Wed, 9 Aug 2006 03:54:24 +0100 User-Agent: KMail/1.9.1 References: <6dbd4d000608031803t77350a23jf388479cad9098eb@mail.gmail.com> <6dbd4d000608081900m267ea9d2mc0043962cd35d6f@mail.gmail.com> In-Reply-To: <6dbd4d000608081900m267ea9d2mc0043962cd35d6f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608090354.24786.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 44D9CD4E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamlc:01 stack:01 ocamlc:01 stack:01 ocaml:01 recursive:01 bytecode:01 -rectypes:01 checker:01 recursion:01 ocaml:01 2006:98 frog:98 compilers:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DATE_IN_PAST_06_12 autolearn=disabled version=3.0.3 On Wednesday 09 August 2006 03:00, Denis Bueno wrote: > | $ ocamlc -g -c spit_etest.ml > | Fatal error: exception Stack_overflow > > `---- > > I really have no idea where to start, whether it's my fault or > ocamlc's. I have included some relevant system information [1]. > > Could someone point my in the right direction? The OCaml compilers aren't entirely tail recursive so they sometimes overflow the stack on large input (especially autogenerated code). Easiest fixes: 1. Use ocamlc.opt because native code gets a bigger stack. 2. Use a bigger bytecode stack, set via the environment variable CAMLRUNPARAM. You can also get stack overflows by compiling with -rectypes and linking without it. I assume the type checker goes into infinite non-tail recursion... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists