Skip to content

runtime: TestSegv fails with the latest tip version #49192

Closed
@YoshikiShibata

Description

@YoshikiShibata

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

$ go version
go version devel go1.18-68bd5121ee Wed Oct 27 20:03:17 2021 +0000 darwin/arm64

Does this issue reproduce with the latest release?

N/A

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/yoshikishibata/Library/Caches/go-build"
GOENV="/Users/yoshikishibata/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/yoshikishibata/gocode/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/yoshikishibata/gocode"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/yoshikishibata/tools/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/yoshikishibata/tools/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel go1.18-68bd5121ee Wed Oct 27 20:03:17 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/fs/3c1rlryd2v3_z5m04g3lnd580000gn/T/go-build2508213166=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version devel go1.18-68bd5121ee Wed Oct 27 20:03:17 2021 +0000 darwin/arm64
GOROOT/bin/go tool compile -V: compile version devel go1.18-68bd5121ee Wed Oct 27 20:03:17 2021 +0000
uname -v: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559
lldb --version: lldb-1205.0.27.3
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)

What did you do?

Rebuild the tip version with all.bash

What did you expect to see?

No error

What did you see instead?

ok  	regexp/syntax	0.385s
--- FAIL: TestSegv (0.00s)
    --- FAIL: TestSegv/Segv (0.02s)
        crash_test.go:104: /var/folders/fs/3c1rlryd2v3_z5m04g3lnd580000gn/T/go-build2955476496/testprogcgo.exe Segv exit status: exit status 2
        crash_cgo_test.go:623: fatal error: unexpected signal during runtime execution
            [signal SIGSEGV: segmentation violation code=0x2 addr=0x100bee66f pc=0x1b51a145c]
            
            runtime stack:
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16f3ab040, fp:0x16f3ab060} stack=[0x16f32c038,0x16f3ab0b0)
            0x000000016f3aaf40:  0x0000000100b4e48d  0x000000016f3aaf88 
            0x000000016f3aaf50:  0x0000000100a89de0 <runtime.fatalthrow+0x0000000000000040>  0x0000000100c541a0 
            0x000000016f3aaf60:  0x0000000100b71d5e  0x0000000000000001 
            0x000000016f3aaf70:  0x000000016f3aafd0  0x0000000100a89c00 <runtime.throw+0x0000000000000050> 
            0x000000016f3aaf80:  0x0000000100c541a0  0x000000016f3aafc8 
            0x000000016f3aaf90:  0x0000000100a89c00 <runtime.throw+0x0000000000000050>  0x000000016f3aafa8 
            0x000000016f3aafa0:  0x0000000100a89be8 <runtime.throw+0x0000000000000038>  0x0000000100a89e00 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016f3aafb0:  0x0000000100c541a0  0x0000000100a89c00 <runtime.throw+0x0000000000000050> 
            0x000000016f3aafc0:  0x000000016f3aafd0  0x000000016f3aaff8 
            0x000000016f3aafd0:  0x0000000100aa0cf8 <runtime.sigpanic+0x00000000000001e8>  0x000000016f3aafe0 
            0x000000016f3aafe0:  0x0000000100a89c20 <runtime.throw.func1+0x0000000000000000>  0x0000000100b507f8 
            0x000000016f3aaff0:  0x000000000000002a  0x000000016f3ab048 
            0x000000016f3ab000:  0x0000000100ab9d8c <runtime.syscall+0x000000000000002c>  0x0000000100b507f8 
            0x000000016f3ab010:  0x0000000100c541a0  0x0000000000000000 
            0x000000016f3ab020:  0x0000000100ab63c4 <runtime.mcall+0x0000000000000054>  0x0000014000092340 
            0x000000016f3ab030:  0x0000000100ab9d8c <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016f3ab040: <0x0000000000000001  0x0000014000049e28 
            0x000000016f3ab050:  0x0000000100ab896c <runtime.asmcgocall+0x000000000000007c>  0x0000000100b43f14 <main.Segv+0x0000000000000074> 
            0x000000016f3ab060: >0x00000140000021a0  0x0000000000000240 
            0x000000016f3ab070:  0x0000000100ab6350 <runtime.mstart+0x0000000000000010>  0x000000016f3ab0c8 
            0x000000016f3ab080:  0x0000000100ab6318 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016f3ab090:  0x0000000100c541a0  0x000000016f3ab0c8 
            0x000000016f3ab0a0:  0x0000000100ab6320 <runtime.rt0_go+0x00000000000000f0>  0x0000000100ba5d10 
            runtime.throw({0x100b507f8, 0x100c541a0})
            	/Users/yoshikishibata/tools/go/src/runtime/panic.go:965 +0x50
            runtime.sigpanic()
            	/Users/yoshikishibata/tools/go/src/runtime/signal_unix.go:782 +0x1e8
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16f3ab040, fp:0x16f3ab060} stack=[0x16f32c038,0x16f3ab0b0)
            0x000000016f3aaf40:  0x0000000100b4e48d  0x000000016f3aaf88 
            0x000000016f3aaf50:  0x0000000100a89de0 <runtime.fatalthrow+0x0000000000000040>  0x0000000100c541a0 
            0x000000016f3aaf60:  0x0000000100b71d5e  0x0000000000000001 
            0x000000016f3aaf70:  0x000000016f3aafd0  0x0000000100a89c00 <runtime.throw+0x0000000000000050> 
            0x000000016f3aaf80:  0x0000000100c541a0  0x000000016f3aafc8 
            0x000000016f3aaf90:  0x0000000100a89c00 <runtime.throw+0x0000000000000050>  0x000000016f3aafa8 
            0x000000016f3aafa0:  0x0000000100a89be8 <runtime.throw+0x0000000000000038>  0x0000000100a89e00 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016f3aafb0:  0x0000000100c541a0  0x0000000100a89c00 <runtime.throw+0x0000000000000050> 
            0x000000016f3aafc0:  0x000000016f3aafd0  0x000000016f3aaff8 
            0x000000016f3aafd0:  0x0000000100aa0cf8 <runtime.sigpanic+0x00000000000001e8>  0x000000016f3aafe0 
            0x000000016f3aafe0:  0x0000000100a89c20 <runtime.throw.func1+0x0000000000000000>  0x0000000100b507f8 
            0x000000016f3aaff0:  0x000000000000002a  0x000000016f3ab048 
            0x000000016f3ab000:  0x0000000100ab9d8c <runtime.syscall+0x000000000000002c>  0x0000000100b507f8 
            0x000000016f3ab010:  0x0000000100c541a0  0x0000000000000000 
            0x000000016f3ab020:  0x0000000100ab63c4 <runtime.mcall+0x0000000000000054>  0x0000014000092340 
            0x000000016f3ab030:  0x0000000100ab9d8c <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016f3ab040: <0x0000000000000001  0x0000014000049e28 
            0x000000016f3ab050:  0x0000000100ab896c <runtime.asmcgocall+0x000000000000007c>  0x0000000100b43f14 <main.Segv+0x0000000000000074> 
            0x000000016f3ab060: >0x00000140000021a0  0x0000000000000240 
            0x000000016f3ab070:  0x0000000100ab6350 <runtime.mstart+0x0000000000000010>  0x000000016f3ab0c8 
            0x000000016f3ab080:  0x0000000100ab6318 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016f3ab090:  0x0000000100c541a0  0x000000016f3ab0c8 
            0x000000016f3ab0a0:  0x0000000100ab6320 <runtime.rt0_go+0x00000000000000f0>  0x0000000100ba5d10 
            runtime.syscall()
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin_arm64.s:560 +0x2c
            
            goroutine 1 [syscall]:
            syscall.syscall(0x100ad9170, 0x7701, 0xb, 0x1)
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin.go:22 +0x1c fp=0x14000049e20 sp=0x14000049e00 pc=0x100ab592c
            syscall.syscall(0x140000660c0, 0x0, 0x14000002101, 0x100b43f14)
            	<autogenerated>:1 +0x20 fp=0x14000049e70 sp=0x14000049e20 pc=0x100aba2e0
            syscall.kill(0x14000078038, 0x0, 0x14000078010)
            	/Users/yoshikishibata/tools/go/src/syscall/zsyscall_darwin_arm64.go:368 +0x38 fp=0x14000049ea0 sp=0x14000049e70 pc=0x100ad7818
            syscall.Kill(...)
            	/Users/yoshikishibata/tools/go/src/syscall/syscall_darwin.go:115
            main.Segv()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:35 +0x90 fp=0x14000049ed0 sp=0x14000049ea0 pc=0x100b43f30
            main.main()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/main.go:34 +0x120 fp=0x14000049f70 sp=0x14000049ed0 pc=0x100b3dfb0
            runtime.main()
            	/Users/yoshikishibata/tools/go/src/runtime/proc.go:255 +0x270 fp=0x14000049fd0 sp=0x14000049f70 pc=0x100a8c170
            runtime.goexit()
            	/Users/yoshikishibata/tools/go/src/runtime/asm_arm64.s:1259 +0x4 fp=0x14000049fd0 sp=0x14000049fd0 pc=0x100ab8b44
            
            goroutine 6 [runnable]:
            main.Segv.func1()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:27 +0x24
            created by main.Segv
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:26 +0x74
            
        crash_cgo_test.go:631: unexpectedly saw "SIGSEGV" in output
    --- FAIL: TestSegv/SegvInCgo (0.02s)
        crash_test.go:104: /var/folders/fs/3c1rlryd2v3_z5m04g3lnd580000gn/T/go-build2955476496/testprogcgo.exe SegvInCgo exit status: exit status 2
        crash_cgo_test.go:623: fatal error: unexpected signal during runtime execution
            [signal SIGSEGV: segmentation violation code=0x2 addr=0x1009a4920 pc=0x1b51a145c]
            
            runtime stack:
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16f5c3030, fp:0x16f5c3050} stack=[0x16f544028,0x16f5c30a0)
            0x000000016f5c2f30:  0x000000010093648d  0x000000016f5c2f78 
            0x000000016f5c2f40:  0x0000000100871de0 <runtime.fatalthrow+0x0000000000000040>  0x0000000100a3c1a0 
            0x000000016f5c2f50:  0x0000000100959d5e  0x0000000000000001 
            0x000000016f5c2f60:  0x000000016f5c2fc0  0x0000000100871c00 <runtime.throw+0x0000000000000050> 
            0x000000016f5c2f70:  0x0000000100a3c1a0  0x000000016f5c2fb8 
            0x000000016f5c2f80:  0x0000000100871c00 <runtime.throw+0x0000000000000050>  0x000000016f5c2f98 
            0x000000016f5c2f90:  0x0000000100871be8 <runtime.throw+0x0000000000000038>  0x0000000100871e00 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016f5c2fa0:  0x0000000100a3c1a0  0x0000000100871c00 <runtime.throw+0x0000000000000050> 
            0x000000016f5c2fb0:  0x000000016f5c2fc0  0x000000016f5c2fe8 
            0x000000016f5c2fc0:  0x0000000100888cf8 <runtime.sigpanic+0x00000000000001e8>  0x000000016f5c2fd0 
            0x000000016f5c2fd0:  0x0000000100871c20 <runtime.throw.func1+0x0000000000000000>  0x00000001009387f8 
            0x000000016f5c2fe0:  0x000000000000002a  0x000000016f5c3038 
            0x000000016f5c2ff0:  0x00000001008a1d8c <runtime.syscall+0x000000000000002c>  0x00000001009387f8 
            0x000000016f5c3000:  0x0000000100a3c1a0  0x0000000000000000 
            0x000000016f5c3010:  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c>  0x0000000000000000 
            0x000000016f5c3020:  0x00000001008a1d8c <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016f5c3030: <0x0000000000000001  0x0000014000049e28 
            0x000000016f5c3040:  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c>  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c> 
            0x000000016f5c3050: >0x00000140000021a0  0x0000000000000240 
            0x000000016f5c3060:  0x000000010089e350 <runtime.mstart+0x0000000000000010>  0x000000016f5c30b8 
            0x000000016f5c3070:  0x000000010089e318 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016f5c3080:  0x0000000100a3c1a0  0x000000016f5c30b8 
            0x000000016f5c3090:  0x000000010089e320 <runtime.rt0_go+0x00000000000000f0>  0x000000010098dd10 
            runtime.throw({0x1009387f8, 0x100a3c1a0})
            	/Users/yoshikishibata/tools/go/src/runtime/panic.go:965 +0x50
            runtime.sigpanic()
            	/Users/yoshikishibata/tools/go/src/runtime/signal_unix.go:782 +0x1e8
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16f5c3030, fp:0x16f5c3050} stack=[0x16f544028,0x16f5c30a0)
            0x000000016f5c2f30:  0x000000010093648d  0x000000016f5c2f78 
            0x000000016f5c2f40:  0x0000000100871de0 <runtime.fatalthrow+0x0000000000000040>  0x0000000100a3c1a0 
            0x000000016f5c2f50:  0x0000000100959d5e  0x0000000000000001 
            0x000000016f5c2f60:  0x000000016f5c2fc0  0x0000000100871c00 <runtime.throw+0x0000000000000050> 
            0x000000016f5c2f70:  0x0000000100a3c1a0  0x000000016f5c2fb8 
            0x000000016f5c2f80:  0x0000000100871c00 <runtime.throw+0x0000000000000050>  0x000000016f5c2f98 
            0x000000016f5c2f90:  0x0000000100871be8 <runtime.throw+0x0000000000000038>  0x0000000100871e00 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016f5c2fa0:  0x0000000100a3c1a0  0x0000000100871c00 <runtime.throw+0x0000000000000050> 
            0x000000016f5c2fb0:  0x000000016f5c2fc0  0x000000016f5c2fe8 
            0x000000016f5c2fc0:  0x0000000100888cf8 <runtime.sigpanic+0x00000000000001e8>  0x000000016f5c2fd0 
            0x000000016f5c2fd0:  0x0000000100871c20 <runtime.throw.func1+0x0000000000000000>  0x00000001009387f8 
            0x000000016f5c2fe0:  0x000000000000002a  0x000000016f5c3038 
            0x000000016f5c2ff0:  0x00000001008a1d8c <runtime.syscall+0x000000000000002c>  0x00000001009387f8 
            0x000000016f5c3000:  0x0000000100a3c1a0  0x0000000000000000 
            0x000000016f5c3010:  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c>  0x0000000000000000 
            0x000000016f5c3020:  0x00000001008a1d8c <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016f5c3030: <0x0000000000000001  0x0000014000049e28 
            0x000000016f5c3040:  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c>  0x00000001008a096c <runtime.asmcgocall+0x000000000000007c> 
            0x000000016f5c3050: >0x00000140000021a0  0x0000000000000240 
            0x000000016f5c3060:  0x000000010089e350 <runtime.mstart+0x0000000000000010>  0x000000016f5c30b8 
            0x000000016f5c3070:  0x000000010089e318 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016f5c3080:  0x0000000100a3c1a0  0x000000016f5c30b8 
            0x000000016f5c3090:  0x000000010089e320 <runtime.rt0_go+0x00000000000000f0>  0x000000010098dd10 
            runtime.syscall()
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin_arm64.s:560 +0x2c
            
            goroutine 1 [syscall]:
            syscall.syscall(0x1008c1170, 0x7702, 0xb, 0x1)
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin.go:22 +0x1c fp=0x14000049e20 sp=0x14000049e00 pc=0x10089d92c
            syscall.syscall(0x140000660c0, 0x0, 0x14000002101, 0x10092c014)
            	<autogenerated>:1 +0x20 fp=0x14000049e70 sp=0x14000049e20 pc=0x1008a22e0
            syscall.kill(0x14000077dc8, 0x0, 0x14000077da0)
            	/Users/yoshikishibata/tools/go/src/syscall/zsyscall_darwin_arm64.go:368 +0x38 fp=0x14000049ea0 sp=0x14000049e70 pc=0x1008bf818
            syscall.Kill(...)
            	/Users/yoshikishibata/tools/go/src/syscall/syscall_darwin.go:115
            main.SegvInCgo()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:52 +0x90 fp=0x14000049ed0 sp=0x14000049ea0 pc=0x10092c030
            main.main()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/main.go:34 +0x120 fp=0x14000049f70 sp=0x14000049ed0 pc=0x100925fb0
            runtime.main()
            	/Users/yoshikishibata/tools/go/src/runtime/proc.go:255 +0x270 fp=0x14000049fd0 sp=0x14000049f70 pc=0x100874170
            runtime.goexit()
            	/Users/yoshikishibata/tools/go/src/runtime/asm_arm64.s:1259 +0x4 fp=0x14000049fd0 sp=0x14000049fd0 pc=0x1008a0b44
            
            goroutine 6 [runnable]:
            main._Cfunc_nop()
            	_cgo_gotypes.go:373 +0x4c
            main.SegvInCgo.func1()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:46 +0x28
            created by main.SegvInCgo
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/segv.go:43 +0x74
            
        crash_cgo_test.go:631: unexpectedly saw "SIGSEGV" in output
FAIL
FAIL	runtime	30.854s

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions