microbat icon indicating copy to clipboard operation
microbat copied to clipboard

[Instrumentation] Closure-8: Stackoverflow problem

Open llmhyy opened this issue 6 years ago • 1 comments

Hi Lyly,

Would you please also check the following problem?

Trace dumpfile: E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\trace\Closure\8\bug.exec
E:\linyun\bug_repo\jdk1.7.0_800\bin\java -Xmx30g -XX:+UseG1GC -ea -noverify -javaagent:E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\instrumentator.jar=precheck=false,excludes=java.util.Properties*,java_home=E:\linyun\bug_repo\jdk1.7.0_800,log=printProgress;error,working_dir=E:\linyun\bug_repo\Closure\8\bug,varLayer=1,expectedSteps=75496,overlong_methods=com.google.javascript.jscomp.CodeGenerator#add(Lcom/google/javascript/rhino/Node:Lcom/google/javascript/jscomp/CodeGenerator$Context:)V,stepLimit=1000000,require_method_split=false,launch_class=com.google.javascript.jscomp.CollapseVariableDeclarationsTest,class_path=E:\linyun\bug_repo\Closure\8\bug\build\test;E:\linyun\bug_repo\Closure\8\bug\build\classes;E:\linyun\bug_repo\Closure\8\bug\lib\ant-launcher.jar;E:\linyun\bug_repo\Closure\8\bug\lib\ant.jar;E:\linyun\bug_repo\Closure\8\bug\lib\args4j.jar;E:\linyun\bug_repo\Closure\8\bug\lib\caja-r4314.jar;E:\linyun\bug_repo\Closure\8\bug\lib\guava.jar;E:\linyun\bug_repo\Closure\8\bug\lib\jarjar.jar;E:\linyun\bug_repo\Closure\8\bug\lib\json.jar;E:\linyun\bug_repo\Closure\8\bug\lib\jsr305.jar;E:\linyun\bug_repo\Closure\8\bug\lib\junit.jar;E:\linyun\bug_repo\Closure\8\bug\lib\protobuf-java.jar;E:\linyun\bug_repo\Closure\8\bug\lib\rhino\testsrc\org\mozilla\javascript\tests\commonjs\module\modules.jar;E:\linyun\bug_repo\Closure\8\bug\build\lib\rhino.jar;E:\linyun\bug_repo\Closure\8\bug\build\lib\rhino1_7R4pre\js.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\junit.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\org.hamcrest.core.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\testrunner.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\bcel-6.0.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\javassist.jar,dump_file_path=E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\trace\Closure\8\bug.exec,avoid_proxy_tostring=true -cp E:\linyun\bug_repo\Closure\8\bug\build\test;E:\linyun\bug_repo\Closure\8\bug\build\classes;E:\linyun\bug_repo\Closure\8\bug\lib\ant-launcher.jar;E:\linyun\bug_repo\Closure\8\bug\lib\ant.jar;E:\linyun\bug_repo\Closure\8\bug\lib\args4j.jar;E:\linyun\bug_repo\Closure\8\bug\lib\caja-r4314.jar;E:\linyun\bug_repo\Closure\8\bug\lib\guava.jar;E:\linyun\bug_repo\Closure\8\bug\lib\jarjar.jar;E:\linyun\bug_repo\Closure\8\bug\lib\json.jar;E:\linyun\bug_repo\Closure\8\bug\lib\jsr305.jar;E:\linyun\bug_repo\Closure\8\bug\lib\junit.jar;E:\linyun\bug_repo\Closure\8\bug\lib\protobuf-java.jar;E:\linyun\bug_repo\Closure\8\bug\lib\rhino\testsrc\org\mozilla\javascript\tests\commonjs\module\modules.jar;E:\linyun\bug_repo\Closure\8\bug\build\lib\rhino.jar;E:\linyun\bug_repo\Closure\8\bug\build\lib\rhino1_7R4pre\js.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\junit.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\org.hamcrest.core.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\testrunner.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\bcel-6.0.jar;E:\linyun\software\eclipse-java-mars\eclipse-java-mars-clean\eclipse\dropins\junit_lib\javassist.jar microbat.evaluation.junit.MicroBatTestRunner com.google.javascript.jscomp.CollapseVariableDeclarationsTest testIssue820
progress: progress: =====java.lang.StackOverflowError
	at microbat.instrumentation.runtime.EmptyExecutionTracer.getInstance(EmptyExecutionTracer.java:7)
	at microbat.instrumentation.runtime.ExecutionTracer._getTracer(ExecutionTracer.java:1185)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)
	at com.google.javascript.rhino.jstype.JSType.toString(JSType.java:1241)
	at com.google.javascript.rhino.jstype.ArrowType.toStringHelper(ArrowType.java:289)

llmhyy avatar Dec 29 '18 08:12 llmhyy

This is actually the loop bug inside the Closure code itself. We have: class ArrowType extends JSType { @Override String toStringHelper(boolean forAnnotations) { return super.toString(); } }

while in JSType, we have method toString implemented as this: abstract class JSType { @Override public String toString() { return toStringHelper(false); }

abstract String toStringHelper(boolean forAnnotations); }

With above code, whenever ArrowType.toString() is called, there is a loop: ArrowType.toString() --> toStringHelper() --> toString() --> toStringHelper() --> ..

lylytran avatar Dec 31 '18 09:12 lylytran