Skip to content

runtime: go1.22.0 test with -race will SIGSEGV or SIGBUS or Bad Pointer #65783

@timmy21

Description

@timmy21

Go version

go version go1.22.0 darwin/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/timmy/Library/Caches/go-build'
GOENV='/Users/timmy/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/timmy/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/timmy/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/Users/timmy/sdk/go1.22.0'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/timmy/sdk/go1.22.0/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/timmy/code/test/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/pv/rs024ry56j3cqlcqgjnm48l00000gn/T/go-build2295311270=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

go1.22.0 test -timeout 30s -run ^TestPlanVisitor$ github.com/timmy21/test/planx -v -count 1 -race

What did you see happen?

=== RUN TestPlanVisitor
unexpected fault address 0xb01dfacedebac1e
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0xfa7e9de]

goroutine 9 gp=0xc000186e00 m=0 mp=0x11c19320 [running]:
runtime.throw({0x108da285?, 0x20?})
/Users/timmy/sdk/go1.22.0/src/runtime/panic.go:1023 +0x5c fp=0xc0000ebac8 sp=0xc0000eba98 pc=0xf9647fc
runtime.sigpanic()
/Users/timmy/sdk/go1.22.0/src/runtime/signal_unix.go:895 +0x285 fp=0xc0000ebb28 sp=0xc0000ebac8 pc=0xf97ec45
fmt.(*pp).printArg(0xc000697860, {0xcccccccccccccccc, 0x108d70ed}, 0x76)
/Users/timmy/sdk/go1.22.0/src/fmt/print.go:707 +0x11e fp=0xc0000ebbb8 sp=0xc0000ebb28 pc=0xfa7e9de
fmt.(*pp).doPrintf(0xc000697860, {0x108fa625, 0x1e}, {0xc0000ebd90, 0x1, 0x1})
/Users/timmy/sdk/go1.22.0/src/fmt/print.go:1075 +0x593 fp=0xc0000ebcf0 sp=0xc0000ebbb8 pc=0xfa83bb3
fmt.Sprintf({0x108fa625, 0x1e}, {0xc0000ebd90, 0x1, 0x1})
/Users/timmy/sdk/go1.22.0/src/fmt/print.go:239 +0x5d fp=0xc0000ebd48 sp=0xc0000ebcf0 pc=0xfa79e1d
github.com/stretchr/testify/assert.NoError({0x10e94ae0, 0xc0005dc4e0}, {0xf9a5301, 0x108d70ed}, {0x0, 0x0, 0x0})
/Users/timmy/go/pkg/mod/github.com/stretchr/[email protected]/assert/assertions.go:1495 +0x11a fp=0xc0000ebdb0 sp=0xc0000ebd48 pc=0x106eaf9a
github.com/stretchr/testify/require.NoError({0x10e983f0, 0xc0005dc4e0}, {0xf9a5301, 0x108d70ed}, {0x0, 0x0, 0x0})
/Users/timmy/go/pkg/mod/github.com/stretchr/[email protected]/require/require.go:1357 +0xc5 fp=0xc0000ebdf8 sp=0xc0000ebdb0 pc=0x106ebc45
github.com/timmy21/test/planx/planx_test.TestPlanVisitor(0xc0005dc4e0)
/Users/timmy/code/test/planx/planx_test.go:60 +0xade fp=0xc0000ebee8 sp=0xc0000ebdf8 pc=0x108d711e
testing.tRunner(0xc0005dc4e0, 0x10e8e2b8)
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:1689 +0x21f fp=0xc0000ebfb0 sp=0xc0000ebee8 pc=0xfacb35f
testing.(*T).Run.gowrap1()
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:1742 +0x45 fp=0xc0000ebfe0 sp=0xc0000ebfb0 pc=0xfacd0a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000ebfe8 sp=0xc0000ebfe0 pc=0xf9a1ee1
created by testing.(*T).Run in goroutine 1
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:1742 +0x826

goroutine 1 gp=0xc0000061c0 m=nil [chan receive]:
runtime.gopark(0x18?, 0x11c15c80?, 0x18?, 0x0?, 0x12c8d1a8?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0005c7710 sp=0xc0005c76f0 pc=0xf9676ce
runtime.chanrecv(0xc0006920e0, 0xc0005c77f7, 0x1)
/Users/timmy/sdk/go1.22.0/src/runtime/chan.go:583 +0x36d fp=0xc0005c7788 sp=0xc0005c7710 pc=0xf93166d
runtime.chanrecv1(0x11c15c80?, 0x10d2d4a0?)
/Users/timmy/sdk/go1.22.0/src/runtime/chan.go:442 +0x12 fp=0xc0005c77b0 sp=0xc0005c7788 pc=0xf9312d2
testing.(*T).Run(0xc0005dc340, {0x108f47d3, 0x19}, 0x10e8e2b8)
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:1750 +0x851 fp=0xc0005c78d0 sp=0xc0005c77b0 pc=0xfacce11
testing.runTests.func1(0xc0005dc340)
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:2161 +0x86 fp=0xc0005c7920 sp=0xc0005c78d0 pc=0xfad0fa6
testing.tRunner(0xc0005dc340, 0xc0005c7b10)
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:1689 +0x21f fp=0xc0005c79e8 sp=0xc0005c7920 pc=0xfacb35f
testing.runTests(0xc0000125b8, {0x11bcd900, 0x4, 0x4}, {0xc0005c7bb8?, 0xc0005c7c00?, 0x11c16fa0?})
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:2159 +0x8bf fp=0xc0005c7b40 sp=0xc0005c79e8 pc=0xfad0dff
testing.(*M).Run(0xc0005de1e0)
/Users/timmy/sdk/go1.22.0/src/testing/testing.go:2027 +0xf18 fp=0xc0005c7ec8 sp=0xc0005c7b40 pc=0xface3d8
main.main()
_testmain.go:55 +0x2be fp=0xc0005c7f50 sp=0xc0005c7ec8 pc=0x108d89fe
runtime.main()
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:271 +0x29d fp=0xc0005c7fe0 sp=0xc0005c7f50 pc=0xf96725d
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0005c7fe8 sp=0xc0005c7fe0 pc=0xf9a1ee1

goroutine 2 gp=0xc000006c40 m=nil [force gc (idle)]:
runtime.gopark(0x11524110?, 0x11c19320?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000727a8 sp=0xc000072788 pc=0xf9676ce
runtime.goparkunlock(...)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:408
runtime.forcegchelper()
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:326 +0xb3 fp=0xc0000727e0 sp=0xc0000727a8 pc=0xf967533
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000727e8 sp=0xc0000727e0 pc=0xf9a1ee1
created by runtime.init.6 in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:314 +0x1a

goroutine 3 gp=0xc000007500 m=nil [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc000088f80 sp=0xc000088f60 pc=0xf9676ce
runtime.goparkunlock(...)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:408
runtime.bgsweep(0xc00007e000)
/Users/timmy/sdk/go1.22.0/src/runtime/mgcsweep.go:318 +0xdf fp=0xc000088fc8 sp=0xc000088f80 pc=0xf95199f
runtime.gcenable.gowrap1()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:203 +0x25 fp=0xc000088fe0 sp=0xc000088fc8 pc=0xf9462c5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc000088fe8 sp=0xc000088fe0 pc=0xf9a1ee1
created by runtime.gcenable in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc0000076c0 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x10c9c4e0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc00008ef78 sp=0xc00008ef58 pc=0xf9676ce
runtime.goparkunlock(...)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:408
runtime.(*scavengerState).park(0x11c17140)
/Users/timmy/sdk/go1.22.0/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc00008efa8 sp=0xc00008ef78 pc=0xf94f369
runtime.bgscavenge(0xc00007e000)
/Users/timmy/sdk/go1.22.0/src/runtime/mgcscavenge.go:658 +0x59 fp=0xc00008efc8 sp=0xc00008efa8 pc=0xf94f8f9
runtime.gcenable.gowrap2()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:204 +0x25 fp=0xc00008efe0 sp=0xc00008efc8 pc=0xf946265
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00008efe8 sp=0xc00008efe0 pc=0xf9a1ee1
created by runtime.gcenable in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000007880 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc000089e20 sp=0xc000089e00 pc=0xf9676ce
runtime.runfinq()
/Users/timmy/sdk/go1.22.0/src/runtime/mfinal.go:194 +0x145 fp=0xc000089fe0 sp=0xc000089e20 pc=0xf945305
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc000089fe8 sp=0xc000089fe0 pc=0xf9a1ee1
created by runtime.createfing in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mfinal.go:164 +0x3d

goroutine 6 gp=0xc000332fc0 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b7f50 sp=0xc0000b7f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b7fe0 sp=0xc0000b7f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b7fe8 sp=0xc0000b7fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 18 gp=0xc000186380 m=nil [GC worker (idle)]:
runtime.gopark(0xf9396e5?, 0x48?, 0xe0?, 0x74?, 0x1?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b6f50 sp=0xc0000b6f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b6fe0 sp=0xc0000b6f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b6fe8 sp=0xc0000b6fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 7 gp=0xc000333180 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557dfca0ae?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b5f50 sp=0xc0000b5f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b5fe0 sp=0xc0000b5f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b5fe8 sp=0xc0000b5fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 19 gp=0xc000186540 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557df801e9?, 0x10c9c4e0?, 0x1?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b4f50 sp=0xc0000b4f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b4fe0 sp=0xc0000b4f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b4fe8 sp=0xc0000b4fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 20 gp=0xc000186700 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557df8f189?, 0x3?, 0xe0?, 0xb0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b3f50 sp=0xc0000b3f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b3fe0 sp=0xc0000b3f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b3fe8 sp=0xc0000b3fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 8 gp=0xc000333340 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557df8f478?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b2f50 sp=0xc0000b2f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b2fe0 sp=0xc0000b2f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b2fe8 sp=0xc0000b2fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 21 gp=0xc0001868c0 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557e083f7b?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b1f50 sp=0xc0000b1f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b1fe0 sp=0xc0000b1f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b1fe8 sp=0xc0000b1fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c

goroutine 34 gp=0xc0000a4380 m=nil [GC worker (idle)]:
runtime.gopark(0x7e557df97755?, 0x0?, 0x0?, 0x0?, 0x0?)
/Users/timmy/sdk/go1.22.0/src/runtime/proc.go:402 +0xce fp=0xc0000b0f50 sp=0xc0000b0f30 pc=0xf9676ce
runtime.gcBgMarkWorker()
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1310 +0xe5 fp=0xc0000b0fe0 sp=0xc0000b0f50 pc=0xf9483a5
runtime.goexit({})
/Users/timmy/sdk/go1.22.0/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0000b0fe8 sp=0xc0000b0fe0 pc=0xf9a1ee1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/Users/timmy/sdk/go1.22.0/src/runtime/mgc.go:1234 +0x1c
FAIL github.com/timmy21/test/planx 1.113s
FAIL

What did you expect to see?

test passed used bellow command:
go1.21.7 test -timeout 30s -run ^TestPlanVisitor$ github.com/timmy21/test/planx -v -count 1 -race
go1.22.0 test -timeout 30s -run ^TestPlanVisitor$ github.com/timmy21/test/planx -v -count 1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions