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: TestFreeBSDNumCPU fails #25924

Closed
devnexen opened this issue Jun 16, 2018 · 10 comments
Closed

runtime: TestFreeBSDNumCPU fails #25924

devnexen opened this issue Jun 16, 2018 · 10 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-FreeBSD
Milestone

Comments

@devnexen
Copy link
Contributor

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

go devel

Does this issue reproduce with the latest release?

yes

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

FreeBSD 11

What did you do?

unit tests

What did you expect to see?

num cpu test fails due to causer output

@martisch
Copy link
Contributor

martisch commented Jun 16, 2018

Please provide more information:

  • what is the error reported and which command was run that did lead to the error
  • what is the output of "go env"
  • what is the full output of "go version"
  • if it is a git checkout what is the output of "git rev-parse HEAD"
  • which test is the num cpu test referring to? ( I cant find a num cpu test in internal/cpu)

@martisch martisch added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 16, 2018
@devnexen
Copy link
Contributor Author

an error output as
FAIL: TestFreeBSDNumCPU (0.02s) numcpu_freebsd_test.go:13: expected "OK\n", but got: fail to launch child 'cpuset -l 0,1 pid 77295 domain policy: first-touch mask: 0 /tmp/go-build095241536/testprog.exe FreeBSDNumCPUHelper', error: exit status 1, output: cpuset: Malformed list 0,1 pid 77295 domain policy: first-touch mask: 0

@devnexen
Copy link
Contributor Author

proposed PR #25920

@martisch martisch changed the title internal/cpu: freebsd num cpu runtime: TestFreeBSDNumCPU fails Jun 16, 2018
@martisch martisch added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 16, 2018
@martisch martisch added this to the Go1.11 milestone Jun 16, 2018
@martisch
Copy link
Contributor

Thanks. Changed the title as that test does not seem to be using or is part of internal/cpu but is in the runtime package.

@martisch martisch removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 16, 2018
@martisch
Copy link
Contributor

martisch commented Jun 16, 2018

On FreeBSD 11.1-RELEASE-p10 with go version devel +b459e00454 Sat Jun 16 13:35:45 2018 +0000 freebsd/amd64 ./all.bash and go test -run=TestFreeBSDNumCPU runs fine on my test machine.

Is there any special setup needed to reproduce the error?

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/martisch/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/home/martisch/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/home/martisch/go"
GOTMPDIR=""
GOTOOLDIR="/usr/home/martisch/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build265726306=/tmp/go-build -gno-record-gcc-switches"
VGOMODROOT=""

@martisch martisch added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Jun 16, 2018
@devnexen
Copy link
Contributor Author

I run snapshot, witness, develop symbols and everything maybe that s why.

@gopherbot
Copy link

Change https://golang.org/cl/119355 mentions this issue: runtime: fix #25924 freebsd num cpu unit test

devnexen added a commit to devnexen/go that referenced this issue Jun 17, 2018
catches the subset of cpuset -g output
fixes golang#25924
devnexen added a commit to devnexen/go that referenced this issue Jun 17, 2018
num cpu unit test fixes for FreeBSD.
cpuset -g can possibly output more
data than expected.

Fixes golang#25924
@gopherbot
Copy link

Change https://golang.org/cl/119376 mentions this issue: runtime: fix FreeBSDNumCPU test

@uvelichitel
Copy link

$ ./all.bash
...
ok regexp/syntax 0.658s
--- FAIL: TestFreeBSDNumCPU (0.01s)
numcpu_freebsd_test.go:13: expected "OK\n", but got:
runtime.NumCPU() expected to 41, got 40 when run with CPU list 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
FAIL
FAIL runtime 13.645s
ok runtime/debug 0.090s
...
$ go version
go version devel +bfaf11c158 Wed Dec 26 05:21:41 2018 +0000 freebsd/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/uvelichitel/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/home/uvelichitel/gospace"
GOPROXY=""
GORACE=""
GOROOT="/home/uvelichitel/go"
GOTMPDIR=""
GOTOOLDIR="/home/uvelichitel/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build760623772=/tmp/go-build -gno-record-gcc-switches"
$ uname -a
FreeBSD yept.ru 12.0-RELEASE-p2 FreeBSD 12.0-RELEASE-p2 GENERIC amd64
$ dmesg | grep CPU
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz (2793.33-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 40 CPUs
cpu0: numa-domain 0 on acpi0
coretemp0: numa-domain 0 on cpu0

@ianlancetaylor
Copy link
Contributor

@uvelichitel This issue is closed and we think it's been fixed. Please open a new issue with the problem that you are seeing. Thanks.

@golang golang locked and limited conversation to collaborators Jan 12, 2020
gopherbot pushed a commit that referenced this issue May 8, 2020
Fix TestFreeBSDNumCPU on newer versions of FreeBSD which have multi line
output from cpuset e.g.

cpuset -g -p 4141
pid 4141 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8
pid 4141 domain policy: first-touch mask: 0, 1

The test now uses just the first line of output.

Fixes #38937
Fixes #25924

Change-Id: If082ee6b82120ebde4dc437e58343b3dad69c65f
Reviewed-on: https://go-review.googlesource.com/c/go/+/232801
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-FreeBSD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants