bazelbuild / bazelbuild/bazel

Crash when using the label `.`

Open
#16,631 3 comments 0 reactions 1 assignee Assigned to @lberki View on GitHub
P2 team-Configurability type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

The reproduction below results in the following crash dump:
```
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=ConfiguredTargetKey{label=//:g, config=BuildConfigurationKey[48c1c753c46f7eb7039a95fea1c0b52e0eb7bf7ec7ee66372bade8e0330f99c3]}, actionIndex=0}' (requested by nodes 'TargetCompletionKey{topLevelArtifactContext=com.google.devtools.build.lib.analysis.TopLevelArtifactContext@90904c3b, actionLookupKey=ConfiguredTargetKey{label=//:g, config=BuildConfigurationKey[48c1c753c46f7eb7039a95fea1c0b52e0eb7bf7ec7ee66372bade8e0330f99c3]}, willTest=false}')
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:642)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.google.devtools.build.lib.sandbox.SandboxHelpers.createDirectories(SandboxHelpers.java:327)
at com.google.devtools.build.lib.sandbox.AbstractContainerizingSandboxedSpawn.createFileSystem(AbstractContainerizingSandboxedSpawn.java:116)
at com.google.devtools.build.lib.sandbox.AbstractSandboxSpawnRunner.runSpawn(AbstractSandboxSpawnRunner.java:138)
at com.google.devtools.build.lib.sandbox.AbstractSandboxSpawnRunner.exec(AbstractSandboxSpawnRunner.java:105)
at com.google.devtools.build.lib.sandbox.SandboxModule$SandboxFallbackSpawnRunner.exec(SandboxModule.java:492)
at com.google.devtools.build.lib.exec.SpawnRunner.execAsync(SpawnRunner.java:299)
at com.google.devtools.build.lib.exec.AbstractSpawnStrategy.exec(AbstractSpawnStrategy.java:152)
at com.google.devtools.build.lib.exec.AbstractSpawnStrategy.exec(AbstractSpawnStrategy.java:112)
at com.google.devtools.build.lib.actions.SpawnStrategy.beginExecution(SpawnStrategy.java:47)
at com.google.devtools.build.lib.exec.SpawnStrategyResolver.beginExecution(SpawnStrategyResolver.java:64)
at com.google.devtools.build.lib.analysis.actions.SpawnAction.beginExecution(SpawnAction.java:352)
at com.google.devtools.build.lib.actions.Action.execute(Action.java:133)
...
```

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

```
touch WORKSPACE
cat > BUILD <<'EOF'
genrule(
name = "g",
srcs = ["."],
outs = ["go"],
cmd = "echo RUN; echo X > $@",
)
EOF
bazel build :g
```

### Which operating system are you running Bazel on?

Linux

### What is the output of `bazel info release`?

Tried with Bazel at HEAD, also happens with 5.3.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 master; git rev-parse HEAD` ?

```text
bbc221f60bc8c9177470529d85c3e47a5d9aaf21
```

### Have you found anything relevant by searching the web?

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.