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: TestSegv fails with the latest tip version #49192

Closed
YoshikiShibata opened this issue Oct 27, 2021 · 7 comments
Closed

runtime: TestSegv fails with the latest tip version #49192

YoshikiShibata opened this issue Oct 27, 2021 · 7 comments
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

@YoshikiShibata
Copy link

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
@dmitshur
Copy link
Contributor

What version of macOS are you using? macOS 12 has one known issue #49138.

Is this happening with an older tip commit?

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 27, 2021
@ianlancetaylor
Copy link
Contributor

CC @prattmic

@YoshikiShibata
Copy link
Author

@dmitshur This failure happened on both 12.0.1 and 11.6. But the version with 11.6 was

go version devel go1.18-13eccaa990 Tue Oct 26 23:12:17 2021 +0000 darwin/arm64

@dmitshur dmitshur changed the title runtime: test failed with the latest tip version runtime: TestSegv fails with the latest tip version Oct 27, 2021
@dmitshur
Copy link
Contributor

Does it happen reproducibly for you, or only occasionally?

It didn't reproduce locally on macOS 11.6 darwin/amd64 @ commit 749f6e9 for me, at least not on the first try:

$ ./all.bash
[...]
ok  	regexp/syntax	1.639s
ok  	runtime	249.616s
ok  	runtime/cgo	1.379s
[...]

It's also not being caught by darwin/amd64 nor darwin/arm64 builders at this time either... except, just saw the first instance of it in a recently completed build at https://build.golang.org/log/e042e5597283d5d5f3b843538efe94637116468b.

@YoshikiShibata
Copy link
Author

YoshikiShibata commented Oct 27, 2021

My MacBook Pro is M1: darwin/arm64.
This morning (in Japan), I tried two times. both failed. I will try it again.

@YoshikiShibata
Copy link
Author

@dmitshur Reproduced again:

go version devel go1.18-749f6e9eb6 Wed Oct 27 21:37:54 2021 +0000 darwin/arm64
ok  	regexp/syntax	0.395s
--- FAIL: TestSegv (0.00s)
    --- FAIL: TestSegv/Segv (0.03s)
        crash_test.go:104: /var/folders/fs/3c1rlryd2v3_z5m04g3lnd580000gn/T/go-build3136051995/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=0x104cdfdca pc=0x1b51a145c]
            
            runtime stack:
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16b2bb040, fp:0x16b2bb060} stack=[0x16b23c038,0x16b2bb0b0)
            0x000000016b2baf40:  0x0000000104c3e2ad  0x000000016b2baf88 
            0x000000016b2baf50:  0x0000000104b79a50 <runtime.fatalthrow+0x0000000000000040>  0x0000000104d4c1a0 
            0x000000016b2baf60:  0x0000000104c61d76  0x0000000000000001 
            0x000000016b2baf70:  0x000000016b2bafd0  0x0000000104b79870 <runtime.throw+0x0000000000000050> 
            0x000000016b2baf80:  0x0000000104d4c1a0  0x000000016b2bafc8 
            0x000000016b2baf90:  0x0000000104b79870 <runtime.throw+0x0000000000000050>  0x000000016b2bafa8 
            0x000000016b2bafa0:  0x0000000104b79858 <runtime.throw+0x0000000000000038>  0x0000000104b79a70 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016b2bafb0:  0x0000000104d4c1a0  0x0000000104b79870 <runtime.throw+0x0000000000000050> 
            0x000000016b2bafc0:  0x000000016b2bafd0  0x000000016b2baff8 
            0x000000016b2bafd0:  0x0000000104b90968 <runtime.sigpanic+0x00000000000001e8>  0x000000016b2bafe0 
            0x000000016b2bafe0:  0x0000000104b79890 <runtime.throw.func1+0x0000000000000000>  0x0000000104c40618 
            0x000000016b2baff0:  0x000000000000002a  0x000000016b2bb048 
            0x000000016b2bb000:  0x0000000104ba9bac <runtime.syscall+0x000000000000002c>  0x0000000104c40618 
            0x000000016b2bb010:  0x0000000104d4c1a0  0x0000000000000000 
            0x000000016b2bb020:  0x0000000104ba61e4 <runtime.mcall+0x0000000000000054>  0x0000014000092340 
            0x000000016b2bb030:  0x0000000104ba9bac <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016b2bb040: <0x0000000000000001  0x0000014000049e28 
            0x000000016b2bb050:  0x0000000104ba878c <runtime.asmcgocall+0x000000000000007c>  0x0000000104c33d34 <main.Segv+0x0000000000000074> 
            0x000000016b2bb060: >0x00000140000021a0  0x0000000000000240 
            0x000000016b2bb070:  0x0000000104ba6170 <runtime.mstart+0x0000000000000010>  0x000000016b2bb0c8 
            0x000000016b2bb080:  0x0000000104ba6138 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016b2bb090:  0x0000000104d4c1a0  0x000000016b2bb0c8 
            0x000000016b2bb0a0:  0x0000000104ba6140 <runtime.rt0_go+0x00000000000000f0>  0x0000000104c95d10 
            runtime.throw({0x104c40618?, 0x104d4c1a0?})
            	/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:0x16b2bb040, fp:0x16b2bb060} stack=[0x16b23c038,0x16b2bb0b0)
            0x000000016b2baf40:  0x0000000104c3e2ad  0x000000016b2baf88 
            0x000000016b2baf50:  0x0000000104b79a50 <runtime.fatalthrow+0x0000000000000040>  0x0000000104d4c1a0 
            0x000000016b2baf60:  0x0000000104c61d76  0x0000000000000001 
            0x000000016b2baf70:  0x000000016b2bafd0  0x0000000104b79870 <runtime.throw+0x0000000000000050> 
            0x000000016b2baf80:  0x0000000104d4c1a0  0x000000016b2bafc8 
            0x000000016b2baf90:  0x0000000104b79870 <runtime.throw+0x0000000000000050>  0x000000016b2bafa8 
            0x000000016b2bafa0:  0x0000000104b79858 <runtime.throw+0x0000000000000038>  0x0000000104b79a70 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016b2bafb0:  0x0000000104d4c1a0  0x0000000104b79870 <runtime.throw+0x0000000000000050> 
            0x000000016b2bafc0:  0x000000016b2bafd0  0x000000016b2baff8 
            0x000000016b2bafd0:  0x0000000104b90968 <runtime.sigpanic+0x00000000000001e8>  0x000000016b2bafe0 
            0x000000016b2bafe0:  0x0000000104b79890 <runtime.throw.func1+0x0000000000000000>  0x0000000104c40618 
            0x000000016b2baff0:  0x000000000000002a  0x000000016b2bb048 
            0x000000016b2bb000:  0x0000000104ba9bac <runtime.syscall+0x000000000000002c>  0x0000000104c40618 
            0x000000016b2bb010:  0x0000000104d4c1a0  0x0000000000000000 
            0x000000016b2bb020:  0x0000000104ba61e4 <runtime.mcall+0x0000000000000054>  0x0000014000092340 
            0x000000016b2bb030:  0x0000000104ba9bac <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016b2bb040: <0x0000000000000001  0x0000014000049e28 
            0x000000016b2bb050:  0x0000000104ba878c <runtime.asmcgocall+0x000000000000007c>  0x0000000104c33d34 <main.Segv+0x0000000000000074> 
            0x000000016b2bb060: >0x00000140000021a0  0x0000000000000240 
            0x000000016b2bb070:  0x0000000104ba6170 <runtime.mstart+0x0000000000000010>  0x000000016b2bb0c8 
            0x000000016b2bb080:  0x0000000104ba6138 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016b2bb090:  0x0000000104d4c1a0  0x000000016b2bb0c8 
            0x000000016b2bb0a0:  0x0000000104ba6140 <runtime.rt0_go+0x00000000000000f0>  0x0000000104c95d10 
            runtime.syscall()
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin_arm64.s:560 +0x2c
            
            goroutine 1 [syscall]:
            syscall.syscall(0x104bc8f90, 0xb5dd, 0xb, 0x1)
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin.go:22 +0x1c fp=0x14000049e20 sp=0x14000049e00 pc=0x104ba574c
            syscall.syscall(0x140000660c0?, 0x0?, 0x14000002101?, 0x104c33d34?)
            	<autogenerated>:1 +0x20 fp=0x14000049e70 sp=0x14000049e20 pc=0x104baa100
            syscall.kill(0x14000077dc8?, 0x0?, 0x14000077da0?)
            	/Users/yoshikishibata/tools/go/src/syscall/zsyscall_darwin_arm64.go:368 +0x38 fp=0x14000049ea0 sp=0x14000049e70 pc=0x104bc7638
            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=0x104c33d50
            main.main()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/main.go:34 +0x120 fp=0x14000049f70 sp=0x14000049ed0 pc=0x104c2ddd0
            runtime.main()
            	/Users/yoshikishibata/tools/go/src/runtime/proc.go:255 +0x270 fp=0x14000049fd0 sp=0x14000049f70 pc=0x104b7bde0
            runtime.goexit()
            	/Users/yoshikishibata/tools/go/src/runtime/asm_arm64.s:1259 +0x4 fp=0x14000049fd0 sp=0x14000049fd0 pc=0x104ba8964
            
            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-build3136051995/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=0x1024e8940 pc=0x1b51a145c]
            
            runtime stack:
            runtime: unexpected return pc for runtime.syscall called from 0x1
            stack: frame={sp:0x16da7f030, fp:0x16da7f050} stack=[0x16da00028,0x16da7f0a0)
            0x000000016da7ef30:  0x000000010247a2ad  0x000000016da7ef78 
            0x000000016da7ef40:  0x00000001023b5a50 <runtime.fatalthrow+0x0000000000000040>  0x00000001025881a0 
            0x000000016da7ef50:  0x000000010249dd76  0x0000000000000001 
            0x000000016da7ef60:  0x000000016da7efc0  0x00000001023b5870 <runtime.throw+0x0000000000000050> 
            0x000000016da7ef70:  0x00000001025881a0  0x000000016da7efb8 
            0x000000016da7ef80:  0x00000001023b5870 <runtime.throw+0x0000000000000050>  0x000000016da7ef98 
            0x000000016da7ef90:  0x00000001023b5858 <runtime.throw+0x0000000000000038>  0x00000001023b5a70 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016da7efa0:  0x00000001025881a0  0x00000001023b5870 <runtime.throw+0x0000000000000050> 
            0x000000016da7efb0:  0x000000016da7efc0  0x000000016da7efe8 
            0x000000016da7efc0:  0x00000001023cc968 <runtime.sigpanic+0x00000000000001e8>  0x000000016da7efd0 
            0x000000016da7efd0:  0x00000001023b5890 <runtime.throw.func1+0x0000000000000000>  0x000000010247c618 
            0x000000016da7efe0:  0x000000000000002a  0x000000016da7f038 
            0x000000016da7eff0:  0x00000001023e5bac <runtime.syscall+0x000000000000002c>  0x000000010247c618 
            0x000000016da7f000:  0x00000001025881a0  0x0000000000000000 
            0x000000016da7f010:  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c>  0x0000000000000000 
            0x000000016da7f020:  0x00000001023e5bac <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016da7f030: <0x0000000000000001  0x0000014000049e28 
            0x000000016da7f040:  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c>  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c> 
            0x000000016da7f050: >0x00000140000021a0  0x0000000000000240 
            0x000000016da7f060:  0x00000001023e2170 <runtime.mstart+0x0000000000000010>  0x000000016da7f0b8 
            0x000000016da7f070:  0x00000001023e2138 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016da7f080:  0x00000001025881a0  0x000000016da7f0b8 
            0x000000016da7f090:  0x00000001023e2140 <runtime.rt0_go+0x00000000000000f0>  0x00000001024d1d10 
            runtime.throw({0x10247c618?, 0x1025881a0?})
            	/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:0x16da7f030, fp:0x16da7f050} stack=[0x16da00028,0x16da7f0a0)
            0x000000016da7ef30:  0x000000010247a2ad  0x000000016da7ef78 
            0x000000016da7ef40:  0x00000001023b5a50 <runtime.fatalthrow+0x0000000000000040>  0x00000001025881a0 
            0x000000016da7ef50:  0x000000010249dd76  0x0000000000000001 
            0x000000016da7ef60:  0x000000016da7efc0  0x00000001023b5870 <runtime.throw+0x0000000000000050> 
            0x000000016da7ef70:  0x00000001025881a0  0x000000016da7efb8 
            0x000000016da7ef80:  0x00000001023b5870 <runtime.throw+0x0000000000000050>  0x000000016da7ef98 
            0x000000016da7ef90:  0x00000001023b5858 <runtime.throw+0x0000000000000038>  0x00000001023b5a70 <runtime.fatalthrow.func1+0x0000000000000000> 
            0x000000016da7efa0:  0x00000001025881a0  0x00000001023b5870 <runtime.throw+0x0000000000000050> 
            0x000000016da7efb0:  0x000000016da7efc0  0x000000016da7efe8 
            0x000000016da7efc0:  0x00000001023cc968 <runtime.sigpanic+0x00000000000001e8>  0x000000016da7efd0 
            0x000000016da7efd0:  0x00000001023b5890 <runtime.throw.func1+0x0000000000000000>  0x000000010247c618 
            0x000000016da7efe0:  0x000000000000002a  0x000000016da7f038 
            0x000000016da7eff0:  0x00000001023e5bac <runtime.syscall+0x000000000000002c>  0x000000010247c618 
            0x000000016da7f000:  0x00000001025881a0  0x0000000000000000 
            0x000000016da7f010:  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c>  0x0000000000000000 
            0x000000016da7f020:  0x00000001023e5bac <runtime.syscall+0x000000000000002c>  0x0000000000000000 
            0x000000016da7f030: <0x0000000000000001  0x0000014000049e28 
            0x000000016da7f040:  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c>  0x00000001023e478c <runtime.asmcgocall+0x000000000000007c> 
            0x000000016da7f050: >0x00000140000021a0  0x0000000000000240 
            0x000000016da7f060:  0x00000001023e2170 <runtime.mstart+0x0000000000000010>  0x000000016da7f0b8 
            0x000000016da7f070:  0x00000001023e2138 <runtime.rt0_go+0x00000000000000e8>  0x0000000000000004 
            0x000000016da7f080:  0x00000001025881a0  0x000000016da7f0b8 
            0x000000016da7f090:  0x00000001023e2140 <runtime.rt0_go+0x00000000000000f0>  0x00000001024d1d10 
            runtime.syscall()
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin_arm64.s:560 +0x2c
            
            goroutine 1 [syscall]:
            syscall.syscall(0x102404f90, 0xb5de, 0xb, 0x1)
            	/Users/yoshikishibata/tools/go/src/runtime/sys_darwin.go:22 +0x1c fp=0x14000049e20 sp=0x14000049e00 pc=0x1023e174c
            syscall.syscall(0x140000660c0?, 0x0?, 0x14000002101?, 0x10246fe34?)
            	<autogenerated>:1 +0x20 fp=0x14000049e70 sp=0x14000049e20 pc=0x1023e6100
            syscall.kill(0x14000077f78?, 0x0?, 0x14000077f40?)
            	/Users/yoshikishibata/tools/go/src/syscall/zsyscall_darwin_arm64.go:368 +0x38 fp=0x14000049ea0 sp=0x14000049e70 pc=0x102403638
            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=0x10246fe50
            main.main()
            	/Users/yoshikishibata/tools/go/src/runtime/testdata/testprogcgo/main.go:34 +0x120 fp=0x14000049f70 sp=0x14000049ed0 pc=0x102469dd0
            runtime.main()
            	/Users/yoshikishibata/tools/go/src/runtime/proc.go:255 +0x270 fp=0x14000049fd0 sp=0x14000049f70 pc=0x1023b7de0
            runtime.goexit()
            	/Users/yoshikishibata/tools/go/src/runtime/asm_arm64.s:1259 +0x4 fp=0x14000049fd0 sp=0x14000049fd0 pc=0x1023e4964
            
            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	31.364s

@cherrymui
Copy link
Member

I think this is a dup of #49182. Thanks.

@golang golang locked and limited conversation to collaborators Oct 27, 2022
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

5 participants