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 SAA22061; Mon, 13 May 2002 18:35:17 +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 SAA22076 for ; Mon, 13 May 2002 18:35:16 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4DGZA925141; Mon, 13 May 2002 18:35:10 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g4DGZ8Xt022192; Tue, 14 May 2002 02:35:08 +1000 (EST) Received: from ozemail.com.au (ppp71.dyn145.pacific.net.au [210.23.145.71]) by wisma.pacific.net.au with ESMTP id CAA19727; Tue, 14 May 2002 02:35:06 +1000 (EST) Message-ID: <3CDFEB39.6010907@ozemail.com.au> Date: Tue, 14 May 2002 02:35:05 +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: Luc Maranget CC: Jacques Garrigue , caml-list@inria.fr Subject: Re: [Caml-list] Bug in typing polymorphic variants found References: <200205130921.LAA0000013377@beaune.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Luc Maranget wrote: > >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) > Funny. Must be CVS change. It compiles on my system. [Yes, I see the self reference ..] > >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 () > The above code has been working for 2 years. It hasn't been changed in 2 years. It is an infinite loop, which is terminated by finding an ENDMARKER token in the code. This token is generated by the lexer at end of file. | eof { fun state -> [ENDMARKER] } The parser creates a lot of polymorphic variants. It also takes *ages* to compile since a recent change I made: that change contains several 3 step type coercions: (a : t1 :> t2) Perhaps the parser is overflowing some table limit? -- 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