Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Alex Baretta <alex@baretta.com>
Cc: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocamlc stack overflow
Date: Mon, 24 Nov 2003 17:47:43 +0000	[thread overview]
Message-ID: <20031124174743.GA30052@redhat.com> (raw)
In-Reply-To: <3FC23E03.4030805@baretta.com>

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:

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


  reply	other threads:[~2003-11-24 17:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-24 17:21 Alex Baretta
2003-11-24 17:47 ` Richard Jones [this message]
2003-11-25 13:19   ` Alex Baretta
2003-11-25 14:06     ` Richard Jones
2003-11-25 15:10       ` [Caml-list] Ocamlc stack overflow (Probably a typechecking bug) Alex Baretta
2003-11-25 17:50     ` [Caml-list] Ocamlc stack overflow Xavier Leroy
2003-11-24 18:22 ` Damien Doligez
2006-08-04  1:03 ocamlc Stack_overflow Denis Bueno
2006-08-09  2:00 ` Denis Bueno
2006-08-09  2:54   ` [Caml-list] " Jon Harrop
2006-08-09  4:19   ` Martin Jambon
2006-08-09 13:41     ` Denis Bueno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031124174743.GA30052@redhat.com \
    --to=rich@annexia.org \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox