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 LAA05672; Mon, 13 May 2002 11:21:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA05600 for ; Mon, 13 May 2002 11:21:30 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4D9LTr24603 for ; Mon, 13 May 2002 11:21:29 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id LAA0000013377; Mon, 13 May 2002 11:21:28 +0200 (MET DST) From: Luc Maranget Message-Id: <200205130921.LAA0000013377@beaune.inria.fr> Subject: Re: [Caml-list] Bug in typing polymorphic variants found To: garrigue@kurims.kyoto-u.ac.jp (Jacques Garrigue) Date: Mon, 13 May 2002 11:21:28 +0200 (MET DST) Cc: skaller@ozemail.com.au, caml-list@inria.fr In-Reply-To: <20020513154639Z.garrigue@kurims.kyoto-u.ac.jp> from "Jacques Garrigue" at mai 13, 2002 03:46:39 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I expect there is a bug somewhere in your program... > > It is a good idea to make your makefiles to work with both ocamlc and > ocamlopt, because ocamlc gives you much more debugging information. > Some segmentation faults with ocamlopt give actually informative > errors with ocamlc. > > By the way, I got errors trying to compile felix, because there was an > old src/flx_parse.ml, which should not be there. > I did the same thing, and even ran felix under ocamldebug (another reason to use both bytecode and native compilation) 1. I has to alter Flx_lex to compile (suppress a self reference to the Flx_lex module) 2. By running the example (run), until it crashed going back (back) in execution a little, and looking at the call stack (backtrace), I found the loop : #52327 Pc : 242856 Flx_pretok char 6183 #52328 Pc : 242856 Flx_pretok char 6183 #52329 Pc : 242856 Flx_pretok char 6183 #52330 Pc : 242856 Flx_pretok char 6183 #52331 Pc : 242856 Flx_pretok char 6183 #52332 Pc : 242856 Flx_pretok char 6183 #52333 Pc : 242856 Flx_pretok char 6183 etc... Apparently the loop is in module Flx_pretok : let pre_tokens_of_lexbuf buf state = let lex_it() = Flx_lex.pre_flx_lex buf state in let run = ref true in let rec get () = if !run then let t = lex_it () in match t with | [Flx_parse.ENDMARKER] -> run := false; [Flx_parse.ENDMARKER] | _ -> t @ get() <------- HERE is the recursive call else [Flx_parse.ENDMARKER] in get () Hope it helps, --Luc ------------------- 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