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

runtime/cgo: test fails: resource temporarily unavailable #18202

Closed
YoshikiShibata opened this issue Dec 6, 2016 · 8 comments
Closed

runtime/cgo: test fails: resource temporarily unavailable #18202

YoshikiShibata opened this issue Dec 6, 2016 · 8 comments
Milestone

Comments

@YoshikiShibata
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

Just rebuild by running all.bash from the latest tip version on my MacBook.

What did you expect to see?

All tests passed

What did you see instead?

##### ../misc/cgo/stdio

##### ../misc/cgo/life

##### ../misc/cgo/test
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	16.896s
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	14.067s
fork/exec /var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/go-build257168017/_/Users/yoshiki/tools/go/misc/cgo/test/_test/test.test: resource temporarily unavailable
FAIL	_/Users/yoshiki/tools/go/misc/cgo/test	0.000s
2016/12/06 09:07:36 Failed: exit status 1
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	22.170s

##### Testing race detector
# net
clang: error: unable to execute command: posix_spawn failed: Resource temporarily unavailable
2016/12/06 09:07:51 Failed: exit status 2

Does this issue reproduce with the latest release (go1.7.4)?

N/A

System details

go version devel +80acfe9 Mon Dec 5 21:15:05 2016 +0000 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/yoshiki/gocode:/Users/yoshiki/exercises/gpl:/Users/yoshiki/oak"
GORACE=""
GOROOT="/Users/yoshiki/tools/go"
GOTOOLDIR="/Users/yoshiki/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/go-build501457662=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version devel +80acfe9 Mon Dec 5 21:15:05 2016 +0000 darwin/amd64
GOROOT/bin/go tool compile -V: compile version devel +80acfe9 Mon Dec 5 21:15:05 2016 +0000 X:framepointer
uname -v: Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.12.1
BuildVersion:	16B2555
lldb --version: lldb-360.1.65
@bradfitz bradfitz added this to the Go1.8 milestone Dec 6, 2016
@bradfitz bradfitz changed the title cgo test fails: resource temporarily unavailable runtime/cgo: test fails: resource temporarily unavailable Dec 6, 2016
@ianlancetaylor
Copy link
Contributor

Which tip version exactly did you use? Did it include https://golang.org/cl/33905 (git hash 80acfe9)?

@YoshikiShibata
Copy link
Author

I guess I included it:

$ git log --pretty=short
commit 6c9f600d4991f66f1ce621c4e2d9ea72d5188d34
Author: Ian Lance Taylor <iant@golang.org>

    misc/cgo/test: ignore "too many open files" in issue 18146 test

commit 8016808562c514dbb1146739b56ca67be9028d91
Author: Chris Broadfoot <cbro@golang.org>

    net/http: fix typo in Request.GetBody's doc string

commit 80acfe950fce409477b9fae097696701a9ff66e3
Author: Ian Lance Taylor <iant@golang.org>

    runtime/cgo: retry pthread_create on EAGAIN for OpenBSD

commit a303f05f863af89641cf9ba815f418e5bc3ec9dd
Author: Ian Lance Taylor <iant@golang.org>

    misc/cgo/test: skip Test18146 on DragonFly

commit 14f18e5b6f5abd9819981fdee92fffe62f4d4c1c
Author: Shenghou Ma <minux@golang.org>

    doc/go1.8: document mips port requirements

commit 7cba779cea52e827382a73804d06697e15444247
Author: Ian Lance Taylor <iant@golang.org>

    runtime/cgo: retry pthread_create on EAGAIN

commit 8c31f40a4c1c3474a7c24684cc47845b0ec06974
Author: Ian Lance Taylor <iant@golang.org>

    runtime: don't skip TestCgoCallbackGC on FreeBSD

commit 7e9fa3c3213fc1a4174fe5d6692c83f5610dff42
Author: Russ Cox <rsc@golang.org>

    runtime: check that Version does not contain \r \n

commit ed0b232cdc48398c2074369852e5db8bdcb866aa
Author: Cherry Zhang <cherryyz@google.com>

    cmd/compile: find last StoreWB explicitly

commit af67f7de3f7b0d26f95d813022f876eef1fa3889
Author: Dhananjay Nakrani <dhananjaynakrani@gmail.com>

    cmd/go: give useful error when msan isn't supported

commit d54b60a2b2470ea42559b58995e86ff20dd70471
Author: Emmanuel Odeke <emm.odeke@gmail.com>

    html/template: lock in application/json as valid JS test

@YoshikiShibata
Copy link
Author

This failure always happens when I try to run all.bash:

##### ../misc/cgo/test
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	11.110s
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	10.218s
# testmain
/Users/yoshiki/tools/go/pkg/tool/darwin_amd64/link: running clang failed: fork/exec /usr/bin/clang: resource temporarily unavailable

FAIL	_/Users/yoshiki/tools/go/misc/cgo/test [build failed]
2016/12/06 12:58:53 Failed: exit status 2
# testmain
/Users/yoshiki/tools/go/pkg/tool/darwin_amd64/link: running clang failed: fork/exec /usr/bin/clang: resource temporarily unavailable

FAIL	_/Users/yoshiki/tools/go/misc/cgo/test [build failed]
2016/12/06 12:58:53 Failed: exit status 2

@ianlancetaylor
Copy link
Contributor

These failures appear to indicate that fork is returning EAGAIN even after the misc/cgo/test completes. The new test18146 does fork and exec a lot of threads, and it's reasonable that EAGAIN could occur while running that program. But I don't understand why it would happen after the test completes.

Can you try

cd misc/cgo/test
go test -c
./test.test -test.run=Test18146

and then immediately use ps or some similar program to see how many processes you are running? I don't see a way that processes could be left running after the test completes, but I also don't understand the results you are seeing.

@YoshikiShibata
Copy link
Author

I run ps -A command. See the attached file.
ps.txt

@ianlancetaylor
Copy link
Contributor

Thanks. Unfortunately I don't see anything interesting in that list. I don't understand why you are seeing these failures after the test completes. I also don't understand why you are seeing problems but the builders are not.

I guess we can just disable the test on Darwin again. I'm not sure what else to do.

@YoshikiShibata
Copy link
Author

Today I got the following errors even after terminating several applications (Chrome browser, TeXShop, iTunes, etc) except the Terminal.

failLog.txt

Then I rebooted MacBook and tried all.bash again without running any applications except the Terminal. Unfortunately, the same error occurred:

##### ../misc/cgo/stdio

##### ../misc/cgo/life

##### ../misc/cgo/test
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	10.348s
PASS
ok  	_/Users/yoshiki/tools/go/misc/cgo/test	9.854s
go build testmain: /Users/yoshiki/tools/go/pkg/tool/darwin_amd64/compile: fork/exec /Users/yoshiki/tools/go/pkg/tool/darwin_amd64/compile: resource temporarily unavailable
FAIL	_/Users/yoshiki/tools/go/misc/cgo/test [build failed]
2016/12/07 13:02:33 Failed: exit status 1
go build testmain: /Users/yoshiki/tools/go/pkg/tool/darwin_amd64/compile: fork/exec /Users/yoshiki/tools/go/pkg/tool/darwin_amd64/compile: resource temporarily unavailable
FAIL	_/Users/yoshiki/tools/go/misc/cgo/test [build failed]
2016/12/07 13:02:33 Failed: exit status 1

##### Testing race detector
ok  	runtime/race	4.397s
skipped due to earlier error
skipped due to earlier error
skipped due to earlier error
2016/12/07 13:02:43 FAILED

@gopherbot
Copy link

CL https://golang.org/cl/34017 mentions this issue.

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

No branches or pull requests

4 participants