Open ncordon opened 5 years ago
NegativeArraySizeException
may come from stack overflow trying to annotate an extremely deep AST.:
For the clarification, @kuba--'s example is from the file mentioned by the log.
Given that it indeed looks like stack overflow (or similar kind of issue), we may want to report it to CDT.
After some deep investigation, we can submit another issue to CDT, but I have a feeling that cdt-core
is almost frozen and nothing is going on there. I submitted a previous issue almost month ago, and nobody took a look, so far.
If there is no activity on PRs we should consider either forking it, or maybe use something else as the C/C++ parser.
switching to something else will require much more work, but fork sounds reasonable to me
Clang is an obvious choice, but migrating to a different C++ parser is likely to be a fairly involved project. Is the scope of the failure right now something that affects a lot of programs, or is it something we can afford to mitigate in a less-expensive way for now?
@creachadair It looks like it happens only on (real) C++ parser test files, not on files written by humans, so it may be safe to ignore. Also, according to the issue description, there is only two files that produce this error in the PGA (or other dataset used for the large parse by ML).
More details about CDT's
exception:
Error serializing the AST to JSON: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError)
java.lang.StackOverflowError at
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.checkForExplicitTypeConversion(CPPASTFunctionCallExpression.java:305)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.computeEvaluation(CPPASTFunctionCallExpression.java:286)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.getEvaluation(CPPASTFunctionCallExpression.java:277)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.computeEvaluation(CPPASTFunctionCallExpression.java:291)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.getEvaluation(CPPASTFunctionCallExpression.java:277)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.computeEvaluation(CPPASTFunctionCallExpression.java:291)
org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionCallExpression.getEvaluation(CPPASTFunctionCallExpression.java:277)
Shall we submit yet another issue to CDT and keep it blocked or just close it? I agree, the reproducible example is pretty artificial.
Let's keep it blocked.
From bblfsh logs we got the error:
Files that triggered the error: