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: SIGSEGV via go test ./... on Fedora linux/amd64 with go1.19.7 #59372

Closed
nnnewb opened this issue Apr 1, 2023 · 3 comments
Closed

runtime: SIGSEGV via go test ./... on Fedora linux/amd64 with go1.19.7 #59372

nnnewb opened this issue Apr 1, 2023 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@nnnewb
Copy link

nnnewb commented Apr 1, 2023

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

[weakptr@10 battery]$ ~/.local/go1.20.2/bin/go version
go version go1.20.2 linux/amd64

[weakptr@10 battery]$ ~/.local/go1.18.10/bin/go version
go version go1.18.10 linux/amd64

[weakptr@10 battery]$ ~/.local/go1.19.7/bin/go version
go version go1.19.7 linux/amd64

Does this issue reproduce with the latest release?

No. Reproduced with go1.18.10 and go1.19.7

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

go env (1.18.10) Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/weakptr/.cache/go-build"
GOENV="/home/weakptr/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/weakptr/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/weakptr/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/weakptr/.local/go1.18.10"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/weakptr/.local/go1.18.10/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.10"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/weakptr/repos/battery/go.mod"
GOWORK=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build197587557=/tmp/go-build -gno-record-gcc-switches"
go env (1.19.7) Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/weakptr/.cache/go-build"
GOENV="/home/weakptr/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/weakptr/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/weakptr/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/weakptr/.local/go1.19.7"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/weakptr/.local/go1.19.7/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.7"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/weakptr/repos/battery/go.mod"
GOWORK=""
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3678144156=/tmp/go-build -gno-record-gcc-switches"
go env (1.20.2) Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/weakptr/.cache/go-build"
GOENV="/home/weakptr/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/weakptr/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/weakptr/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/weakptr/.local/go1.20.2"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/weakptr/.local/go1.20.2/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/weakptr/repos/battery/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build446159502=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Operating System
$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="37 (Server Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Server Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
SUPPORT_END=2023-11-14
VARIANT="Server Edition"
VARIANT_ID=server
(1.19.7) go test -v ./...
go test -v ./...
  shell: /usr/bin/bash -e {0}
=== RUN   TestAssert
--- PASS: TestAssert (0.00s)
=== RUN   TestEmpty
=== RUN   TestEmpty/empty_slice
=== RUN   TestEmpty/nil
--- PASS: TestEmpty (0.00s)
    --- PASS: TestEmpty/empty_slice (0.00s)
    --- PASS: TestEmpty/nil (0.00s)
=== RUN   TestEqual
=== RUN   TestEqual/equals
--- PASS: TestEqual (0.00s)
    --- PASS: TestEqual/equals (0.00s)
PASS
ok  	github.com/nnnewb/battery/internal/assert	0.011s
?   	github.com/nnnewb/battery/internal/constraints	[no test files]
?   	github.com/nnnewb/battery/internal/optional	[no test files]
?   	github.com/nnnewb/battery/internal/predicate	[no test files]
=== RUN   TestAll
=== RUN   TestAll/empty
=== RUN   TestAll/expect_true
=== RUN   TestAll/expect_false
--- PASS: TestAll (0.00s)
    --- PASS: TestAll/empty (0.00s)
    --- PASS: TestAll/expect_true (0.00s)
    --- PASS: TestAll/expect_false (0.00s)
=== RUN   TestAny
=== RUN   TestAny/expect_true
=== RUN   TestAny/expect_false
=== RUN   TestAny/exhausted
--- PASS: TestAny (0.00s)
    --- PASS: TestAny/expect_true (0.00s)
    --- PASS: TestAny/expect_false (0.00s)
    --- PASS: TestAny/exhausted (0.00s)
=== RUN   TestChainMultiple
--- PASS: TestChainMultiple (0.00s)
=== RUN   TestChainSingle
--- PASS: TestChainSingle (0.00s)
=== RUN   TestChainEmpty
--- PASS: TestChainEmpty (0.00s)
=== RUN   TestChainExhausted
--- PASS: TestChainExhausted (0.00s)
=== RUN   TestFromChannel
--- PASS: TestFromChannel (0.00s)
=== RUN   TestFromChannelEmpty
--- PASS: TestFromChannelEmpty (0.00s)
=== RUN   TestCollect
--- PASS: TestCollect (0.00s)
=== RUN   TestCollectEmpty
--- PASS: TestCollectEmpty (0.00s)
=== RUN   TestContains
=== RUN   TestContains/expect_true
=== RUN   TestContains/expect_false
=== RUN   TestContains/exhausted
--- PASS: TestContains (0.00s)
    --- PASS: TestContains/expect_true (0.00s)
    --- PASS: TestContains/expect_false (0.00s)
    --- PASS: TestContains/exhausted (0.00s)
=== RUN   TestCountBy
=== RUN   TestCountBy/exhausted
=== RUN   TestCountBy/simple
--- PASS: TestCountBy (0.00s)
    --- PASS: TestCountBy/exhausted (0.00s)
    --- PASS: TestCountBy/simple (0.00s)
=== RUN   TestExhausted
--- PASS: TestExhausted (0.00s)
=== RUN   TestFilter
--- PASS: TestFilter (0.00s)
=== RUN   TestFilterEmpty
--- PASS: TestFilterEmpty (0.00s)
=== RUN   TestFilterExhausted
--- PASS: TestFilterExhausted (0.00s)
=== RUN   TestFilterExhaustedLater
--- PASS: TestFilterExhaustedLater (0.00s)
=== RUN   TestFilterTableDriven
=== RUN   TestFilterTableDriven/empty
unexpected fault address 0x679000
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x679000 pc=0x467649]

goroutine 36 [running]:
runtime.throw({0x546c8c?, 0xc0000727f8?})
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/panic.go:1047 +0x5d fp=0xc000072778 sp=0xc000072748 pc=0x43621d
runtime.sigpanic()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/signal_unix.go:842 +0x2c5 fp=0xc0000727c8 sp=0xc000072778 pc=0x44af25
runtime.memmove()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/memmove_amd64.s:174 +0x129 fp=0xc0000727d0 sp=0xc0000727c8 pc=0x467649
runtime.typedmemmove(0x51ad80, 0xc000145340, 0x679000)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mbarrier.go:171 +0x65 fp=0xc000072808 sp=0xc0000727d0 pc=0x412e05
reflect.typedmemmove(0xc000072898?, 0xc00007672b?, 0x1?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mbarrier.go:191 +0x19 fp=0xc000072830 sp=0xc000072808 pc=0x461559
reflect.packEface({0x51ad80?, 0x679000?, 0x7f7c88d87700?})
/opt/hostedtoolcache/go/1.19.7/x64/src/reflect/value.go:123 +0x65 fp=0xc000072880 sp=0xc000072830 pc=0x4985a5
reflect.valueInterface({0x51ad80?, 0x679000?, 0xc00?}, 0x3?)
/opt/hostedtoolcache/go/1.19.7/x64/src/reflect/value.go:1508 +0xbb fp=0xc0000728c0 sp=0xc000072880 pc=0x49a51b
reflect.Value.Interface(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/reflect/value.go:1478
fmt.(*pp).printValue(0xc000076680, {0x51ad80?, 0x679000?, 0x49d179?}, 0x76, 0x1)
/opt/hostedtoolcache/go/1.19.7/x64/src/fmt/print.go:753 +0xa5 fp=0xc000072ab0 sp=0xc0000728c0 pc=0x4a4e65
fmt.(*pp).printValue(0xc000076680, {0x5183a0?, 0xc000010480?, 0xc000010450?}, 0x76, 0x0)
/opt/hostedtoolcache/go/1.19.7/x64/src/fmt/print.go:896 +0x16b2 fp=0xc000072ca0 sp=0xc000072ab0 pc=0x4a6472
fmt.(*pp).printArg(0xc000076680, {0x5183a0?, 0xc000010480}, 0x76)
/opt/hostedtoolcache/go/1.19.7/x64/src/fmt/print.go:743 +0x756 fp=0xc000072d40 sp=0xc000072ca0 pc=0x4a4d36
fmt.(*pp).doPrintf(0xc000076680, {0x54b284, 0x17}, {0xc000072f40?, 0x2, 0x2})
/opt/hostedtoolcache/go/1.19.7/x64/src/fmt/print.go:1057 +0x288 fp=0xc000072e38 sp=0xc000072d40 pc=0x4a7768
fmt.Sprintf({0x54b284, 0x17}, {0xc000072f40, 0x2, 0x2})
/opt/hostedtoolcache/go/1.19.7/x64/src/fmt/print.go:219 +0x59 fp=0xc000072e90 sp=0xc000072e38 pc=0x4a19b9
testing.(*common).Errorf(0xc000126d00, {0x54b284?, 0x578ce0?}, {0xc000072f40?, 0x51b?, 0x4bd620?})
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:940 +0x45 fp=0xc000072ee8 sp=0xc000072e90 pc=0x4bcb65
github.com/nnnewb/battery/iter.TestFilterTableDriven.func1(0xc000126d00)
/home/runner/work/battery/battery/iter/filter_test.go:104 +0x10d fp=0xc000072f70 sp=0xc000072ee8 pc=0x4fdccd
testing.tRunner(0xc000126d00, 0xc000074cc0)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000072fc0 sp=0xc000072f70 pc=0x4bd72b
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x2a fp=0xc000072fe0 sp=0xc000072fc0 pc=0x4be5ca
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000072fe8 sp=0xc000072fe0 pc=0x466681
created by testing.(*T).Run
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x35f

goroutine 1 [chan receive]:
runtime.gopark(0x1?, 0xc000070aa8?, 0xff?, 0xcd?, 0xc000070a58?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000070a28 sp=0xc000070a08 pc=0x438e36
runtime.chanrecv(0xc00001ef50, 0xc000070b27, 0x1)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:583 +0x49b fp=0xc000070ab8 sp=0xc000070a28 pc=0x40673b
runtime.chanrecv1(0x54aa7e?, 0x54aa7e?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:442 +0x18 fp=0xc000070ae0 sp=0xc000070ab8 pc=0x406238
testing.(*T).Run(0xc0000076c0, {0x54aa7e?, 0x4bd485?}, 0x5528d0)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1494 +0x37a fp=0xc000070b80 sp=0xc000070ae0 pc=0x4be51a
testing.runTests.func1(0xc000074390?)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1846 +0x6e fp=0xc000070bd0 sp=0xc000070b80 pc=0x4c040e
testing.tRunner(0xc0000076c0, 0xc000070cd8)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000070c20 sp=0xc000070bd0 pc=0x4bd72b
testing.runTests(0xc000000140?, {0x63f580, 0x2c, 0x2c}, {0x7f7cb00af108?, 0x40?, 0x6435c0?})
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1844 +0x456 fp=0xc000070d08 sp=0xc000070c20 pc=0x4c02b6
testing.(*M).Run(0xc000000140)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1726 +0x5d9 fp=0xc000070f00 sp=0xc000070d08 pc=0x4bed99
main.main()
_testmain.go:181 +0x1aa fp=0xc000070f80 sp=0xc000070f00 pc=0x50a20a
runtime.main()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:250 +0x212 fp=0xc000070fe0 sp=0xc000070f80 pc=0x438a72
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000070fe8 sp=0xc000070fe0 pc=0x466681

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000040fb0 sp=0xc000040f90 pc=0x438e36
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.forcegchelper()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:302 +0xad fp=0xc000040fe0 sp=0xc000040fb0 pc=0x438ccd
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000040fe8 sp=0xc000040fe0 pc=0x466681
created by runtime.init.6
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:290 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000041790 sp=0xc000041770 pc=0x438e36
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcsweep.go:278 +0x8e fp=0xc0000417c8 sp=0xc000041790 pc=0x423d8e
runtime.gcenable.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:178 +0x26 fp=0xc0000417e0 sp=0xc0000417c8 pc=0x418a46
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000417e8 sp=0xc0000417e0 pc=0x466681
created by runtime.gcenable
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00001e230?, 0x576d10?, 0x1?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000041f70 sp=0xc000041f50 pc=0x438e36
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.(*scavengerState).park(0x643640)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc000041fa0 sp=0xc000041f70 pc=0x421e33
runtime.bgscavenge(0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcscavenge.go:617 +0x45 fp=0xc000041fc8 sp=0xc000041fa0 pc=0x422405
runtime.gcenable.func2()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:179 +0x26 fp=0xc000041fe0 sp=0xc000041fc8 pc=0x4189e6
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000041fe8 sp=0xc000041fe0 pc=0x466681
created by runtime.gcenable
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:179 +0xaa

goroutine 5 [runnable]:
runtime.runfinq()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mfinal.go:162 fp=0xc0000407e0 sp=0xc0000407d8 pc=0x417a40
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000407e8 sp=0xc0000407e0 pc=0x466681
created by runtime.createfing
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mfinal.go:157 +0x45

goroutine 35 [chan receive]:
runtime.gopark(0x1?, 0xc000071ce0?, 0xff?, 0xcd?, 0xc000071c90?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000071c60 sp=0xc000071c40 pc=0x438e36
runtime.chanrecv(0xc00001efc0, 0xc000071d5f, 0x1)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:583 +0x49b fp=0xc000071cf0 sp=0xc000071c60 pc=0x40673b
runtime.chanrecv1(0xc00001c2c0?, 0xc00001c2c0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:442 +0x18 fp=0xc000071d18 sp=0xc000071cf0 pc=0x406238
testing.(*T).Run(0xc000126b60, {0x546c82?, 0xc00002cd80?}, 0xc000074cc0)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1494 +0x37a fp=0xc000071db8 sp=0xc000071d18 pc=0x4be51a
github.com/nnnewb/battery/iter.TestFilterTableDriven(0xc000126820?)
/home/runner/work/battery/battery/iter/filter_test.go:102 +0x42d fp=0xc000071f70 sp=0xc000071db8 pc=0x4fdb6d
testing.tRunner(0xc000126b60, 0x5528d0)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000071fc0 sp=0xc000071f70 pc=0x4bd72b
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x2a fp=0xc000071fe0 sp=0xc000071fc0 pc=0x4be5ca
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000071fe8 sp=0xc000071fe0 pc=0x466681
created by testing.(*T).Run
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x35f
FAIL github.com/nnnewb/battery/iter 0.009s
testing: warning: no tests to run
PASS
ok github.com/nnnewb/battery/maps 0.002s [no tests to run]
=== RUN TestSet_Add
=== RUN TestSet_Add/add_single
unexpected fault address 0x64a000
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x64a000 pc=0x4fadcc]

goroutine 7 [running]:
runtime.throw({0x52aefc?, 0x410e4b?})
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/panic.go:1047 +0x5d fp=0xc000072e88 sp=0xc000072e58 pc=0x4361dd
runtime.sigpanic()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/signal_unix.go:842 +0x2c5 fp=0xc000072ed8 sp=0xc000072e88 pc=0x44aee5
github.com/nnnewb/battery/set.Set[...].Add(0x5ebfd0?, {0x4bd740?, 0xc000007ba0, 0x4bc625})
/home/runner/work/battery/battery/set/set.go:17 +0x2c fp=0xc000072f10 sp=0xc000072ed8 pc=0x4fadcc
github.com/nnnewb/battery/set.TestSet_Add.func1(0x0?)
/home/runner/work/battery/battery/set/set_test.go:44 +0x45 fp=0xc000072f70 sp=0xc000072f10 pc=0x4f9d25
testing.tRunner(0xc000007ba0, 0xc00002c590)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000072fc0 sp=0xc000072f70 pc=0x4bc8cb
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x2a fp=0xc000072fe0 sp=0xc000072fc0 pc=0x4bd76a
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000072fe8 sp=0xc000072fe0 pc=0x466641
created by testing.(*T).Run
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x35f

goroutine 1 [chan receive]:
runtime.gopark(0x1?, 0xc000070aa8?, 0xbf?, 0xcd?, 0xc000070a58?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000070a28 sp=0xc000070a08 pc=0x438df6
runtime.chanrecv(0xc00001e310, 0xc000070b27, 0x1)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:583 +0x49b fp=0xc000070ab8 sp=0xc000070a28 pc=0x4066fb
runtime.chanrecv1(0x52c1ab?, 0x52c1ab?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:442 +0x18 fp=0xc000070ae0 sp=0xc000070ab8 pc=0x406238
testing.(*T).Run(0xc0000076c0, {0x52c1ab?, 0x4bc625?}, 0x536328)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1494 +0x37a fp=0xc000070b80 sp=0xc000070ae0 pc=0x4bd6ba
testing.runTests.func1(0xc000074390?)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1846 +0x6e fp=0xc000070bd0 sp=0xc000070b80 pc=0x4bf5ae
testing.tRunner(0xc0000076c0, 0xc000070cd8)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000070c20 sp=0xc000070bd0 pc=0x4bc8cb
testing.runTests(0xc000000140?, {0x610440, 0x5, 0x5}, {0x7fdd37783108?, 0x40?, 0x614c20?})
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1844 +0x456 fp=0xc000070d08 sp=0xc000070c20 pc=0x4bf456
testing.(*M).Run(0xc000000140)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1726 +0x5d9 fp=0xc000070f00 sp=0xc000070d08 pc=0x4bdf39
main.main()
_testmain.go:55 +0x1aa fp=0xc000070f80 sp=0xc000070f00 pc=0x4fb38a
runtime.main()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:250 +0x212 fp=0xc000070fe0 sp=0xc000070f80 pc=0x438a32
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000070fe8 sp=0xc000070fe0 pc=0x466641

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000040fb0 sp=0xc000040f90 pc=0x438df6
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.forcegchelper()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:302 +0xad fp=0xc000040fe0 sp=0xc000040fb0 pc=0x438c8d
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000040fe8 sp=0xc000040fe0 pc=0x466641
created by runtime.init.6
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:290 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000041790 sp=0xc000041770 pc=0x438df6
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcsweep.go:297 +0xd7 fp=0xc0000417c8 sp=0xc000041790 pc=0x423d97
runtime.gcenable.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:178 +0x26 fp=0xc0000417e0 sp=0xc0000417c8 pc=0x418a06
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000417e8 sp=0xc0000417e0 pc=0x466641
created by runtime.gcenable
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00001e230?, 0x559958?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000041f70 sp=0xc000041f50 pc=0x438df6
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.(*scavengerState).park(0x614ca0)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc000041fa0 sp=0xc000041f70 pc=0x421df3
runtime.bgscavenge(0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgcscavenge.go:622 +0x65 fp=0xc000041fc8 sp=0xc000041fa0 pc=0x4223e5
runtime.gcenable.func2()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:179 +0x26 fp=0xc000041fe0 sp=0xc000041fc8 pc=0x4189a6
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000041fe8 sp=0xc000041fe0 pc=0x466641
created by runtime.gcenable
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:179 +0xaa

goroutine 5 [finalizer wait]:
runtime.gopark(0x0?, 0xc000040670?, 0xab?, 0x5e?, 0xc000040770?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000040628 sp=0xc000040608 pc=0x438df6
runtime.goparkunlock(...)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:369
runtime.runfinq()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mfinal.go:180 +0x10f fp=0xc0000407e0 sp=0xc000040628 pc=0x417b0f
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000407e8 sp=0xc0000407e0 pc=0x466641
created by runtime.createfing
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mfinal.go:157 +0x45

goroutine 6 [chan receive]:
runtime.gopark(0x1?, 0xc000071da0?, 0xbf?, 0xcd?, 0xc000071d50?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000071d20 sp=0xc000071d00 pc=0x438df6
runtime.chanrecv(0xc00001e380, 0xc000071e1f, 0x1)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:583 +0x49b fp=0xc000071db0 sp=0xc000071d20 pc=0x4066fb
runtime.chanrecv1(0xc0000201f8?, 0xc0000201f8?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/chan.go:442 +0x18 fp=0xc000071dd8 sp=0xc000071db0 pc=0x406238
testing.(*T).Run(0xc000007860, {0x52beb1?, 0x4bc7f3?}, 0xc00002c590)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1494 +0x37a fp=0xc000071e78 sp=0xc000071dd8 pc=0x4bd6ba
github.com/nnnewb/battery/set.TestSet_Add(0x0?)
/home/runner/work/battery/battery/set/set_test.go:43 +0x228 fp=0xc000071f70 sp=0xc000071e78 pc=0x4f9ca8
testing.tRunner(0xc000007860, 0x536328)
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1446 +0x10b fp=0xc000071fc0 sp=0xc000071f70 pc=0x4bc8cb
testing.(*T).Run.func1()
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x2a fp=0xc000071fe0 sp=0xc000071fc0 pc=0x4bd76a
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000071fe8 sp=0xc000071fe0 pc=0x466641
created by testing.(*T).Run
/opt/hostedtoolcache/go/1.19.7/x64/src/testing/testing.go:1493 +0x35f

goroutine 8 [GC worker (idle)]:
runtime.gopark(0x2fc53a3f0e?, 0xc000010078?, 0xb0?, 0x27?, 0x4bc8cb?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc000042750 sp=0xc000042730 pc=0x438df6
runtime.gcBgMarkWorker()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:1235 +0xf1 fp=0xc0000427e0 sp=0xc000042750 pc=0x41ab51
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000427e8 sp=0xc0000427e0 pc=0x466641
created by runtime.gcBgMarkStartWorkers
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:1159 +0x25

goroutine 17 [GC worker (idle)]:
runtime.gopark(0x2fc53b5e8f?, 0x0?, 0x0?, 0x0?, 0x0?)
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/proc.go:363 +0xd6 fp=0xc00003c750 sp=0xc00003c730 pc=0x438df6
runtime.gcBgMarkWorker()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:1235 +0xf1 fp=0xc00003c7e0 sp=0xc00003c750 pc=0x41ab51
runtime.goexit()
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00003c7e8 sp=0xc00003c7e0 pc=0x466641
created by runtime.gcBgMarkStartWorkers
/opt/hostedtoolcache/go/1.19.7/x64/src/runtime/mgc.go:1159 +0x25
FAIL github.com/nnnewb/battery/set 0.042s
=== RUN TestEqual
--- PASS: TestEqual (0.00s)
=== RUN TestEqualFunc
--- PASS: TestEqualFunc (0.00s)
PASS
ok github.com/nnnewb/battery/slices 0.009s
FAIL

I saw strange variable types when debugging the above problem.
C0YKNYH1DMZ75VBRQ$A962U
PCTT_@GSDIOHFKDCK)6)29P

I tried to write a minimal reproducible demo but failed. The example I wrote did not trigger the problem.
I got around this problem by renaming the same name type defined within the test function, but defining the same name type doesn't seem to necessarily trigger this problem.

This demo not trigger the problem
package main

import "fmt"

func func1() {
type demo struct {
name string
field []int
}

data := []demo{
	{
		name:  "123",
		field: []int{},
	},
	{
		name:  "456",
		field: []int{1, 2, 3},
	},
}

for _, v := range data {
	fmt.Printf("name %v data %v\n", v.name, v.field)
}

}

func func2() {
type demo struct {
name string
field map[int][]int
}

data := []demo{
	{
		name:  "123",
		field: map[int][]int{},
	},
	{
		name:  "456",
		field: map[int][]int{1: {1, 2, 3}, 2: {4, 5, 6}},
	},
}

for _, v := range data {
	fmt.Printf("name %v data %v\n", v.name, v.field)
}

}

func main() {
func1()
func2()
}

reproduced in github action

repo: https://github.com/nnnewb/battery

reproduced with go1.19.7
commit: 0dc97862b583962b1d6dd5fb3b8a66d115710b38

reproduced with go1.18.10
commit: d3ce412a6b676def603be24cc1c68a10e4a00ffb

What did you expect to see?

not panic.

What did you see instead?

unexpected fault address 0x679000
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x679000 pc=0x467649]
@seankhliao
Copy link
Member

does it reproduce with the latest release (1.20)?

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 2, 2023
@nnnewb
Copy link
Author

nnnewb commented Apr 2, 2023

does it reproduce with the latest release (1.20)?

no. I tested it on fedora 37 using go1.18.10, 1.19.7 and 1.20.2, and have only seen this error so far on go1.18.10 and go1.19.7

Not sure if this issue has been reported and fixed in go1.20.2.

@nnnewb nnnewb changed the title unexpected segment fault error: unexpected fault address 0x66b000 runtime: SIGSEGV via go test ./... on Fedora linux/amd64 with go1.19.7 Apr 3, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Apr 3, 2023
@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Sep 18, 2023
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants