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 TAA17805; Sun, 13 Apr 2003 19:36:04 +0200 (MET DST) 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 TAA17979 for ; Sun, 13 Apr 2003 19:36:01 +0200 (MET DST) Received: from mail1.tpgi.com.au (mail.tpgi.com.au [203.12.160.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h3DHZwX04748 for ; Sun, 13 Apr 2003 19:35:58 +0200 (MET DST) Received: from ozemail.com.au (syd-ts20-2600-164.tpgi.com.au [203.213.127.164]) (authenticated (0 bits)) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h3DFgGr05485; Mon, 14 Apr 2003 01:42:22 +1000 Message-ID: <3E998557.60703@ozemail.com.au> Date: Mon, 14 Apr 2003 01:42:15 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Yang Shouxun CC: caml-list@inria.fr Subject: Re: [Caml-list] stack overflow References: <200304091010.37547.yangsx@fltrp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ozemail:01 caml-list:01 shouxun:01 dataset:01 50,000:99 bug:01 3.03:01 meg:99 froze:99 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Yang Shouxun wrote: > Dear OCaml users, > > I've written a modified version of C4.5 program in OCaml. However, when the > input is big, say over 50000, the program (native code on Debian) died for > stack overflow. Otherwise, it runs as expected. > > Can anybody explain possible reasons causing stack overflow in OCaml? Which version of Ocaml? For Linux, there is no way a tiny dataset like 50,000 elements could cause a stack overflow .. unless you're running an accounting package which limits the stack/memory of a process you get ALL of virtual memory for your stack. Yet I had this problem, and it turned out to be a code generation bug in Ocaml 3.03/4. That problem has been fixed in 3.05. The diagnostic I got, by the way, was not 'stack overflow' but 'out of memory' when the stack really did overflow: in my case non-tail recursive lexing was easy to make blow the stack with a 7 Meg file: it took minutes to dump, and the disk thrashed a lot .. the mouse froze .. and i couldn't kill the process :( If you are not getting these symptoms, it isn't a stack overflow. [I am, of course, talking about the i86 native code compiler] -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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