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

panic in process_wrapper #1209

Closed
UebelAndre opened this issue Mar 21, 2022 · 15 comments
Closed

panic in process_wrapper #1209

UebelAndre opened this issue Mar 21, 2022 · 15 comments
Labels

Comments

@UebelAndre
Copy link
Collaborator

Earlier today I ran into the following error when just running bazel test //... on 26e01c8.

ERROR: /Users/user/Code/rules_rust/tools/rust_analyzer/BUILD.bazel:4:12: Clippy tools/rust_analyzer/gen_rust_project.clippy.ok failed: (Exit 101): process_wrapper failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/util/process_wrapper/process_wrapper --arg-file ... (remaining 82 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', util/process_wrapper/main.rs:78:24

The best repo I'm able to come up with is by running the following command

bazel clean && bazel test //tools/rust_analyzer:gen_rust_project_clippy --noremote_accept_cached

I'm running Bazel 5.0.0 on my Mac.

@UebelAndre
Copy link
Collaborator Author

cc @gigaroby @hlopko

gigaroby added a commit to gigaroby/rules_rust that referenced this issue Mar 22, 2022
@gigaroby
Copy link
Contributor

Hey @UebelAndre, mind trying the PR I just sent to fix (or at least get more debug info) for this?

@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Mar 22, 2022

@gigaroby With the changes in #1214 I got the following

user@Users-MacBook-Pro rules_rust % bazel clean --expunge && bazel test //tools/rust_analyzer:gen_rust_project_clippy --noremote_accept_cached
INFO: Invocation ID: 30d1a7b0-aa83-4cca-bd88-13e938a67742
INFO: Starting clean.
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 888bd5a6-97ba-442c-9fbe-5aa740d2a48a
INFO: Analyzed target //tools/rust_analyzer:gen_rust_project_clippy (103 packages loaded, 3401 targets configured).
INFO: Found 1 target and 0 test targets...
ERROR: /Users/user/Code/rules_rust/tools/rust_analyzer/BUILD.bazel:4:12: Clippy tools/rust_analyzer/gen_rust_project.clippy.ok failed: (Exit 1): process_wrapper failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/util/process_wrapper/process_wrapper --arg-file ... (remaining 82 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
process wrapper error: subprocess does not have an exit code. core_dumped: false, signal: Some(6), stopped_signal: None
Target //tools/rust_analyzer:gen_rust_project_clippy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 66.955s, Critical Path: 36.16s
INFO: 183 processes: 117 internal, 66 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

@gigaroby
Copy link
Contributor

I can't repro this on linux, will try on my osx machine soon.

@illicitonion
Copy link
Collaborator

I reprod on macOS the first time I ran it, but can't repro again, no matter how much cleaning I do...

@gigaroby
Copy link
Contributor

@illicitonion is that with or without the changes in #1214?

@illicitonion
Copy link
Collaborator

Without - I tried reproing with but also didn't get a failure.

@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Mar 23, 2022

I seem to get it pretty consistently both with and without the changes. @illicitonion are you running the exact command I posted?

bazel clean --expunge && bazel test //tools/rust_analyzer:gen_rust_project_clippy --noremote_accept_cached

For some reason the --expunge does seem to play a factor here

@illicitonion
Copy link
Collaborator

Yep, exact command, can't repro after the first attempt... Very weird!

@scentini
Copy link
Collaborator

I can't repro at HEAD with Bazel 5.1.0, macOS. @UebelAndre could you provide the failing command line?

@UebelAndre
Copy link
Collaborator Author

@scentini Hey, is this what you want?
#1209 (comment)

@scentini
Copy link
Collaborator

Nah, i'd like to compare the arguments of the command that failed with mine.
bazel clean --expunge && bazel test //tools/rust_analyzer:gen_rust_project_clippy -s --noremote_accept_cached should give you what I want, or alternatively bazel aqery //tools/rust_analyzer:gen_rust_project_clippy.

@UebelAndre
Copy link
Collaborator Author

Nah, i'd like to compare the arguments of the command that failed with mine. bazel clean --expunge && bazel test //tools/rust_analyzer:gen_rust_project_clippy -s --noremote_accept_cached should give you what I want, or alternatively bazel aqery //tools/rust_analyzer:gen_rust_project_clippy.

Sorry for the delay, my GitHub notifications have been weird and not actually notifying me of activity. The aquery gives nothing because the clippy build targets don't have actions and I'm now not able to reproduce the issue using the command 😞. Sometime this week I'll tinker some more to find a better repro.

@snowp
Copy link

snowp commented Apr 14, 2022

I ran into this and spent some time debugging on macos. When running clippy directly from within the bazel sandbox (not via the process_wrapper), I got the following error:

azel-out/darwin-fastbuild/bin/loop/test/rust' --test -Dwarnings
clippy-driver(35435,0x305cb2000) malloc: *** error for object 0x600002a8d600: pointer being realloc'd was not allocated
clippy-driver(35435,0x305cb2000) malloc: *** set a breakpoint in malloc_error_break to debug

which lead me to this rust-lang/rust-clippy#8470, so it appears like this issue might be fixed in clippy 1.60 (my build was using 1.59)

EDIT: Bumping the rust toolchain version to 1.60 seems to resolve it for me, though I think the clippy crash isn't 100% reproducible

@UebelAndre
Copy link
Collaborator Author

Closing this out since the issue appears to be resolved post Rust 1.60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants