Closed dragos closed 2 years ago
@janekdb interested in looking at this...?
I will try to take a look. One benefit of the sys.exit calls is in the increased chance of generating a bug report :)
I can't reproduce the problem on Scala 2.12.16, 2.13.8, and 3.1.3. @SethTisue could you also check this and close if don't reproduce it?
The current sources for table-sourcing have a number of calls to sys.error
, but none to sys.exit
(or System.exit
).
And when I look at the original PR where table parsing first landed (https://github.com/scala/scala/pull/6043), I don't see any exit
calls in the diffs there, either. So perhaps Iulian meant sys.error
.
User error (such as invalid Scaladoc syntax) should never result in sys.error
being called. So if any of the sys.error
calls are actually triggerable by user input, we still have bugs here, because user error should result in a proper error, not just a stack trace.
My ambition level on this doesn't extend to auditing the sys.error
calls and trying to determine what kind of user input might trigger them. As you saw, Iulian's original test case no longer produces an error.
So yeah, let's close this. Yes, there might still be other ways to make Scaladoc crash. If someone finds one (either accidentally, or by auditing the sites where sys.error
appears), we can make a new ticket for that.
The OP means sys.error
.
I, too, am unable to reproduce with any obsolete version.
The unhelpful code comment is that the second warning is unreachable: https://github.com/scala/scala/blob/v2.13.8/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala#L718-L720
I see Seth is awake. I tried fileformat=mac
(which TIL) but also doesn't crash FSR. The code is checking for \n
which must be wrong. The compiler reader is more forgiving about line endings.
The blog is at https://scala-lang.org/blog/2018/10/04/scaladoc-tables.html
Sorry about the confusion, indeed I should have written sys.error
. Glad to hear it's not longer a problem, regardless of who fixed it and how
reproduction steps
problem
There are a lot of
sys.exit
calls in the table parser, I think none of them should crash the scaladoc tool. Also, I couldn't find any mention of scaladoc table syntax. :)