1

I have a Java Application that uses open-jdk 11.0.1 “2018-10-16” to build/run the application.

While opening the application, it tries to use the system's proxy configuration. For some PAC scripts it's throwing java.lang.StackOverflowError. The PAC script belongs to our user who isn't willing to share it.

java.lang.StackOverflowError
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterBinaryNode(LocalVariableTypesCalculator.java:445)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:332)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterJoinPredecessorExpression(LocalVariableTypesCalculator.java:778)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.JoinPredecessorExpression.accept(JoinPredecessorExpression.java:114)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.visitExpression(LocalVariableTypesCalculator.java:604)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterBinaryNode(LocalVariableTypesCalculator.java:448)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:332)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterJoinPredecessorExpression(LocalVariableTypesCalculator.java:778)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.JoinPredecessorExpression.accept(JoinPredecessorExpression.java:114)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.visitExpression(LocalVariableTypesCalculator.java:604)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterBinaryNode(LocalVariableTypesCalculator.java:448)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:332)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterJoinPredecessorExpression(LocalVariableTypesCalculator.java:778)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.JoinPredecessorExpression.accept(JoinPredecessorExpression.java:114)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.visitExpression(LocalVariableTypesCalculator.java:604)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterBinaryNode(LocalVariableTypesCalculator.java:448)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:332)
at jdk.scripting.nashorn/jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterJoinPredecessorExpression(LocalVariableTypesCalculator.java:778)
at jdk.scripting.nashorn/jdk.nashorn.internal.ir.JoinPredecessorExpression.accept(JoinPredecessorExpression.java:114)

Increasing the stack size fixed the issue, but is it possible to determine what kind of a PAC script would cause a recursive parsing like that? We use the proxy vole library and it seems the nashorn engine is parsing the JS expression.

I wasn't able to reproduce by simply using a large PAC script. I have created a PAC file with size of 2-10 MB and wasn't able to recreate the issue.

I am providing the StackOverflowError trace, which may help determine the nature of the JS expression which cause this. Thanks for the help.

Mandeep Y
  • 11
  • 2
  • Possibly a duplicate of https://stackoverflow.com/questions/72647713/standalone-nashorn-with-java-11-throws-java-lang-stackoverflowerror-upon-eval – Attila Szegedi Sep 05 '22 at 11:54

0 Answers0