From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA07859; Mon, 24 Nov 2003 18:47:49 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA09051 for ; Mon, 24 Nov 2003 18:47:48 +0100 (MET) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAOHll107390 for ; Mon, 24 Nov 2003 18:47:47 +0100 (MET) Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1AOKoJ-0007pA-00; Mon, 24 Nov 2003 17:47:43 +0000 Date: Mon, 24 Nov 2003 17:47:43 +0000 To: Alex Baretta Cc: Ocaml Subject: Re: [Caml-list] Ocamlc stack overflow Message-ID: <20031124174743.GA30052@redhat.com> References: <3FC23E03.4030805@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FC23E03.4030805@baretta.com> User-Agent: Mutt/1.5.4i From: Richard Jones X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ocamlc:01 baretta:01 overflows:01 ocamlc:01 chop:01 chop:01 compiles:01 75%:99 crashes:01 freshmeat:01 obstacle:01 vanier:01 ltd:98 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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