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

0.26.0rc8 crash with experimental_execution_log_file #8364

Closed
keith opened this issue May 16, 2019 · 6 comments
Closed

0.26.0rc8 crash with experimental_execution_log_file #8364

keith opened this issue May 16, 2019 · 6 comments

Comments

@keith
Copy link
Member

keith commented May 16, 2019

When building with 0.26.0rc8 and passing experimental_execution_log_file, bazel crashes with:

Internal error thrown during build. Printing stack trace: java.lang.IllegalArgumentException
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
        at com.google.devtools.build.lib.vfs.FileSystem.getPath(FileSystem.java:78)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.initOutputs(SpawnLogModule.java:94)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.executorInit(SpawnLogModule.java:119)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.<init>(ExecutionTool.java:137)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:151)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
        at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
        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)

INFO: Elapsed time: 4.007s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
Internal error thrown during build. Printing stack trace: java.lang.IllegalArgumentException
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
        at com.google.devtools.build.lib.vfs.FileSystem.getPath(FileSystem.java:78)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.initOutputs(SpawnLogModule.java:94)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.executorInit(SpawnLogModule.java:119)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.<init>(ExecutionTool.java:137)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:151)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
        at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
        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)
java.lang.IllegalArgumentException
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
        at com.google.devtools.build.lib.vfs.FileSystem.getPath(FileSystem.java:78)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.initOutputs(SpawnLogModule.java:94)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.executorInit(SpawnLogModule.java:119)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.<init>(ExecutionTool.java:137)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:151)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
        at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
        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)
java.lang.IllegalArgumentException
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
        at com.google.devtools.build.lib.vfs.FileSystem.getPath(FileSystem.java:78)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.initOutputs(SpawnLogModule.java:94)
        at com.google.devtools.build.lib.bazel.SpawnLogModule.executorInit(SpawnLogModule.java:119)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.<init>(ExecutionTool.java:137)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:151)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
        at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
FAILED: Build did NOT complete successfully

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

bazel-bin/src/bazel build src:bazel --experimental_execution_log_file=foo.log

What operating system are you running Bazel on?

Ubuntu 16.04 or macOS

What's the output of bazel info release?

release 0.26.0rc8

Have you found anything relevant by searching the web?

@laurentlb
Copy link
Contributor

cc @agoulti, @buchgr

Can you look at this?
Should it be replaced with execution_log_json_file?

(General comment regarding the release policy: experimental flags are normally not supported and shouldn't qualify for cherry-picks. However, I'm not familiar with this particular case, I'll let other people comment on it)

@keith
Copy link
Member Author

keith commented May 16, 2019

I'm happy to replace our case with execution_log_json_file if that's the solution. With rc8 that doesn't crash

@keith
Copy link
Member Author

keith commented May 16, 2019

With this new flag I'm still seeing issues on macOS and ubuntu:

WARNING: Execution log might not have been populated. Raw execution log is at /tmp/exec5665122725438342177.log
Internal error thrown during build. Printing stack trace: java.lang.IllegalArgumentException
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
	at com.google.devtools.build.lib.bazel.execlog.StableSort.lambda$stableSort$0(StableSort.java:100)
	at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Unknown Source)
	at java.base/java.util.PriorityQueue.siftUpUsingComparator(Unknown Source)
	at java.base/java.util.PriorityQueue.siftUp(Unknown Source)
	at java.base/java.util.PriorityQueue.offer(Unknown Source)
	at java.base/java.util.PriorityQueue.add(Unknown Source)
	at com.google.devtools.build.lib.bazel.execlog.StableSort.stableSort(StableSort.java:116)
	at com.google.devtools.build.lib.bazel.execlog.StableSort.stableSort(StableSort.java:60)
	at com.google.devtools.build.lib.bazel.SpawnLogModule.afterCommand(SpawnLogModule.java:142)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:580)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:506)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
	at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
	at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
	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)
java.lang.IllegalArgumentException

@agoulti
Copy link

agoulti commented May 17, 2019

So the problem with --experimental_execution_log_file manifests itself when the relative path is used.
I will submit a fix shortly. Absolute path should work.

The problem with execution_log_json_file is a violated assumption: the stableSort algorithm assumes that all the actions have outputs, and the log violates that assumption. Would you be willing to share what kind of action produced this error? (in the execution log it would be an action with an empty set of actual output files)

@buchgr
Copy link
Contributor

buchgr commented May 17, 2019

the stableSort algorithm assumes that all the actions have outputs, and the log violates that assumption.

that's generally not true ... sounds like we should patch the algorithm to no longer assume this. should be easy enough?

@keith
Copy link
Member Author

keith commented May 17, 2019

Here's a "raw" log from the command before bazel crashes: foo.log

It still seems to be parseable with execlog:parser, let me know if you want something else

aehlig pushed a commit that referenced this issue May 20, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
aehlig pushed a commit that referenced this issue May 21, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
aehlig pushed a commit that referenced this issue May 22, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
aehlig pushed a commit that referenced this issue May 23, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
aehlig pushed a commit that referenced this issue May 23, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
aehlig pushed a commit that referenced this issue May 24, 2019
Fixes #8364

RELNOTES: None
PiperOrigin-RevId: 248786565
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
Fixes bazelbuild#8364

RELNOTES: None
PiperOrigin-RevId: 248786565
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

4 participants