Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird crash #2299

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

Weird crash #2299

jart opened this issue Feb 11, 2017 · 5 comments

Comments

@jart
Copy link
Contributor

jart commented Feb 11, 2017

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
Copy link
Contributor Author

jart commented Feb 11, 2017

Forgot to attach the tarball.
rules_closure.tar.gz

@jart
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

This might possibly be fixed by db7a7b4

@jart
Copy link
Contributor Author

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 as completed Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants