Skip to content

CompileReport exceptionΒ #9804

Closed
Closed

Description

@DRAWSVG

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);
}

Steps to reproduce
Known workarounds
Links to further discussions

Activity

  1. niloc132 commented on Mar 4, 2023

    @niloc132
    Member

    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.

  2. DRAWSVG commented on Mar 5, 2023

    @DRAWSVG
    ContributorAuthor

    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()) {

  3. niloc132 commented on Mar 5, 2023

    @niloc132
    Member

    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.

  4. DRAWSVG commented on Mar 5, 2023

    @DRAWSVG
    ContributorAuthor

    I don't have write permissions on the project

  5. niloc132 commented on Mar 5, 2023

    @niloc132
    Member

    Correct. You need to fork the project, push a branch with your changes, and create a pull request.

  6. added a commit that references this issue on Mar 19, 2024
    9a35798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions