--- FAIL: TestSegv (0.00s)
    --- FAIL: TestSegv/Segv (0.12s)
        testenv.go:361: [/tmp/workdir/tmp/go-build374830791/testprogcgo.exe Segv] exit status: exit status 2
        crash_cgo_test.go:611: fatal error: unexpected signal during runtime execution
            [signal SIGSEGV: segmentation violation code=0xb addr=0xb pc=0x545be1b]

            runtime stack:
            runtime: g 0: unexpected return pc for runtime.sigpanic called from 0x545be1b
            stack: frame={sp:0x4b1e9284, fp:0x4b1e929c} stack=[0x4b1a98e8,0x4b1e94e8)
            0x4b1e9204:  0x0052dca7 <runtime.dopanic_m+0x00000217>  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270  0x00000000 
            0x4b1e9214:  0x73406870  0x01000001  0x0000001f  0x0545be1b 
            0x4b1e9224:  0x0000000b  0x0000000b  0x00000001  0x00433d8e 
            0x4b1e9234:  0x0052d785 <runtime.fatalthrow.func1+0x00000045>  0x73406870  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270 
            0x4b1e9244:  0x00000001  0x4b1e9270  0x0052d534 <runtime.throw+0x00000064>  0x73406870 
            0x4b1e9254:  0x0052d734 <runtime.fatalthrow+0x00000054>  0x4b1e925c  0x0052d740 <runtime.fatalthrow.func1+0x00000000>  0x73406870 
            0x4b1e9264:  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9274 
            0x4b1e9274:  0x0052d540 <runtime.throw.func1+0x00000000>  0x004361ce  0x0000002a  0x00542cab <runtime.sigpanic+0x0000022b> 
            0x4b1e9284: <0x004361ce  0x0000002a  0x33bb9c30  0x05482afc 
            0x4b1e9294:  0x73406870 !0x0545be1b >0x054592f2  0x4b1e92c0 
            0x4b1e92a4:  0x00000000  0x73406870  0x253fd084  0x4b1e92dc 
            0x4b1e92b4:  0x0543ca82  0x4b1e92c0  0x00000000  0x00000000 
            0x4b1e92c4:  0x00000000  0x00000bb8  0xffffffff  0x569926c7 
            0x4b1e92d4:  0x00000000  0x4b1e9338  0x4b1e92e8  0x0055a9f4 <runtime.usleep_trampoline+0x00000014> 
            0x4b1e92e4:  0x00000003  0x73430480  0x0055973c <runtime.asmcgocall+0x0000004c>  0x4b1e9338 
            0x4b1e92f4:  0x000001d8  0x73406870  0x00000000  0x4b1e9338 
            0x4b1e9304:  0x0000000c  0x257c7228  0x33bb9030  0x0054a0ea <runtime.libcCall+0x0000005a> 
            0x4b1e9314:  0x0055a9e0 <runtime.usleep_trampoline+0x00000000>  0x4b1e9338 
            runtime.throw({0x4361ce, 0x2a})
                /tmp/workdir/go/src/runtime/panic.go:992 +0x64
            runtime: g 0: unexpected return pc for runtime.sigpanic called from 0x545be1b
            stack: frame={sp:0x4b1e9284, fp:0x4b1e929c} stack=[0x4b1a98e8,0x4b1e94e8)
            0x4b1e9204:  0x0052dca7 <runtime.dopanic_m+0x00000217>  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270  0x00000000 
            0x4b1e9214:  0x73406870  0x01000001  0x0000001f  0x0545be1b 
            0x4b1e9224:  0x0000000b  0x0000000b  0x00000001  0x00433d8e 
            0x4b1e9234:  0x0052d785 <runtime.fatalthrow.func1+0x00000045>  0x73406870  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270 
            0x4b1e9244:  0x00000001  0x4b1e9270  0x0052d534 <runtime.throw+0x00000064>  0x73406870 
            0x4b1e9254:  0x0052d734 <runtime.fatalthrow+0x00000054>  0x4b1e925c  0x0052d740 <runtime.fatalthrow.func1+0x00000000>  0x73406870 
            0x4b1e9264:  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9270  0x0052d534 <runtime.throw+0x00000064>  0x4b1e9274 
            0x4b1e9274:  0x0052d540 <runtime.throw.func1+0x00000000>  0x004361ce  0x0000002a  0x00542cab <runtime.sigpanic+0x0000022b> 
            0x4b1e9284: <0x004361ce  0x0000002a  0x33bb9c30  0x05482afc 
            0x4b1e9294:  0x73406870 !0x0545be1b >0x054592f2  0x4b1e92c0 
            0x4b1e92a4:  0x00000000  0x73406870  0x253fd084  0x4b1e92dc 
            0x4b1e92b4:  0x0543ca82  0x4b1e92c0  0x00000000  0x00000000 
            0x4b1e92c4:  0x00000000  0x00000bb8  0xffffffff  0x569926c7 
            0x4b1e92d4:  0x00000000  0x4b1e9338  0x4b1e92e8  0x0055a9f4 <runtime.usleep_trampoline+0x00000014> 
            0x4b1e92e4:  0x00000003  0x73430480  0x0055973c <runtime.asmcgocall+0x0000004c>  0x4b1e9338 
            0x4b1e92f4:  0x000001d8  0x73406870  0x00000000  0x4b1e9338 
            0x4b1e9304:  0x0000000c  0x257c7228  0x33bb9030  0x0054a0ea <runtime.libcCall+0x0000005a> 
            0x4b1e9314:  0x0055a9e0 <runtime.usleep_trampoline+0x00000000>  0x4b1e9338 
            runtime.sigpanic()
                /tmp/workdir/go/src/runtime/signal_unix.go:802 +0x22b

            goroutine 1 [runnable]:
            time.Sleep(0x3b9aca00)
                /tmp/workdir/go/src/runtime/time.go:185 +0x61
            main.Segv()
                /tmp/workdir/go/src/runtime/testdata/testprogcgo/segv.go:39 +0xb0
            main.main()
                /tmp/workdir/go/src/runtime/testdata/testprogcgo/main.go:34 +0x148

            goroutine 6 [runnable]:
            main.Segv.func1()
                /tmp/workdir/go/src/runtime/testdata/testprogcgo/segv.go:28 +0x1a
            created by main.Segv
                /tmp/workdir/go/src/runtime/testdata/testprogcgo/segv.go:27 +0x76

        crash_cgo_test.go:638: unexpectedly saw "runtime: " in output
FAIL
FAIL    runtime 61.363s

(CC @golang/runtime)

Comment From: bcmills

Part of the test is currently skipped on linux/386 as of CL 376656 (#49182, #50504).

Perhaps that skip should be extended to openbsd/386 as well?

(Marking as release-blocker, but since openbsd/386 is not a first class port this can be resolved by updating the skips in the test.)

Comment From: cherrymui

On OpenBSD we use libc for syscalls. We generally cannot unwind the C stack if the signal arrives in the libc functions. Perhaps for short term skipping on all OpenBSD sounds reasonable. But I still don't understand why we get into sigpanic. I think we should not use sigpanic for externally-generated SIGSEGV. Maybe sigcode is not correct on OpenBSD/386?

Comment From: bcmills

greplogs -l -e '(?ms)FAIL: TestSegv/Segv.*unexpected return pc' --since=2022-01-01 2022-03-18T12:07:27-12eca21/openbsd-386-68

Only one of these this year and it's not a first-class port, and (unlike openbsd-amd64-68) this builder appears not to be a TryBot.

If the builder gets too noisy I'll remove it from triage, but I don't think this needs to be a release-blocker.

Comment From: cherrymui

OpenBSD 6.8 is no longer a supported version of OpenBSD. Our https://github.com/golang/go/wiki/MinimumRequirements documents that we only support the current stable version, which is OpenBSD 7.1. Maybe we can remove OpenBSD 6.8 builders and close this.

Comment From: ianlancetaylor

Rolling forward to 1.20. Please comment if you disagree. Thanks.