Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@ozemail.com.au>
To: Luc Maranget <luc.maranget@inria.fr>
Cc: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>, caml-list@inria.fr
Subject: Re: [Caml-list] Bug in typing polymorphic variants found
Date: Tue, 14 May 2002 02:35:05 +1000	[thread overview]
Message-ID: <3CDFEB39.6010907@ozemail.com.au> (raw)
In-Reply-To: <200205130921.LAA0000013377@beaune.inria.fr>

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


  reply	other threads:[~2002-05-13 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-02 11:26 [Caml-list] OCaml-announcements Oliver Bandel
2002-05-07 13:43 ` Xavier Leroy
2002-05-07 14:42   ` Remi VANICAT
2002-05-07 16:05     ` Matt Armstrong
2002-05-08 14:58   ` [Caml-list] Weird bug John Max Skaller
2002-05-08 15:45     ` John Max Skaller
2002-05-08 20:10       ` [Caml-list] Bug in typing polymorphic variants found John Max Skaller
2002-05-10 15:02         ` Luc Maranget
2002-05-10 16:43           ` John Max Skaller
2002-05-13  6:46             ` Jacques Garrigue
2002-05-13  9:21               ` Luc Maranget
2002-05-13 16:35                 ` John Max Skaller [this message]
2002-05-13 16:05               ` John Max Skaller

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=3CDFEB39.6010907@ozemail.com.au \
    --to=skaller@ozemail.com.au \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    --cc=luc.maranget@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