Add this to runtime/proc.go:

diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 401dcd0a11..6d8fde4349 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -267,6 +267,10 @@ func main() {
        // has a main, but it is not executed.
        return
    }
+
+println("oops")
+   oops()
+
    fn := main_main // make an indirect call, as the linker doesn't know the address of the main package when laying down the runtime
    fn()
    if raceenabled {
@@ -7079,3 +7083,14 @@ func doInit1(t *initTask) {
        t.state = 2 // initialization done
    }
 }
+
+//go:noinline
+func oops() {
+   oopssys()
+}
+
+//go:systemstack
+//go:noinline
+func oopssys() {
+   println("onsys")
+}
% 

Running any program crashes like this, at least on my arm64 mac:

oops
fatal error: attempt to execute system stack code on user stack

goroutine 1 gp=0x140000021c0 m=0 mp=0x100e67620 [running]:
runtime.throw({0x100c18075?, 0x100a7ee40?})
    /Users/rsc/go/src/runtime/panic.go:1021 +0x40 fp=0x14000131f10 sp=0x14000131ee0 pc=0x100a7c510
runtime.morestackc()
    /Users/rsc/go/src/runtime/stack.go:1296 +0x1c fp=0x14000131f30 sp=0x14000131f10 pc=0x100ab3a4c
runtime.oopssys()
    /Users/rsc/go/src/runtime/proc.go:7094 +0x44 fp=0x14000131f30 sp=0x14000131f30 pc=0x100a8ebd4
runtime.main()
    /Users/rsc/go/src/runtime/proc.go:272 +0x294 fp=0x14000131fc0 sp=0x14000131f30 pc=0x100a7ee44
runtime.main()
    /Users/rsc/go/src/runtime/proc.go:272 +0x294 fp=0x14000132050 sp=0x14000131fc0 pc=0x100a7ee44
runtime: g 1: unexpected return pc for runtime.main called from 0x14000131fb0

Note that the runtime.oops frame is missing entirely (runtime.main calls oops calls oopssys calls morestackc during prologue). Probably the unwinder gets out of sync somewhere around there. Perhaps the out-of-sync is also the reason for the 'unexpected return pc' failure during unwind.

/cc @aclements

Comment From: cherrymui

Yeah, morestackc is called using a weird calling convention (because it is in the stack bounds check prologue, before the function having a frame to push the LR) that the unwind code doesn't understand.

Maybe we could implement morestackc in assembly similar to morestack, then throw with the right PC/SP/LR. Or we could change the calling convention to morestack/morestackc...