bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.06k stars 4.04k forks source link

AssertionError using Dynamic execution #22482

Closed tomrenn closed 2 weeks ago

tomrenn commented 4 months ago

Description of the bug:

I'm upgrading our build from Bazel 6.4.0 to Bazel 7.X, and seeing the following crashes.

FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.AssertionError: Neither branch of prebuilts/studio/intellij-sdk/studio-sdk-plugin-org.intellij.plugins.markdown.info completed. Local was not cancelled and done and remote was cancelled and done.
    at com.google.devtools.build.lib.dynamic.DynamicSpawnStrategy.waitBranches(DynamicSpawnStrategy.java:427)
    at com.google.devtools.build.lib.dynamic.DynamicSpawnStrategy.exec(DynamicSpawnStrategy.java:224)
    at com.google.devtools.build.lib.exec.SpawnStrategyResolver.exec(SpawnStrategyResolver.java:45)
    at com.google.devtools.build.lib.analysis.actions.SpawnAction.execute(SpawnAction.java:261)
    at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.executeAction(SkyframeActionExecutor.java:1144)
    at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.run(SkyframeActionExecutor.java:1061)
    at com.google.devtools.build.lib.skyframe.ActionExecutionState.runStateMachine(ActionExecutionState.java:165)
    at com.google.devtools.build.lib.skyframe.ActionExecutionState.getResultOrDependOnFuture(ActionExecutionState.java:94)
    at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:558)
    at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:859)
    at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.computeInternal(ActionExecutionFunction.java:333)
    at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:171)
    at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:461)
    at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:414)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I'll see if I can reproduce this with a smaller project, I suspect a decently large project is needed with remote execution and dynamic scheduling.

Which operating system are you running Bazel on?

Windows

What is the output of bazel info release?

7.1.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

Yes, but it's hard to identify the commit between major Bazel versions.

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

I can share more internally.

tomrenn commented 4 months ago

I see the same crash happening on my linux builds as well.

tjgq commented 2 weeks ago

Please reopen with a repro.

cristifalcas commented 1 week ago

I also see this error when moving from 6.4 to 7.3

cristifalcas commented 1 week ago

it works if I try to build/test only parts if the repo, so maybe this needs a high number of actions/targets to trigger