English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlc Stack_overflow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-09 (11:55)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] ocamlc Stack_overflow
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 

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists