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/go: zeromq version error when tests are run with -race flag in 1.10 #23057

Closed
agnivade opened this issue Dec 8, 2017 · 8 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@agnivade
Copy link
Contributor

agnivade commented Dec 8, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.10beta1

Does this issue reproduce with the latest release?

It passes when I run with tip.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/agniva/play/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build209322330=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
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"

What did you do?

I took the 1.10 beta release out for a spin. Found that my unit tests are failing when I run with the -race flag.

Here is a sample code -

package test

import (
	"testing"

	zmq "github.com/pebbe/zmq4"
)

func TestZMQ(t *testing.T) {
	//  Create server socket
	server, err := zmq.NewSocket(zmq.PULL)
	if err != nil {
		t.Fatal(err)
	}

	// Bind socket
	err = server.Bind("tcp://*:9001")
	if err != nil {
		t.Fatal(err)
	}

}

What did you expect to see?

The test to pass with both go test and go test -race commands.

What did you see instead?

Failure in go test -race

It works fine with 1.9.2 and with the tip. So, maybe this issue can be closed. However, just wanted to bring this to notice in case there is something that I have missed.

It also works fine when the GOCACHE flag is set to off.

10:49:14-agniva-~/play/go/src/stdtest$go version
go version go1.9.2 linux/amd64
10:49:16-agniva-~/play/go/src/stdtest$go test -v  num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	0.003s
10:50:07-agniva-~/play/go/src/stdtest$go test -v -race num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	1.007s
13:15:35-agniva-~/play/go/src/stdtest$go1.10beta1 test -v -race num_test.go 
=== RUN   TestZMQ
--- FAIL: TestZMQ (0.00s)
	num_test.go:13: zmq4 was installed with ZeroMQ version 4.2.1, but the application links with version 4.2.2
FAIL
FAIL	command-line-arguments	0.007s
13:15:52-agniva-~/play/go/src/stdtest$
13:15:56-agniva-~/play/go/src/stdtest$go1.10beta1 test -v num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	0.003s
13:16:00-agniva-~/play/go/src/stdtest$GOCACHE=off go1.10beta1 test -v -race num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	1.008s
10:50:55-agniva-~/play/go/src/stdtest$~/play/gosource/go/bin/go version
go version devel +6c877e5 Fri Dec 8 05:12:13 2017 +0000 linux/amd64
10:50:43-agniva-~/play/go/src/stdtest$~/play/gosource/go/bin/go test -v num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	0.003s
10:50:49-agniva-~/play/go/src/stdtest$~/play/gosource/go/bin/go test -v -race num_test.go 
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	(cached)

The error mentions a zmq version mismatch - zmq4 was installed with ZeroMQ version 4.2.1, but the application links with version 4.2.2.

So, just to be sure, I uninstalled and reinstalled my zmq library. And then uninstalled and reinstalled the zmq package. But still results are the same.

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Dec 8, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Dec 8, 2017
@ianlancetaylor
Copy link
Contributor

Which version of the zmq library do you have installed on the system?

Did you upgrade or downgrade the zmq library while testing go1.10beta1?

CC @rsc because this works with GOCACHE=off but fails without it.

@agnivade
Copy link
Contributor Author

agnivade commented Dec 8, 2017

Did you upgrade or downgrade the zmq library while testing go1.10beta1?

Nope. I have 4.2.2. I had upgraded from 4.2.1 quite some time ago. It was working fine with Go 1.9.2.

I just downloaded 1.10beta1 and tried to execute my UTs and then saw this.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2017

Can you please post the output of go1.10beta1 test -x -v -race -count=1 num_test.go, both with GOCACHE=off (failing) and without (succeeding)?

Thanks.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2017

Also please try provoking the failure and then go clean -cache and repeat the failing build and see if it no longer fails.

I thought maybe we were mishandling pkg-config output during partially cached builds, but it doesn't look like we are. It looks to me like maybe you did:

<install 4.2.1, maybe a long time ago>
go1.10beta1 build -race zmq
<update to 4.2.2>
go1.10beta test -race yourpkg

and the last command reused the built zmq package from when 4.2.1 was current, and that reused package has references to the 4.2.1 zmq4. Or maybe I have it backward. But that kind of "reuse objects even though pkg-config output changed" is my best guess right now.

We know about that inadequacy in caching; if you change pkg-config you need to go clean -cache or go build -a or go install -a (before you had to go build -a or go install -a too).

@agnivade
Copy link
Contributor Author

I had 4.2.2 already installed some time back. But when I saw this, I uninstalled and then reinstalled. Maybe the build step slipped in somewhere.

Here is the failure output -

09:03:35-agniva-~/play/go/src/stdtest$go1.10beta1 test -x -v -race -count=1 num_test.go
WORK=/tmp/go-build803465551
mkdir -p $WORK/b001/
mkdir -p $WORK/b047/
cat >$WORK/b047/vet.cfg << 'EOF' # internal
{
	"Compiler": "gc",
	"Dir": "/home/agniva/play/go/src/stdtest",
	"GoFiles": [
		"/home/agniva/play/go/src/stdtest/num_test.go"
	],
	"ImportMap": {
		"fmt": "fmt",
		"github.com/pebbe/zmq4": "github.com/pebbe/zmq4",
		"testing": "testing"
	},
	"PackageFile": {
		"fmt": "/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/fmt.a",
		"github.com/pebbe/zmq4": "/home/agniva/.cache/go-build/e9/e93e6c6e6c80d8074ddb4ca9f88762344f234c0413625ffb784945747eabeb1d-d",
		"testing": "/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a"
	},
	"SucceedOnTypecheckFailure": true
}
EOF
cd /home/agniva/play/go/src/stdtest
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/vet -atomic -bool -buildtags -nilfunc -printf $WORK/b047/vet.cfg
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile command-line-arguments (testmain)=/home/agniva/.cache/go-build/aa/aa39cd42ab7a1baa10b7bc64ade2a2787eef63972af970aaf684eb221e3abefa-d
packagefile os=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/os.a
packagefile testing=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a
packagefile testing/internal/testdeps=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing/internal/testdeps.a
packagefile runtime=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime.a
packagefile runtime/race=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/race.a
packagefile command-line-arguments=/home/agniva/.cache/go-build/42/428461f3582bbebb4dd0ba8af7606a6f23af3c03b67629969010094d8fb3d1a8-d
packagefile errors=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/errors.a
packagefile internal/poll=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/poll.a
packagefile io=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/io.a
packagefile sync=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sync.a
packagefile sync/atomic=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sync/atomic.a
packagefile syscall=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/syscall.a
packagefile time=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/time.a
packagefile bytes=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/bytes.a
packagefile flag=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/flag.a
packagefile fmt=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/fmt.a
packagefile internal/race=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/race.a
packagefile runtime/debug=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/debug.a
packagefile runtime/trace=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/trace.a
packagefile sort=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sort.a
packagefile strconv=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/strconv.a
packagefile strings=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/strings.a
packagefile regexp=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/regexp.a
packagefile runtime/pprof=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/pprof.a
packagefile runtime/internal/atomic=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/internal/atomic.a
packagefile runtime/internal/sys=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/internal/sys.a
packagefile runtime/cgo=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/cgo.a
packagefile github.com/pebbe/zmq4=/home/agniva/.cache/go-build/e9/e93e6c6e6c80d8074ddb4ca9f88762344f234c0413625ffb784945747eabeb1d-d
packagefile internal/cpu=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/cpu.a
packagefile unicode=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/unicode.a
packagefile unicode/utf8=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/unicode/utf8.a
packagefile reflect=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/reflect.a
packagefile math=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math.a
packagefile regexp/syntax=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/regexp/syntax.a
packagefile bufio=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/bufio.a
packagefile compress/gzip=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/compress/gzip.a
packagefile context=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/context.a
packagefile encoding/binary=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/encoding/binary.a
packagefile io/ioutil=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/io/ioutil.a
packagefile text/tabwriter=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/text/tabwriter.a
packagefile log=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/log.a
packagefile net=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/net.a
packagefile compress/flate=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/compress/flate.a
packagefile hash/crc32=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/hash/crc32.a
packagefile path/filepath=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/path/filepath.a
packagefile internal/nettrace=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/nettrace.a
packagefile internal/singleflight=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/singleflight.a
packagefile math/rand=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math/rand.a
packagefile math/bits=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math/bits.a
packagefile hash=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/hash.a
EOF
cd .
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/link -o $WORK/b001/stdtest.test -importcfg $WORK/b001/importcfg.link -installsuffix race -s -w -buildmode=exe -buildid=OJaixBBZgeByb3gix_ub/aCyuaozPnA1_jeYEuMjC/J_EVyKTkF931ech6zjuP/OJaixBBZgeByb3gix_ub -race -extld=gcc /home/agniva/.cache/go-build/aa/aa39cd42ab7a1baa10b7bc64ade2a2787eef63972af970aaf684eb221e3abefa-d
$WORK/b001/stdtest.test -test.v=true -test.count=1
=== RUN   TestZMQ
--- FAIL: TestZMQ (0.00s)
	num_test.go:13: zmq4 was installed with ZeroMQ version 4.2.1, but the application links with version 4.2.2
FAIL
FAIL	command-line-arguments	0.007s
rm -r $WORK/b001/

And this is when it passes -

09:03:51-agniva-~/play/go/src/stdtest$GOCACHE=off go1.10beta1 test -x -v -race -count=1 num_test.go
WORK=/tmp/go-build572167252
mkdir -p $WORK/b001/
mkdir -p $WORK/b048/
cd /home/agniva/play/go/src/github.com/pebbe/zmq4
pkg-config --cflags libzmq
pkg-config --libs libzmq
CGO_LDFLAGS='"-g" "-O2" "-L/usr/local/lib" "-lzmq"' /home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/cgo -objdir $WORK/b048/ -importpath github.com/pebbe/zmq4 -- -I/usr/local/include -I $WORK/b048/ -g -O2 ./auth.go ./ctxoptions_unix.go ./errors.go ./polling.go ./socketget.go ./socketget_unix.go ./socketset.go ./zmq4.go
cd $WORK
gcc -fno-caret-diagnostics -c -x c -
gcc -Qunused-arguments -c -x c -
gcc -fdebug-prefix-map=a=b -c -x c -
gcc -gno-record-gcc-switches -c -x c -
cd $WORK/b048
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x001.o -c _cgo_export.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x002.o -c auth.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x003.o -c ctxoptions_unix.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x004.o -c errors.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x005.o -c polling.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x006.o -c socketget.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x007.o -c socketget_unix.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x008.o -c socketset.cgo2.c
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_x009.o -c zmq4.cgo2.c
cd /home/agniva/play/go/src/github.com/pebbe/zmq4
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I $WORK/b048/ -g -O2 -o $WORK/b048/_x010.o -c dummy.c
cd $WORK/b048
gcc -I /home/agniva/play/go/src/github.com/pebbe/zmq4 -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -I/usr/local/include -I ./ -g -O2 -o ./_cgo_main.o -c _cgo_main.c
cd /home/agniva/play/go/src/github.com/pebbe/zmq4
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b048=/tmp/go-build -gno-record-gcc-switches -o $WORK/b048/_cgo_.o $WORK/b048/_cgo_main.o $WORK/b048/_x001.o $WORK/b048/_x002.o $WORK/b048/_x003.o $WORK/b048/_x004.o $WORK/b048/_x005.o $WORK/b048/_x006.o $WORK/b048/_x007.o $WORK/b048/_x008.o $WORK/b048/_x009.o $WORK/b048/_x010.o -g -O2 -L/usr/local/lib -lzmq
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/cgo -dynpackage zmq4 -dynimport $WORK/b048/_cgo_.o -dynout $WORK/b048/_cgo_import.go
cat >$WORK/b048/importcfg << 'EOF' # internal
packagefile errors=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/errors.a
packagefile fmt=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/fmt.a
packagefile log=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/log.a
packagefile net=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/net.a
packagefile runtime=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime.a
packagefile strings=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/strings.a
packagefile syscall=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/syscall.a
packagefile time=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/time.a
packagefile runtime/cgo=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/cgo.a
EOF
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/compile -o $WORK/b048/_pkg_.a -trimpath $WORK/b048 -race -p github.com/pebbe/zmq4 -installsuffix race -buildid xnuob9ne-N66GgYwMDxS/xnuob9ne-N66GgYwMDxS -goversion go1.10beta1 -D "" -importcfg $WORK/b048/importcfg -pack ./doc.go ./reactor.go ./utils.go $WORK/b048/_cgo_gotypes.go $WORK/b048/auth.cgo1.go $WORK/b048/ctxoptions_unix.cgo1.go $WORK/b048/errors.cgo1.go $WORK/b048/polling.cgo1.go $WORK/b048/socketget.cgo1.go $WORK/b048/socketget_unix.cgo1.go $WORK/b048/socketset.cgo1.go $WORK/b048/zmq4.cgo1.go $WORK/b048/_cgo_import.go
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/pack r $WORK/b048/_pkg_.a $WORK/b048/_x001.o $WORK/b048/_x002.o $WORK/b048/_x003.o $WORK/b048/_x004.o $WORK/b048/_x005.o $WORK/b048/_x006.o $WORK/b048/_x007.o $WORK/b048/_x008.o $WORK/b048/_x009.o $WORK/b048/_x010.o # internal
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/buildid -w $WORK/b048/_pkg_.a # internal
mkdir -p $WORK/b047/
cat >$WORK/b047/importcfg << 'EOF' # internal
packagefile github.com/pebbe/zmq4=$WORK/b048/_pkg_.a
packagefile testing=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a
EOF
cd /home/agniva/play/go/src/stdtest
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/compile -o $WORK/b047/_pkg_.a -trimpath $WORK/b047 -race -p command-line-arguments -complete -installsuffix race -buildid aPD9LD5AZxrC11apt0--/aPD9LD5AZxrC11apt0-- -goversion go1.10beta1 -D _/home/agniva/play/go/src/stdtest -importcfg $WORK/b047/importcfg -pack ./num_test.go
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/buildid -w $WORK/b047/_pkg_.a # internal
cat >$WORK/b047/vet.cfg << 'EOF' # internal
{
	"Compiler": "gc",
	"Dir": "/home/agniva/play/go/src/stdtest",
	"GoFiles": [
		"/home/agniva/play/go/src/stdtest/num_test.go"
	],
	"ImportMap": {
		"fmt": "fmt",
		"github.com/pebbe/zmq4": "github.com/pebbe/zmq4",
		"testing": "testing"
	},
	"PackageFile": {
		"fmt": "/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/fmt.a",
		"github.com/pebbe/zmq4": "$WORK/b048/_pkg_.a",
		"testing": "/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a"
	},
	"SucceedOnTypecheckFailure": true
}
EOF
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/vet -atomic -bool -buildtags -nilfunc -printf $WORK/b047/vet.cfg
cat >$WORK/b001/importcfg << 'EOF' # internal
packagefile os=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/os.a
packagefile testing=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a
packagefile testing/internal/testdeps=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing/internal/testdeps.a
packagefile runtime=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime.a
packagefile runtime/race=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/race.a
packagefile command-line-arguments=$WORK/b047/_pkg_.a
EOF
cd $WORK/b001/
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/compile -o ._pkg_.a -trimpath $WORK/b001 -race -p main -complete -installsuffix race -buildid aCyuaozPnA1_jeYEuMjC/aCyuaozPnA1_jeYEuMjC -dwarf=false -goversion go1.10beta1 -D "" -importcfg .importcfg -pack ._testmain.go
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/buildid -w $WORK/b001/_pkg_.a # internal
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile command-line-arguments (testmain)=$WORK/b001/_pkg_.a
packagefile os=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/os.a
packagefile testing=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing.a
packagefile testing/internal/testdeps=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/testing/internal/testdeps.a
packagefile runtime=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime.a
packagefile runtime/race=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/race.a
packagefile command-line-arguments=$WORK/b047/_pkg_.a
packagefile errors=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/errors.a
packagefile internal/poll=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/poll.a
packagefile io=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/io.a
packagefile sync=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sync.a
packagefile sync/atomic=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sync/atomic.a
packagefile syscall=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/syscall.a
packagefile time=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/time.a
packagefile bytes=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/bytes.a
packagefile flag=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/flag.a
packagefile fmt=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/fmt.a
packagefile internal/race=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/race.a
packagefile runtime/debug=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/debug.a
packagefile runtime/trace=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/trace.a
packagefile sort=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/sort.a
packagefile strconv=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/strconv.a
packagefile strings=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/strings.a
packagefile regexp=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/regexp.a
packagefile runtime/pprof=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/pprof.a
packagefile runtime/internal/atomic=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/internal/atomic.a
packagefile runtime/internal/sys=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/internal/sys.a
packagefile runtime/cgo=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/runtime/cgo.a
packagefile github.com/pebbe/zmq4=$WORK/b048/_pkg_.a
packagefile internal/cpu=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/cpu.a
packagefile unicode=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/unicode.a
packagefile unicode/utf8=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/unicode/utf8.a
packagefile reflect=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/reflect.a
packagefile math=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math.a
packagefile regexp/syntax=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/regexp/syntax.a
packagefile bufio=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/bufio.a
packagefile compress/gzip=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/compress/gzip.a
packagefile context=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/context.a
packagefile encoding/binary=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/encoding/binary.a
packagefile io/ioutil=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/io/ioutil.a
packagefile text/tabwriter=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/text/tabwriter.a
packagefile log=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/log.a
packagefile net=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/net.a
packagefile compress/flate=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/compress/flate.a
packagefile hash/crc32=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/hash/crc32.a
packagefile path/filepath=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/path/filepath.a
packagefile internal/nettrace=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/nettrace.a
packagefile internal/singleflight=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/internal/singleflight.a
packagefile math/rand=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math/rand.a
packagefile math/bits=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/math/bits.a
packagefile hash=/home/agniva/sdk/go1.10beta1/pkg/linux_amd64_race/hash.a
EOF
cd .
/home/agniva/sdk/go1.10beta1/pkg/tool/linux_amd64/link -o $WORK/b001/stdtest.test -importcfg $WORK/b001/importcfg.link -installsuffix race -s -w -buildmode=exe -buildid=MbOXNAidXwp-7BeN46Xu/aCyuaozPnA1_jeYEuMjC/J_EVyKTkF931ech6zjuP/MbOXNAidXwp-7BeN46Xu -race -extld=gcc $WORK/b001/_pkg_.a
$WORK/b001/stdtest.test -test.v=true -test.count=1
=== RUN   TestZMQ
--- PASS: TestZMQ (0.00s)
PASS
ok  	command-line-arguments	1.019s
rm -r $WORK/b001/

I can confirm that go1.10beta1 clean -cache fixes the issue. In that light, I am inclined to believe that maybe I somehow screwed up the zmq build while testing this. I have tested with my other repos and all of them build and test fine. If the logs look legit to you, feel free to close this.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2017

When you do move between different versions of zmq, what do you use? Do you change $PKG_CONFIG_PATH or are you actually just running commands to change the default zmq library version?

@agnivade
Copy link
Contributor Author

I just upgrade the libzmq.so library. Everything else remains the same. The zmq Go library is for zmq4. So as long as the major version remains the same, no change is needed from the Go code.

Does that answer your question ? I have never touched the $PKG_CONFIG_PATH anytime.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2017

Yes, thanks. I was curious what we should be watching to find out that the build is stale, and it sounds like the answer is "nothing about pkg-config". If we knew the specific libzmq.so that the build used then we could watch that. That's worth knowing for the future, although I don't have any concrete plans to start doing that (it's a bit tricky).

Thanks for all the information. As discussed above, I'll close this now and make sure to mention some of these things in the 'go help cache' text I still need to write.

@rsc rsc closed this as completed Dec 14, 2017
@golang golang locked and limited conversation to collaborators Dec 14, 2018
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. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants