<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/dbf6c81e68bd4cd5ee32a28aded59c64"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-11-25T13:20:30"
  subject="Re: [Caml-list] Ocamlc stack overflow"
  prev="2003/11/a3a7ab4e74ebbf072bc450a95a4ba3a7"
  next="2003/11/8b59939ea1e1c2b4ffcee23b75813b80"
  prev-in-thread="2003/11/83bc295c446556f82e5c840b8216af05"
  next-in-thread="2003/11/8b59939ea1e1c2b4ffcee23b75813b80"
  prev-thread="2003/11/5e86685e6180b05d4cfd14dcb86eb57c"
  next-thread="2003/11/541d390c3dc1718e433c58c401e2269f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Ocamlc stack overflow">
<msg 
  url="2003/11/2657135bcecea23ebab1a637490ae98e"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-11-24T17:21:43"
  subject="[Caml-list] Ocamlc stack overflow">
<msg 
  url="2003/11/83bc295c446556f82e5c840b8216af05"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-24T17:47:49"
  subject="Re: [Caml-list] Ocamlc stack overflow">
<msg 
  url="2003/11/dbf6c81e68bd4cd5ee32a28aded59c64"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-11-25T13:20:30"
  subject="Re: [Caml-list] Ocamlc stack overflow">
<msg 
  url="2003/11/8b59939ea1e1c2b4ffcee23b75813b80"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-25T14:06:16"
  subject="Re: [Caml-list] Ocamlc stack overflow">
<msg 
  url="2003/11/60cda68fb2658481d2c1567b74b32095"
  from="Alex Baretta &lt;alex@b...&gt;"
  author="Alex Baretta"
  date="2003-11-25T15:10:41"
  subject="Re: [Caml-list] Ocamlc stack overflow (Probably a typechecking bug)">
</msg>
</msg>
<msg 
  url="2003/11/f27b32c466596a5e9c7d7906b05c514e"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-11-25T17:50:48"
  subject="Re: [Caml-list] Ocamlc stack overflow">
</msg>
</msg>
</msg>
<msg 
  url="2003/11/ba89246da253ab0440a0660c65e37a49"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-11-24T18:22:48"
  subject="Re: [Caml-list] Ocamlc stack overflow">
</msg>
</msg>
</thread>

<contents>
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:

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

&gt; 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 
off...

Damien Doligez wrote:
 &gt; On Monday, November 24, 2003, at 06:21 PM, Alex Baretta wrote:
 &gt;
 &gt; If you are using the CVS version, you should try to update to the
 &gt; latest one.  One version was committed last week with a stack
 &gt; overflow problem.
 &gt;
 &gt; -- 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 inserimento_enti_sql.ml
	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?

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

