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

cmd/cgo, runtime/cgo: misc/cgo/testsovar fails on netbsd #11654

Closed
mikioh opened this issue Jul 10, 2015 · 19 comments
Closed

cmd/cgo, runtime/cgo: misc/cgo/testsovar fails on netbsd #11654

mikioh opened this issue Jul 10, 2015 · 19 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Jul 10, 2015

See http://build.golang.org/log/c35e11fe9fbe842fc43b4299a38560742cc7df69.

##### ../misc/cgo/testsovar
panic: testExportedVar: got "", but want "Hello world"

goroutine 1 [running]:
_/tmp/gobuilder/netbsd-386-minux-91ba0abef12d/go/misc/cgo/testsovar.Test()
    /tmp/gobuilder/netbsd-386-minux-91ba0abef12d/go/misc/cgo/testsovar/cgoso.go:37 +0x384
main.main()
    /tmp/gobuilder/netbsd-386-minux-91ba0abef12d/go/misc/cgo/testsovar/main.go:12 +0x11

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /tmp/gobuilder/netbsd-386-minux-91ba0abef12d/go/src/runtime/asm_386.s:1662 +0x1
2015/07/10 03:44:43 Failed: exit status 2
@mikioh mikioh added this to the Go1.5Maybe milestone Jul 10, 2015
@alexbrainman
Copy link
Member

I think this is broken for a particular netbsd version. I run trybot before submitting https://go-review.googlesource.com/#/c/11119/ and netbsd builder did not complain. It easy to disable this test on netbsd, but maybe this should be investigated first.

Alex

@mikioh
Copy link
Contributor Author

mikioh commented Jul 10, 2015

My dumb guess is that parallelism in cmd/dist and/or the package testing on node under the test with small memory might be the trigger for this sort of issues. I just launched netbsd-386 with 2 cores+1Gig memory, run all.bash a few times, and got the following constantly:

% dmesg | tail -n 3
acpibat0: normal capacity on 'charge state'
UVM: pid 5776 (compile), uid 5963 killed: out of swap
UVM: pid 5585 (link), uid 5963 killed: out of swap

@alexbrainman
Copy link
Member

I don't think so. I suspect it is too do with OS tools - GCC or libc or whatever else. I suspect this builder was always broken. I don't think this builder is maintained by Brad and Andrew.

Alex

@mikioh
Copy link
Contributor Author

mikioh commented Jul 10, 2015

Yup, with 2Gig memory, there's no crash of compile/link commands. But misc/cgo/testsovar still fails.

@ianlancetaylor
Copy link
Member

CC @minux since it seems to be his builder. This will need to be investigated by somebody who can recreate the problem.

@bradfitz
Copy link
Contributor

We have no netbsd trybots.

@gopherbot
Copy link
Contributor

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

alexbrainman added a commit that referenced this issue Jul 12, 2015
Update #11654

Change-Id: Ia199b8dd349542ad8b92b463dd2f3734dd7e66a4
Reviewed-on: https://go-review.googlesource.com/12060
Run-TryBot: Alex Brainman <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
@ianlancetaylor ianlancetaylor modified the milestones: Unplanned, Go1.5Maybe Jul 15, 2015
@ianlancetaylor
Copy link
Member

Moving to unplanned. Will have to wait for developer using NetBSD.

@ianlancetaylor
Copy link
Member

May be fixed by https://golang.org/cl/12470.

@ikrabbe
Copy link
Contributor

ikrabbe commented Jul 22, 2015

I had the same error message, so likely I have the same error. I will check my tool chain. But anyway the extern flag does not hurt.

@alexbrainman
Copy link
Member

@ikrabbe we skip misc/cgo/testsovar test on netbsd (search for 11654 in cmd/dist/test.go). If you have netbsd machine, please remove the "skip" and see if build succeeds. If it succeeds, please send another CL with the change. Thank you.

Alex

@ikrabbe
Copy link
Contributor

ikrabbe commented Jul 22, 2015

@alexbrainman No sorry I use a gentoo linux and I currently try to find the compiler commands that where involved in the failed test, that I can exactly reproduce what happened. Currently I miss the linker step for the libcgotest.so with go test -x -v main.go.

@alexbrainman
Copy link
Member

You can execute misc/cgo/testsovar test by running:

go tool dist test -no-rebuild -run testsovar

Alex

@ikrabbe
Copy link
Contributor

ikrabbe commented Jul 22, 2015

but this does not say anything about the executed commands. How can I rebuild the dist tool command, without rebuilding the whole set?

@alexbrainman
Copy link
Member

cmd/dist is just a Go command, so all normal build commands applicable: 'go build' and 'go install'. For example:

# cd $GOROOT/src/cmd/dist
# go build -o alex
# ./alex test -no-rebuild -run testsovar

##### ../misc/cgo/testsovar

ALL TESTS PASSED (some were excluded)
#

Alex

@ikrabbe
Copy link
Contributor

ikrabbe commented Jul 22, 2015

@alexbrainman Ah, thank you: I changed the dist tester to be more verbose
https://go-review.googlesource.com/12510 cmd/dist/test.go: add command output for dist tests

With this I get

 ~/install/go/misc/cgo/testsovar $ go tool dist test -v -v -no-rebuild testsovar

##### ../misc/cgo/testsovar
# go tool dist test -run=^testsovar$
gcc -fPIC -m64 -pthread -fmessage-length=0 -shared -o libcgosotest.so cgoso_c.c
go build -o main.exe main.go
./main.exe

ALL TESTS PASSED (some were excluded)
rm -rf /tmp/go-tool-dist-255215708

Now we can analyze why or where we need an extern keyword.

@gopherbot
Copy link
Contributor

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

mk0x9 pushed a commit to mk0x9/go that referenced this issue Jul 22, 2015
It is very useful to see which test commands are executed.
This is of global use, but I wrote it for golang#11654.

Change-Id: I9bfc8e55d5bef21f4c49b917f58bc9a44aefcade
Reviewed-on: https://go-review.googlesource.com/12510
Reviewed-by: Russ Cox <[email protected]>
@gopherbot
Copy link
Contributor

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

ianlancetaylor added a commit that referenced this issue Jul 27, 2015
CL https://golang.org/cl/12470 has reportedly fixed the problems that
the misc/cgo/testsovar test encountered on darwin and netbsd.  Let's
actually run the test.

Update #10360.
Update #11654.

Change-Id: I4cdd27a8ec8713620e0135780a03f63cfcc538d0
Reviewed-on: https://go-review.googlesource.com/12702
Reviewed-by: Russ Cox <[email protected]>
@ianlancetaylor
Copy link
Member

As far as I can tell, this is fixed.

@mikioh mikioh modified the milestones: Go1.5, Unplanned Jul 28, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
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

6 participants