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

Sandbox should print better error message on execvp failure #1719

Closed
philwo opened this issue Sep 3, 2016 · 2 comments
Closed

Sandbox should print better error message on execvp failure #1719

philwo opened this issue Sep 3, 2016 · 2 comments
Assignees
Labels
category: sandboxing P2 We'll consider working on this in future. (Assignee optional) type: bug
Milestone

Comments

@philwo
Copy link
Member

philwo commented Sep 3, 2016

Reported by user here: https://groups.google.com/forum/#!msg/bazel-discuss/T5KRcV5k9aA/Sdk07EC5BQAJ

The sandbox gave this rather unhelpful error log when it tried to execute a non-existing file:

$ bazel build  --sandbox_debug /base:hello_world
INFO: Found 1 target...
ERROR: /home/michiel/src/renew/base/BUILD:8:1: C++ compilation of rule '//base:hello_world' failed: linux-sandbox failed: error executing command /home/michiel/.cache/bazel/_bazel_michiel/b2baa5abb6f86343b08f67d0e9096f8a/execroot/renew/_bin/linux-sandbox ... (remaining 33 argument(s) skipped).
src/main/tools/linux-sandbox-pid1.cc:180: tmpfs: /tmp
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/dev
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/dev/pts
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run/lock
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run/shm
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run/user
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run/user/1000/gvfs
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/run/rpc_pipefs
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/fs/cgroup
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/fs/cgroup/systemd
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/fs/fuse/connections
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/kernel/debug
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/kernel/security
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/sys/fs/pstore
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/proc
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/proc/sys/fs/binfmt_misc
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/home
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/usr/local
src/main/tools/linux-sandbox-pid1.cc:298: remount ro: /tmp/sandbox.rwVjx7/nas
src/main/tools/linux-sandbox-pid1.cc:298: remount rw: /tmp/sandbox.rwVjx7/tmp
src/main/tools/linux-sandbox-pid1.cc:298: remount rw: /tmp/sandbox.rwVjx7/home/michiel/.cache/bazel/_bazel_michiel/b2baa5abb6f86343b08f67d0e9096f8a/bazel-sandbox/4e0fb7f2-101d-4dc9-84df-d4fc72a07078-0/execroot
src/main/tools/linux-sandbox-pid1.cc:439: "execvp(0x7ffc80bb8bc9, 0x8e8980)": No such file or directory

It would be great if we could print the actual path used in execvp() here.

@philwo philwo added type: bug P2 We'll consider working on this in future. (Assignee optional) category: sandboxing labels Sep 3, 2016
@philwo philwo added this to the 0.4 milestone Sep 3, 2016
@philwo philwo self-assigned this Sep 3, 2016
@damienmg
Copy link
Contributor

ping @philwo: can this be done this week?

@philwo
Copy link
Member Author

philwo commented Oct 13, 2016

I'm sending a fix for this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: sandboxing P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

2 participants