Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
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
> | 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