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 (04:19)
From: Martin Jambon <martin1977@l...>
Subject: Re: [Caml-list] ocamlc Stack_overflow
On Tue, 8 Aug 2006, Denis Bueno wrote:

> [I tried sending this a few days ago with a rather large attachment.
> Since it hasn't been approved since then, I'm sending it again, sans
> attachment.]
> All--
> The source file available on my website [2] gives the following output
> (when uncompressed, of course):
> ,----
> | $ 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?

You are using a huge list, and it is likely that the compiler uses some 
functions which will use stack space proportionally to the size of your list.
You can use one of the following options:
- use ocamlc.opt instead of ocamlc
- increase the maximum size of the stack:
     env OCAMLRUNPARAM=l=10M ocamlc -c spit_etest.ml
- store your data externally

Note that your program itself might have the same problem at runtime if 
you use non-tail-call optimized functions like List.map (see 
documentation for module List).


Martin Jambon, PhD