check_start_symbol crashes on a grammar whose first element is a type annotation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- ocaml
- Domain
- compilers
Research direction
Start at lib/checkSolverAst.ml:27 and trace how CheckSolverAst.verdict_of and check_solver_ast handle the first grammar element. Reproduce the crash with ta_first.gbl and the shown term, then verify that checking the grammar returns a verdict instead of aborting, with an explanatory start-symbol message if appropriate.
Written by the indexing model from the issue text.
Description
lib/checkSolverAst.ml:27 handles A.TypeAnnotation _ :: _ with Utils.crash "Unexpected case in check_start_symbol", so checking a term against a grammar whose first element is a type annotation aborts instead of returning a verdict.
Repro
ta_first.gbl:
<G> :: Int;
<S> ::= <G>;
Generation works fine:
$ goblin --file ta_first.gbl
(S@{0}[0] (G 76))
But CheckSolverAst.verdict_of / check_solver_ast on that same term:
CRASH: Internal error: Unexpected case in check_start_symbol
Notes
- Pre-existing: crashes identically on
9c1f1e9. - Worth fixing now that
verdict_ofis exported and load-bearing (it is the oracle used by the mutation corpus). A crash cannot be distinguished from a rejection by callers, and the mutation harness swallows exceptions, so a grammar in this shape would silently drop out of the corpus. - Returning
Violated/Unknownwith a message about the start symbol would be enough. Related: #30, on expect-failure tests not distinguishing crashes from graceful errors.
- Dominant language
- OCaml
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 57m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lorchrob/Goblin
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
mlir
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
llvm/llvm-project#224908 · 1 comment ·