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
[Caml-list] Ocamlc stack overflow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-25 (13:20)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Ocamlc stack overflow
Thanks for answering.

I finally managed to fix my mail client. I haven't been able to get 
anything from the list yesterday..

Richard Jones wrote:

> On Mon, Nov 24, 2003 at 06:21:07PM +0100, Alex Baretta wrote:
>>I am experiencing stack overflows while compiling a source file with 
>>ocamlc. Why in world should ocamlc overflow? How can I diagnose the problem?
> We had this when compiling some OLE code (auto-generated ML). The
> workaround was to increase the stack size:

I am also trying to compile an auto-generated file, but it is rather 
small (140 lines of code). The binary search is probably not the way to 
go, but let me see what happens if I try to increase the stack size...

> export OCAMLRUNPARAM=l=16M

OK, done that...
ocamlc is presently running with 98% of the cpu and some 70 MB of memory 
footprint. It's almost certainly looping somewhere, allocating it's head 

Damien Doligez wrote:
 > On Monday, November 24, 2003, at 06:21 PM, Alex Baretta wrote:
 > If you are using the CVS version, you should try to update to the
 > latest one.  One version was committed last week with a stack
 > overflow problem.
 > -- Damien

I am using the Xavier-patch 2 to ocaml-3.07. I'm not ehntusiastic about 
using CVS. Since my company uses ocaml as it's main language for 
developing commercial applications, I'd prefer to have a stable stock 
version. After all the turmoil around 3.07, a stable bugfix release is 
overdue now.


Let try to produce a backtrace for the list...

OK, so the standard ocamlc is compiled without debugging info. Let me 
tweak the Makefile, so that I can build a copy of ocamlc with the -g option.

Done that. Here's the command I'm using to run the debugger:
[alex@flyingtuxman anagrafiche]$ ocamldebug 
/opt/ocaml/3.07+2g/bin/ocamlc -I 
/opt/ocaml/3.07/lib/ocaml/site-lib/postgres -I 
/opt/ocaml/3.07/lib/ocaml/site-lib/cgi -I 
/home/alex/cvs/sw2/ocamllib-addons  -I /home/alex/cvs/sw2/unixlib-addons 
  -I /home/alex/cvs/sw2/rules-engine  -I 
/home/alex/cvs/sw2/xcaml/xcaml-lib  -I /home/alex/cvs/sw2/dbinterface 
-I /home/alex/cvs/sw2/freerp/db/db_access  -I 
/home/alex/cvs/sw2/freerp/lib  -I 
/home/alex/cvs/sw2/freerp/business_rules  -I /home/alex/cvs/sw2/dbschema 
  -I /home/alex/cvs/sw2/freerp/db/xcaml_db_schema  -I 
/home/alex/cvs/sw2/xcaml/xcaml-lib -c
	Objective Caml Debugger version 3.07+2

(ocd) run
Loading program... done.
Time : 2766617
Program end.
Uncaught exception: Stack_overflow
(ocd) prev
Time : 2766616 - pc : 824648 - module Errors
No source file for Errors.
(ocd) bt
#0  Pc : 824648  Errors char 2807
#1  Pc : 68568  Format char 35089
#2  Pc : 830376  Main char 5649
#3  Pc : 834284  Main char 5678


Now what?


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: