New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new parser hangs on some syntax errors #7847
Comments
Comment author: @gasche Thanks for the report! The nontermination comes from the Parse.loop function, which seems to hit the HandlingError case infinitely often instead of progressing towards Rejected. |
Comment author: @gasche smuenzel-js: out of curiosity, how did you hit this issue? I'm curious at whether this comes from tests that you are running on your own, or casual usage of trunk. In any case, this is very useful. |
Comment author: @hhugo The is the result of some experiment with afl fuzz |
Comment author: @gasche Interesting! I hope that the harness setup will be made available for others to play with. (I have a perpetually-delayed side-project idea to do differential testing of OCaml implementations by combining https://github.com/jmid/efftester (the evaluation-order-aware code generator) and https://github.com/johnwhitington/ocamli (or another reference implementation.) |
Comment author: @gasche After some debugging by Frédéric Bour and myself, the issue was fixed by François Pottier in trunk: We believe that no other similar issue should pop up in the future with the current grammar, as it is due to a corner case (raising a parser-internal exception from a semantic action) which has now disappeared from the grammar. Thanks again for the prompt testing and reporting! |
[core_type_comma_list] with [core_type], as this is what is really intended: allow a single type. This removes the need for raising [Parsing.Parse_error] in the semantic action, and should fix bug ocaml#7847. This change alone would create a conflict in the grammar, which is avoided by replacing [core_type_comma_list] with [inline_core_type_comma_list] in two places.
Parser: fix bug ocaml#7847.
Original bug ID: 7847
Reporter: smuenzel-js
Assigned to: @gasche
Status: resolved (set by @gasche on 2018-09-06T08:18:14Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.07.0
Fixed in version: 4.08.0+dev/beta1/beta2
Category: lexing and parsing
Monitored by: smuenzel-js @nojb @hhugo @gasche
Bug description
The following code results in a hang (in Parse.ml, around line 109):
external x : unit -> (int,int)`A.t = "x"
The text was updated successfully, but these errors were encountered: