-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
syscall: exec_linux_test.go fails on CentOS 7 #16283
Comments
Are you building as root or some other user? |
CC @LK4D4 |
@luohoufu could you check if |
It may also help to run
That should show us exactly which system call is failing with |
@ianlancetaylor |
[root@snails src]# go test -c syscall |
@luohoufu heh, sorry to ask you again, but can you try if |
ah,i nerver use unshare,could you tell me how to use it as root user. |
@luan it's just command line utility. So, I'm doing it's just from my shell. |
I dont think centos 7 has userns enabled out of box? or maybe it's an selinux issue? |
@luohoufu try running
|
@jfrazelle i can't run with the comman d [root@snails boot]# unshare -h Usage: Run a program with some namespaces unshared from the parent. Options: -r, --map-root-user map current user to root (implies --user) --propagation <slave|shared|private|unchanged> modify mount propagation in mount namespace -s, --setgroups allow|deny control the setgroups syscall in user namespaces -h, --help display this help and exit For more details see unshare(1). [root@snails boot]# sestatus -v maybe the linux kernel bug with xen? |
What was the error when you ran the command giving help output doesn't help On Thursday, July 14, 2016, Tonny notifications@github.com wrote:
Jessie Frazelle |
Postponing to 1.8, since this only fails when run as root. |
@jfrazelle |
what about |
@jfrazelle |
Can you strace it "strace -ff unshare -Ur " On Monday, July 25, 2016, Tonny notifications@github.com wrote:
Jessie Frazelle |
@jfrazelle [root@snails src]# strace -ff unshare -Ur |
I can repro this in a centos VM so I will fix |
So the USER_NS support in centos 7 seems to be "fubar" (quoted from the first link) |
So, out of curiosity (I didn't see it mentioned earlier) you're doing this with 'user_namespace.enable=1' as a boot option to the kernel, correct? |
@jperrin thx, now i not continue research this issue,just like @jfrazelle analyse。USER_NS support not well(maybe a bug) in CentOS 7 VM. |
I have done some testing with both RHEL 7 and CentOS 7 kernel and I haven't been able to reproduce this issue. I guess the issue is that RHEL/CentOS 7 don't have the user namespaces enabled by default(and IIRC are not supported). You need to make sure to enable the user_namespace using the kernel boot parameter "user_namespace.enable=1". To verify the user_namsepaces are enabled use "cat /sys/module/user_namespace/parameters/enable". Double checking the "cat /proc/cmdline" might be good to. @luohoufu could you provide the output of the above cmds ? |
From the discussion, it sounds like this is not a Go problem but a CentOS 7 VM problem. Shall we close it? |
Yes it is a CentOS issue, +1 to close |
Fixes #20796 Fixes #16283 Change-Id: Ib11992fbd2bc1fbb3b14ae5a6bf0da2e4c12f641 Reviewed-on: https://go-review.googlesource.com/49311 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Change https://golang.org/cl/49311 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?master branch
What operating system and processor architecture are you using (
go env
)?centos 7 x86_64
What did you do?
build go from source
What did you expect to see?
build pass
What did you see instead?
--- FAIL: TestCloneNEWUSERAndRemapRootDisableSetgroups (0.00s)
exec_linux_test.go:81: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestCloneNEWUSERAndRemapRootEnableSetgroups (0.00s)
exec_linux_test.go:81: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestEmptyCredGroupsDisableSetgroups (0.00s)
exec_linux_test.go:129: fork/exec /usr/bin/whoami: invalid argument
--- FAIL: TestGroupCleanupUserNamespace (0.00s)
exec_linux_test.go:232: Cmd failed with err fork/exec /usr/bin/id: invalid argument, output:
FAIL
FAIL syscall
The text was updated successfully, but these errors were encountered: