Repository navigation
Description
GWT version: 2.10.0
Browser (with version):
Operating System:
Description
EmptyStackException when compiling with -compileReport option:
[java] Compiling module org.gwtsvg.edrawsvg
[java] Compiling 1 permutation
[java] Compiling permutation 0...
[java] Creating Stories file for the compile report
[java] [WARN] Could not write dependency file; proceeding anyway.
[java] java.util.EmptyStackException
[java] at java.util.Stack.peek(Stack.java:102)
[java] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[java] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[java] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:843)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:710)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:731)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:454)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
[java] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
[java] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[java] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[java] at java.lang.Thread.run(Thread.java:748)
[java] Compile of permutations succeeded
[java] Compilation succeeded -- 275,544s
The loop :
while (!dependencyScope.peek().range.contains(range)) {
popAndRecord(dependencyScope, fragment);
}
Should be:
while (!dependencyScope.isEmpty() && !dependencyScope.peek().range.contains(range)) {
popAndRecord(dependencyScope, fragment);
}
Activity
niloc132 commentedon Mar 4, 2023
Thanks, can you propose a pull request for this? This has come up a few times, but haven't gotten a complete patch for it.
See #9635 and #9602. Based on discussion there, it looks like there are two sites to fix for this.
DRAWSVG commentedon Mar 5, 2023
Hello,
I fix the bug on a local cloned repository with three modifications (once the first exception is fixed there are still two others.).
The report is produced on my project without exception (more than 3000 java classes with 60 split points).
The StoryRecorder code is quite confused, the correction should be validated by the author of the code.
Here the three corrections:
Line 172:
// Infer dependency information
while (!dependencyScope.isEmpty() && !dependencyScope.peek().range.contains(range)) {
/*
* Pop frames until we get back to a container, using this as a chance
* to build up our list of non-overlapping Ranges to report back to the
* user.
*/
popAndRecord(dependencyScope, fragment);
}
Line 272 (StringIndexOutOfBoundsException) :
SizeMapRecorder.escapeXml(jsCode, start, Math.min(end,jsCode.length()), false, builder);
Line 300 (EmptyStackException) :
if (lastEnd < toStore.getStart() && !dependencyScope.isEmpty()) {
niloc132 commentedon Mar 5, 2023
The original authors are no longer involved with this project, so we're relying on community members who take the time to find and understand a bug, and propose a fix. Standard github pull requests can be used to submit fixes, and we can help run tests etc to confirm the fix.
As an aside, a huge number of split points often comes with the symptom that many of those split points do not remove very much code - yet still add a substantial amount to the build time.
DRAWSVG commentedon Mar 5, 2023
I don't have write permissions on the project
niloc132 commentedon Mar 5, 2023
Correct. You need to fork the project, push a branch with your changes, and create a pull request.
Avoid EmptyStackException in SOYC (gwtproject#9808)