Open m15o opened 1 month ago
Thanks, it's hard to know if the issue is with Go or something else at this stage. Appreciate the repro.
There definitely seems to be an issue in linux builds reported over in golang, and is affecting our ci runs with all published version of golang 1.22.x (0,1,2)
I've not tested linux aarch64 yet.
Definitely appreciate the repro
I've been using
docker run --platform linux/amd64 --rm -it -v $PWD:/app golang:latest
cd /app
apt-get update
apt-get install -y openjdk-17-jdk
make test
which gives me the same error on the first test
--- FAIL: TestHttpV4TypeSystem (0.04s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x441144]
goroutine 19 [running]:
testing.tRunner.func1.2({0xc5c1c0, 0x1183260})
/usr/local/go/src/testing/testing.go:1631 +0x3f7
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1634 +0x6b6
panic({0xc5c1c0?, 0x1183260?})
/usr/local/go/src/runtime/panic.go:770 +0x132
runtime/internal/atomic.(*Pointer[...]).Load(...)
/usr/local/go/src/runtime/internal/atomic/types.go:526
github.com/pact-foundation/pact-go/v2/internal/native.(*Interaction).withHeaders(0xc0001aa34c, 0x0, 0xc0001b9b98)
/app/internal/native/mock_server.go:709 +0x1ec
github.com/pact-foundation/pact-go/v2/internal/native.(*Interaction).WithRequestHeaders(...)
/app/internal/native/mock_server.go:686
github.com/pact-foundation/pact-go/v2/consumer.(*V4RequestBuilder).Header(0xc00019a5b0, {0xcfed62, 0xc}, {0xc0001b9ca8, 0x1, 0x41662d?})
/app/consumer/http_v4.go:151 +0x396
github.com/pact-foundation/pact-go/v2/consumer.TestHttpV4TypeSystem.func1(0xc00019a5b0)
/app/consumer/http_v4_test.go:25 +0x8c
github.com/pact-foundation/pact-go/v2/consumer.(*V4UnconfiguredInteraction).WithRequestPathMatcher(0xc00019a560, {0xcf829c, 0x3}, {0xdfd8a0, 0xc00019a570}, {0xc0001b9e00, 0x1, 0x0?})
/app/consumer/http_v4.go:130 +0x142
github.com/pact-foundation/pact-go/v2/consumer.(*V4UnconfiguredInteraction).WithRequest(...)
/app/consumer/http_v4.go:122
github.com/pact-foundation/pact-go/v2/consumer.TestHttpV4TypeSystem(0xc0001d6680)
/app/consumer/http_v4_test.go:23 +0x2e5
testing.tRunner(0xc0001d6680, 0xd3d5a0)
/usr/local/go/src/testing/testing.go:1689 +0x21f
created by testing.(*T).Run in goroutine 1
/usr/local/go/src/testing/testing.go:1742 +0x826
Tested against linux/arm64 and its fine against there, had to make some updates to support downloading the correct variant of the csv plugin for linux aarch64
using branch https://github.com/pact-foundation/pact-go/tree/deps/go_1_22
The error occurs if you specify -race flag in go test command.
yep can also confirm this. thanks!
Linux x86_64 users
-race
-race
?
Thanks Yousaf for putting together the above. It doesn't seem to be a problem on Mac either (the OS I use for development). I'd suggest we sit on this to see where Golang takes it, and leave this as a sign-post for others.
Also seeing the issue on macos x86_64 solely on 1.22 when testing in GHA
Software versions
go version go1.22.2 linux/amd64
,go version go1.22.1 linux/amd64
,go version go1.22.0 linux/amd64
go env
Expected behaviour
pact-go consumer test should run successfully without error
Actual behaviour
The test fails with the following error
Steps to reproduce
The code is pretty match same as the example test on github. https://github.com/pact-foundation/pact-go/blob/master/examples/consumer_v4_test.go
go test -v -race ./...
Relevent log files
Additional information
-race
flag ingo test
command.