Weird crash #2299

Closed
jart opened this Issue Feb 11, 2017 · 5 comments

Projects

None yet

2 participants

@jart
Member
jart commented Feb 11, 2017 edited

The compiler asked me to report this error. So here I am.

I'm using v20170124.

ERROR: /usr/local/REDACTED/_tmp/open_source_build_test_1/rules_closure/closure/templates/test/BUILD:162:1: Compiling 832 JavaScript files to closure/templates/test/greeter_idom_fail_bin.js failed: Worker process sent response with exit code: 1..
java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

Already found a mapping for inlining short name: patchInner
Node(GETPROP): bazel-out/local_linux-fastbuild/genfiles/third_party/javascript/incremental_dom/incremental-dom-closure.js:1611:0
exports.patchInner = patchInner;
Parent(ASSIGN): bazel-out/local_linux-fastbuild/genfiles/third_party/javascript/incremental_dom/incremental-dom-closure.js:1611:0
exports.patchInner = patchInner;

    at com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread(CompilerExecutor.java:126)
    at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:740)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:710)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:680)
    at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:1080)
    at com.google.javascript.jscomp.JsCompilerRunner.go(JsCompilerRunner.java:44)
    at com.google.javascript.jscomp.JsCompiler.run(JsCompiler.java:189)
    at com.google.javascript.jscomp.JsCompiler.apply(JsCompiler.java:78)
    at io.bazel.rules.closure.ClosureWorker.apply(ClosureWorker.java:56)
    at io.bazel.rules.closure.BazelWorker.runAsPersistentWorker(BazelWorker.java:98)
    at io.bazel.rules.closure.BazelWorker.apply(BazelWorker.java:74)
    at io.bazel.rules.closure.ClosureWorker.main(ClosureWorker.java:93)

Caused by: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

Already found a mapping for inlining short name: patchInner
Node(GETPROP): bazel-out/local_linux-fastbuild/genfiles/third_party/javascript/incremental_dom/incremental-dom-closure.js:1611:0
exports.patchInner = patchInner;
Parent(ASSIGN): bazel-out/local_linux-fastbuild/genfiles/third_party/javascript/incremental_dom/incremental-dom-closure.js:1611:0
exports.patchInner = patchInner;

    at com.google.common.base.Preconditions.checkState(Preconditions.java:518)
    at com.google.javascript.jscomp.ClosureRewriteModule.recordNameToInline(ClosureRewriteModule.java:1474)
    at com.google.javascript.jscomp.ClosureRewriteModule.recordExportToInline(ClosureRewriteModule.java:1468)
    at com.google.javascript.jscomp.ClosureRewriteModule.recordExportsPropertyAssignment(ClosureRewriteModule.java:1131)
    at com.google.javascript.jscomp.ClosureRewriteModule.access$1200(ClosureRewriteModule.java:81)
    at com.google.javascript.jscomp.ClosureRewriteModule$ScriptRecorder.shouldTraverse(ClosureRewriteModule.java:372)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:626)
    at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:715)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:639)
    at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:715)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:639)
    at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:715)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:639)
    at com.google.javascript.jscomp.NodeTraversal.traverse(NodeTraversal.java:316)
    at com.google.javascript.jscomp.NodeTraversal.traverseEs6(NodeTraversal.java:586)
    at com.google.javascript.jscomp.ClosureRewriteModule.processAllFiles(ClosureRewriteModule.java:650)
    at com.google.javascript.jscomp.ClosureRewriteModule.process(ClosureRewriteModule.java:634)
    at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:296)
    at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:228)
    at com.google.javascript.jscomp.Compiler.check(Compiler.java:873)
    at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:766)
    at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:84)
    at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:713)
    at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:710)
    at com.google.javascript.jscomp.CompilerExecutor$2.call(CompilerExecutor.java:91)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.IllegalStateException: Already found a mapping for inlining short name: patchInner
... 29 more

Here's a deterministic hermetically sealed jar that will reproduce the crash if you run bazel test //closure/....

I'm still investigating what this means.

@jart
Member
jart commented Feb 11, 2017

Forgot to attach the tarball.
rules_closure.tar.gz

@jart
Member
jart commented Feb 11, 2017

Here's the file in question.
incremental-dom-closure.js.txt

It's a goog.module. Here are two lines near the end:

exports.patch = patchInner;
exports.patchInner = patchInner;

If I remove the first then it builds.

@jart
Member
jart commented Feb 11, 2017

I found a workaround that will most likely work:

/**
 * Patches the document starting at node with the provided function. This
 * function may be called during an existing patch operation.
 * @param {!Element|!DocumentFragment} node The Element or Document
 *     to patch.
 * @param {!function(T)} fn A function containing elementOpen/elementClose/etc.
 *     calls that describe the DOM.
 * @param {T=} data An argument passed to fn to represent DOM state.
 * @return {!Node} The patched node.
 * @template T
 */
const patchInnerDelegate = function(node, fn, data) {
  return patchInner(node, fn, data);
};

exports.patch = patchInnerDelegate;
exports.patchInner = patchInner;
@MatrixFrog
Member

This might possibly be fixed by db7a7b4

@jart
Member
jart commented Feb 11, 2017

Looks like the exact fix. I'll close this out then and just remove the hack when the next release rolls around.

@jart jart closed this Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment