Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007847OCamllexing and parsingpublic2018-09-03 04:122018-09-06 10:18
Reportersmuenzel-js 
Assigned Togasche 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.07.0 
Target VersionFixed in Version4.08.0+dev 
Summary0007847: new parser hangs on some syntax errors
DescriptionThe following code results in a hang (in Parse.ml, around line 109):

external x : unit -> (int,int)`A.t = "x"
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0019329)
gasche (administrator)
2018-09-03 06:11

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.
(0019335)
gasche (administrator)
2018-09-03 16:28

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.
(0019336)
hhugo (reporter)
2018-09-03 17:03

The is the result of some experiment with afl fuzz
(0019338)
gasche (administrator)
2018-09-03 17:59

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.)
(0019342)
gasche (administrator)
2018-09-06 10:18

After some debugging by Frédéric Bour and myself, the issue was fixed by François Pottier in trunk:

  https://github.com/ocaml/ocaml/pull/2019 [^]

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!

- Issue History
Date Modified Username Field Change
2018-09-03 04:12 smuenzel-js New Issue
2018-09-03 06:11 gasche Note Added: 0019329
2018-09-03 16:28 gasche Note Added: 0019335
2018-09-03 16:58 gasche Status new => confirmed
2018-09-03 17:03 hhugo Note Added: 0019336
2018-09-03 17:59 gasche Note Added: 0019338
2018-09-06 10:18 gasche Note Added: 0019342
2018-09-06 10:18 gasche Status confirmed => resolved
2018-09-06 10:18 gasche Fixed in Version => 4.08.0+dev
2018-09-06 10:18 gasche Resolution open => fixed
2018-09-06 10:18 gasche Assigned To => gasche


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker