<?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/83bc295c446556f82e5c840b8216af05"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-24T17:47:49"
  subject="Re: [Caml-list] Ocamlc stack overflow"
  prev="2003/11/0846c0670c6d66e04cd9b51e281e5cea"
  next="2003/11/e45e6ee9f1c352122edfbe83a7956ebc"
  prev-in-thread="2003/11/2657135bcecea23ebab1a637490ae98e"
  next-in-thread="2003/11/dbf6c81e68bd4cd5ee32a28aded59c64"
  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>
On Mon, Nov 24, 2003 at 06:21:07PM +0100, Alex Baretta wrote:
&gt; I am experiencing stack overflows while compiling a source file with 
&gt; 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:

export OCAMLRUNPARAM=l=16M

As for diagnosing the problem: I imagine the following would work:

(1) Chop your file in half around the 50% mark. (Don't chop in the
middle of a statement, or somewhere which would cause an error).

(2) If that compiles successfully, then repeat, but chopping at the
75% mark. Otherwise if it fails, repeat chopping at the 25% mark.

(3) Continue like so doing a binary search until you find out where it
crashes.

In the OLE case it appeared to crash simply because of the size of the
file, rather than any specific OCaml statement.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
"One serious obstacle to the adoption of good programming languages is
the notion that everything has to be sacrificed for speed. In computer
languages as in life, speed kills." -- Mike Vanier

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

