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

syscall: TestUnshare failure #22391

Closed
dvn0 opened this issue Oct 23, 2017 · 24 comments
Closed

syscall: TestUnshare failure #22391

dvn0 opened this issue Oct 23, 2017 · 24 comments

Comments

@dvn0
Copy link

@dvn0 dvn0 commented Oct 23, 2017

What version of Go are you using (go version)?

I'm using go1.4-bootstrap-20170531 to build 1.8.3

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64" 
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/tmp/go"
GOTOOLDIR="/tmp/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

./all.bash

What did you expect to see?

Build successful

What did you see instead?

ok      net/internal/socktest   0.002s
ok      net/mail        0.005s
ok      net/rpc 0.013s
ok      net/rpc/jsonrpc 0.014s
ok      net/smtp        0.021s
ok      net/textproto   0.003s
ok      net/url 0.005s
ok      os      0.261s
ok      os/exec 0.114s
ok      os/signal       4.243s
ok      os/user 0.002s
ok      path    0.008s
ok      path/filepath   0.006s
ok      reflect 0.101s
ok      regexp  0.097s
ok      regexp/syntax   0.217s
ok      runtime 17.272s
ok      runtime/debug   0.006s
ok      runtime/internal/atomic 0.134s
ok      runtime/internal/sys    0.002s
ok      runtime/pprof   1.236s
ok      runtime/pprof/internal/protopprof       0.018s
ok      runtime/trace   2.405s
ok      sort    0.042s
ok      strconv 0.318s
ok      strings 0.075s
ok      sync    0.137s
ok      sync/atomic     0.031s
--- FAIL: TestUnshare (0.00s)
        exec_linux_test.go:177: Cmd failed with err fork/exec /bin/cat: operation not permitted, output: 
FAIL
FAIL    syscall 0.020s
ok      testing 1.575s
ok      testing/quick   0.050s
ok      text/scanner    0.002s
ok      text/tabwriter  0.003s
ok      text/template   0.204s
ok      text/template/parse     0.030s
ok      time    2.343s
ok      unicode 0.003s
ok      unicode/utf16   0.014s
ok      unicode/utf8    0.005s
ok      vendor/golang_org/x/crypto/chacha20poly1305     0.029s
ok      vendor/golang_org/x/crypto/chacha20poly1305/internal/chacha20   0.002s
ok      vendor/golang_org/x/crypto/curve25519   0.014s
ok      vendor/golang_org/x/crypto/poly1305     0.017s
ok      vendor/golang_org/x/net/http2/hpack     0.005s
ok      vendor/golang_org/x/net/idna    0.004s
ok      vendor/golang_org/x/net/lex/httplex     0.013s
ok      cmd/addr2line   0.506s
ok      cmd/api 0.006s
ok      cmd/asm/internal/asm    0.154s
ok      cmd/asm/internal/lex    0.003s
ok      cmd/compile     3.621s
ok      cmd/compile/internal/gc 6.388s
ok      cmd/compile/internal/ssa        0.244s
ok      cmd/compile/internal/syntax     0.026s
ok      cmd/compile/internal/test       0.002s [no tests to run]
ok      cmd/cover       0.858s
ok      cmd/doc 0.064s
ok      cmd/fix 0.008s
ok      cmd/go  34.673s
ok      cmd/gofmt       0.035s
ok      cmd/internal/goobj      0.002s
ok      cmd/internal/obj        0.002s
ok      cmd/internal/obj/arm64  0.002s
ok      cmd/internal/obj/x86    0.014s
ok      cmd/link        1.782s
ok      cmd/nm  0.373s
ok      cmd/objdump     0.966s
ok      cmd/pack        0.911s
ok      cmd/trace       0.004s
ok      cmd/vendor/golang.org/x/arch/arm/armasm 0.004s
ok      cmd/vendor/golang.org/x/arch/ppc64/ppc64asm     0.003s
ok      cmd/vendor/golang.org/x/arch/x86/x86asm 0.108s
ok      cmd/vet 1.219s
ok      cmd/vet/internal/cfg    0.003s
2017/10/23 09:03:09 Failed: exit status 1
@davecheney
Copy link
Contributor

@davecheney davecheney commented Oct 23, 2017

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

I was not clear in my initial issue... I'm using the bootstrap compiler to build go1.8.3

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

  • You don't need go1.4-bootstrap to build the 1.8 compiler on linux/amd64, you can bootstrap with the binaries from https://golang.org/dl/

  • If for some reason you really want to bootstrap using go1.4, don't use all.bash, use make.bash, which builds the toolchain without running the old 1.4 tests. This is documented:

After unpacking the Go 1.4 source, cd to the src subdirectory and run make.bash

https://golang.org/doc/install/source

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

@ALTree

You don't need go1.4-bootstrap to build the 1.8 compiler on linux/amd64, you can bootstrap with the binaries from https://golang.org/dl/

Trying to understand what you mean here... Are you just suggesting I download the 1.8.x binary instead of trying to build it from source?

If for some reason you really want to bootstrap using go1.4, don't use all.bash, use make.bash, which builds the toolchain without running the old 1.4 tests. This is documented: ...

I have read, and followed that documentation, but that is for building go1.4, which I have already done successfully. I will try running make.bash in the 1.8.3 checkout, and post the results of that, but that's not what the documentation says to do.

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

Okay, that wasn't very clear. Now it's clear. No need to mention go1.4-bootstrap: you are seeing test failures when running all.bash in go1.8.3.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

Running make.bash in the 1.8.3 checkout succeeded. Though, I think this is just because it doesn't run the tests.

@ALTree ALTree changed the title Build Tests Fail After cmd/vet/internal/cfg syscall: go1.8.3 TestUnshare failure Oct 23, 2017
@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

Can you try running all.bash with a go1.9.1 source on your system (i.e. doing the same exact thing you did but with go1.9 instead of go1.8)? Does the test still fail?

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

Yes, I have tried that, and the test still fails.

@ALTree ALTree changed the title syscall: go1.8.3 TestUnshare failure syscall: TestUnshare failure Oct 23, 2017
@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

So this is also failing on the current go release. Nice, thanks for the report.

Labelling this as NeedsInvestigation.

@ALTree ALTree added this to the Go1.10 milestone Oct 23, 2017
@ALTree ALTree added the Testing label Oct 23, 2017
@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

Similar failures we saw in the past: #16283 #20796 were caused by faulty (insufficiently strict) Skip logic.

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

Trying to understand what you mean here... Are you just suggesting I download the 1.8.x binary instead of trying to build it from source?

If you are on linux/amd64: yes. There's no need to compile the toolchain by yourself.

Actually you should download the go1.9.1 binary, there's no reason to use an old version.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

Actually you should download the go1.9 binary, there's no reason to use an old version.

I need to build Go from source for my use-case, and specifically version 1.8.3.

This is for a project, in which 1.8.3 has been extensively tested, and verified to work properly.

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

I need to build Go from source for my use-case, and specifically version 1.8.3.

Then it's fine to build from source. But even then, you don't need go1.4. You can use a go1.9.1 binary to bootstrap.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

I don't want to bootstrap with an unverifiable, and currently (in my case) non-reproducible binary. I was doing my best to avoid this discussion, however. :)

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 23, 2017

This is almost certainly #17206, which is fixed in the 1.9 release. The fix was to simply ignore the error, as it is apparently unavoidable on certain systems, so for 1.8.3 that is what you should do.

Closing because we aren't going to fix this in 1.8.3.

@ALTree
Copy link
Member

@ALTree ALTree commented Oct 23, 2017

No problem. Let's keep this thread about the go1.9.1 syscall test failure you reported, then.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 23, 2017

Sorry, I missed that this was apparently seen in 1.9.1. I don't see how that is possible, but I'll reopen. Please tell us precisely what you do when building with 1.9.1, and precisely what happened. Thanks.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

Here's a pretty large excerpt of the results from running all.bash in the go1.9.1 checkout.

ok      hash/fnv        0.012s
ok      html    0.001s
ok      html/template   0.031s
ok      image   0.075s
ok      image/color     0.025s
ok      image/draw      0.030s
ok      image/gif       0.064s
ok      image/jpeg      0.177s
ok      image/png       0.028s
ok      index/suffixarray       0.004s
ok      internal/cpu    0.001s
ok      internal/poll   0.004s
ok      internal/singleflight   0.016s
ok      internal/trace  0.476s
ok      io      0.017s
ok      io/ioutil       0.020s
ok      log     0.001s
ok      log/syslog      1.223s
ok      math    0.001s
ok      math/big        1.468s
ok      math/bits       0.001s
ok      math/cmplx      0.001s
ok      math/rand       0.066s
ok      mime    0.003s
ok      mime/multipart  0.378s
ok      mime/quotedprintable    0.118s
ok      net     0.926s
ok      net/http        2.948s
ok      net/http/cgi    0.256s
ok      net/http/cookiejar      0.028s
ok      net/http/fcgi   0.002s
ok      net/http/httptest       0.041s
ok      net/http/httptrace      0.002s
ok      net/http/httputil       0.021s
ok      net/http/internal       0.021s
ok      net/internal/socktest   0.002s
ok      net/mail        0.002s
ok      net/rpc 0.014s
ok      net/rpc/jsonrpc 0.004s
ok      net/smtp        0.007s
ok      net/textproto   0.002s
ok      net/url 0.003s
ok      os      0.311s
ok      os/exec 0.445s
ok      os/signal       4.370s
ok      os/user 0.002s
ok      path    0.005s
ok      path/filepath   0.006s
ok      reflect 0.102s
ok      regexp  0.056s
ok      regexp/syntax   0.244s
ok      runtime 18.405s
ok      runtime/debug   0.014s
ok      runtime/internal/atomic 0.121s
ok      runtime/internal/sys    0.019s
ok      runtime/pprof   3.008s
ok      runtime/pprof/internal/profile  0.001s
ok      runtime/trace   1.694s
ok      sort    0.040s
ok      strconv 0.317s
ok      strings 0.117s
ok      sync    0.155s
ok      sync/atomic     0.038s
--- FAIL: TestUnshareMountNameSpace (0.00s)
        exec_linux_test.go:324: unshare failed: , fork/exec /tmp/go-build340882299/syscall/_test/syscall.test: operation not permitted
--- FAIL: TestUnshareMountNameSpaceChroot (1.50s)
        exec_linux_test.go:382: unshare failed: , fork/exec /syscall.test: operation not permitted
--- FAIL: TestAmbientCaps (0.00s)
        exec_linux_test.go:506: SYS_CAPSET: operation not permitted
FAIL
FAIL    syscall 1.628s
ok      testing 1.059s
ok      testing/quick   0.070s
ok      text/scanner    0.011s
ok      text/tabwriter  0.002s
ok      text/template   0.195s
ok      text/template/parse     0.003s
ok      time    2.548s
ok      unicode 0.001s
ok      unicode/utf16   0.015s
ok      unicode/utf8    0.007s
ok      vendor/golang_org/x/crypto/chacha20poly1305     0.031s
ok      vendor/golang_org/x/crypto/chacha20poly1305/internal/chacha20   0.002s
ok      vendor/golang_org/x/crypto/curve25519   0.033s
ok      vendor/golang_org/x/crypto/poly1305     0.009s
ok      vendor/golang_org/x/net/http2/hpack     0.002s
ok      vendor/golang_org/x/net/idna    0.007s
ok      vendor/golang_org/x/net/lex/httplex     0.013s
ok      vendor/golang_org/x/net/nettest 0.992s
ok      vendor/golang_org/x/net/proxy   0.002s
ok      vendor/golang_org/x/text/transform      0.001s
ok      vendor/golang_org/x/text/unicode/norm   0.001s
ok      cmd/addr2line   0.838s
ok      cmd/api 0.003s
ok      cmd/asm/internal/asm    0.127s
ok      cmd/asm/internal/lex    0.009s
ok      cmd/compile     3.746s
ok      cmd/compile/internal/gc 7.603s
ok      cmd/compile/internal/ssa        0.159s
ok      cmd/compile/internal/syntax     0.023s
ok      cmd/compile/internal/test       0.001s [no tests to run]
ok      cmd/compile/internal/types      0.001s
ok      cmd/cover       1.235s
ok      cmd/doc 0.029s
ok      cmd/fix 0.008s
ok      cmd/go  33.644s
ok      cmd/go/internal/generate        0.023s
ok      cmd/go/internal/get     0.016s
ok      cmd/go/internal/load    0.005s
ok      cmd/go/internal/work    0.002s
ok      cmd/gofmt       0.031s
ok      cmd/internal/dwarf      0.020s
ok      cmd/internal/obj        0.011s
ok      cmd/internal/obj/arm64  0.001s
ok      cmd/internal/obj/x86    0.215s
ok      cmd/internal/objabi     0.006s
ok      cmd/internal/src        0.016s
ok      cmd/link        1.902s
ok      cmd/link/internal/ld    1.693s
ok      cmd/nm  1.320s
ok      cmd/objdump     1.010s
ok      cmd/pack        0.937s
ok      cmd/trace       0.018s
ok      cmd/vendor/github.com/google/pprof/internal/binutils    0.001s
ok      cmd/vendor/github.com/google/pprof/internal/driver      0.096s
ok      cmd/vendor/github.com/google/pprof/internal/elfexec     0.024s
ok      cmd/vendor/github.com/google/pprof/internal/graph       0.001s
ok      cmd/vendor/github.com/google/pprof/internal/report      0.002s
ok      cmd/vendor/github.com/google/pprof/internal/symbolizer  0.005s
ok      cmd/vendor/github.com/google/pprof/internal/symbolz     0.004s
ok      cmd/vendor/github.com/google/pprof/profile      0.035s
ok      cmd/vendor/github.com/ianlancetaylor/demangle   0.012s
ok      cmd/vendor/golang.org/x/arch/arm/armasm 0.002s
ok      cmd/vendor/golang.org/x/arch/ppc64/ppc64asm     0.001s
ok      cmd/vendor/golang.org/x/arch/x86/x86asm 0.063s
ok      cmd/vet 1.149s
ok      cmd/vet/internal/cfg    0.001s
2017/10/23 17:20:40 Failed: exit status 1

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

This is top few lines after running ./all.bash:

# ./all.bash 
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /tmp/go1.4.
bootstrap/cmd/internal/dwarf
bootstrap/cmd/internal/objabi
bootstrap/cmd/internal/src
bootstrap/cmd/internal/sys
bootstrap/cmd/asm/internal/flags
bootstrap/cmd/internal/bio
bootstrap/math/bits
bootstrap/cmd/compile/internal/syntax
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 23, 2017

Thanks. So on 1.9.1 you are getting different errors. I guess there may be more places in syscall/exec_linux_test.go where we need to check for "operation not permitted".

Are you running this inside as container, as root? If so you are likely running into #21379, which has been fixed for the future 1.10 release.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 23, 2017

Are you running this inside as container, as root? If so you are likely running into #21379, which has been fixed for the future 1.10 release.

Yes, I am running it in a docker container, as root.

My apologies for not mentioning this sooner.

@ALTree ALTree removed the WaitingForInfo label Oct 24, 2017
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 25, 2017

Thanks. I'm inclined to close this a dup of number #21379. It doesn't indicate any problem with your build, just a problem with the test.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 25, 2017

Thanks. I'm inclined to close this a dup of number #21379. It doesn't indicate any problem with your build, just a problem with the test.

Yes, I think that's right. Let me try running make.all in master, which should work.

@dvn0
Copy link
Author

@dvn0 dvn0 commented Oct 25, 2017

All tests passed on master 9d3d370.

Thanks for the help.

@dvn0 dvn0 closed this Oct 25, 2017
@golang golang locked and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.