go: runtime: misc/cgo/test.TestSetgid panic with `unexpected return pc for runtime.sigpanic` on linux-arm64-packet since 2022-06-04
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0xffff537fd898 pc=0xffff537fd898]
runtime stack:
runtime.throw({0xaaaabb5aaf4f?, 0x8?})
/workdir/go/src/runtime/panic.go:1047 +0x40 fp=0xffff537fd860 sp=0xffff537fd830 pc=0xaaaabb4836d0
runtime: g 0: unexpected return pc for runtime.sigpanic called from 0xffff537fd898
stack: frame={sp:0xffff537fd860, fp:0xffff537fd890} stack=[0xffff52ffdd00,0xffff537fd900)
0x0000ffff537fd760: 0x0100aaaabb483c90 0x000000000000000a
0x0000ffff537fd770: 0x000000000000001f 0x0000ffff537fd898
0x0000ffff537fd780: 0x0000ffff537fd898 0x0000000000000002
0x0000ffff537fd790: 0x0000aaaabb4836d0 <runtime.throw+0x0000000000000040> 0x0000ffff537fd830
0x0000ffff537fd7a0: 0x0000aaaabb5a811e 0x0000ffff537fd7e8
0x0000ffff537fd7b0: 0x0000aaaabb483968 <runtime.fatalthrow+0x0000000000000058> 0x00000040001021a0
0x0000ffff537fd7c0: 0x0000aaaabb484f18 <runtime.printunlock+0x0000000000000048> 0x0000000000000001
0x0000ffff537fd7d0: 0x0000ffff537fd830 0x0000aaaabb4836d0 <runtime.throw+0x0000000000000040>
0x0000ffff537fd7e0: 0x00000040001021a0 0x0000ffff537fd828
0x0000ffff537fd7f0: 0x0000aaaabb4836d0 <runtime.throw+0x0000000000000040> 0x0000ffff537fd808
0x0000ffff537fd800: 0x00000040001021a0 0x0000aaaabb483980 <runtime.fatalthrow.func1+0x0000000000000000>
0x0000ffff537fd810: 0x00000040001021a0 0x0000aaaabb4836d0 <runtime.throw+0x0000000000000040>
0x0000ffff537fd820: 0x0000ffff537fd830 0x0000ffff537fd858
0x0000ffff537fd830: 0x0000aaaabb49ac24 <runtime.sigpanic+0x00000000000001e4> 0x0000ffff537fd840
0x0000ffff537fd840: 0x0000aaaabb4836e0 <runtime.throw.func1+0x0000000000000000> 0x0000aaaabb5aaf4f
0x0000ffff537fd850: 0x000000000000002a 0x0000ffff537fd898
0x0000ffff537fd860: <0x0000ffff537fd898 0x0000aaaabb5aaf4f
0x0000ffff537fd870: 0x0000000000000008 0x0000000000000002
0x0000ffff537fd880: 0x0000000000000000 0x0000ffff537fd898
0x0000ffff537fd890: >0x0000ffff537fd898 0x0000aaaabb4805ac <runtime.minit+0x000000000000001c>
0x0000ffff537fd8a0: 0x0000aaaabb48894c <runtime.mstart1+0x000000000000004c> 0x0000ffff812f7000
0x0000ffff537fd8b0: 0x0000ffff58b270d0 0x0000ffff537fd8e8
0x0000ffff537fd8c0: 0x0000aaaabb4888d8 <runtime.mstart0+0x0000000000000068> 0x0000ffff812f7000
0x0000ffff537fd8d0: 0x0000000000000000 0x0000ffff812c7a98
0x0000ffff537fd8e0: 0x00000040001021a0 0x0000ffff537fd918
0x0000ffff537fd8f0: 0x0000aaaabb4b3a00 <runtime.mstart+0x0000000000000010> 0x000000770000006e
runtime.sigpanic()
/workdir/go/src/runtime/signal_unix.go:819 +0x1e4 fp=0xffff537fd890 sp=0xffff537fd860 pc=0xaaaabb49ac24
goroutine 1 [chan receive]:
runtime.gopark(0x4000091a68?, 0xaaaabb4527c4?, 0x78?, 0x1a?, 0xaaaabb45a20c?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x40000919f0 sp=0x40000919d0 pc=0xaaaabb4860a4
runtime.chanrecv(0x4000128070, 0x4000091aff, 0x1)
/workdir/go/src/runtime/chan.go:583 +0x454 fp=0x4000091a80 sp=0x40000919f0 pc=0xaaaabb453b14
runtime.chanrecv1(0x4000112060?, 0x1?)
/workdir/go/src/runtime/chan.go:442 +0x14 fp=0x4000091ab0 sp=0x4000091a80 pc=0xaaaabb4536b4
testing.(*T).Run(0x40001024e0, {0xaaaabb5a1d6a?, 0x92716c0d48a5e?}, 0xaaaabb62cd10)
/workdir/go/src/testing/testing.go:1494 +0x314 fp=0x4000091b50 sp=0x4000091ab0 pc=0xaaaabb516ed4
testing.runTests.func1(0x0?)
/workdir/go/src/testing/testing.go:1846 +0x70 fp=0x4000091ba0 sp=0x4000091b50 pc=0xaaaabb518b40
testing.tRunner(0x40001024e0, 0x4000091cb8)
/workdir/go/src/testing/testing.go:1446 +0x10c fp=0x4000091bf0 sp=0x4000091ba0 pc=0xaaaabb51623c
testing.runTests(0x400011e000?, {0xaaaabb71b600, 0x60, 0x60}, {0x4000091d28?, 0xa0aaaabb4635e8?, 0xaaaabb735c00?})
/workdir/go/src/testing/testing.go:1844 +0x3f0 fp=0x4000091ce0 sp=0x4000091bf0 pc=0xaaaabb518a00
testing.(*M).Run(0x400011e000)
/workdir/go/src/testing/testing.go:1726 +0x4f0 fp=0x4000091ee0 sp=0x4000091ce0 pc=0xaaaabb5177a0
main.main()
_testmain.go:243 +0x1d0 fp=0x4000091f70 sp=0x4000091ee0 pc=0xaaaabb59bc90
runtime.main()
/workdir/go/src/runtime/proc.go:250 +0x24c fp=0x4000091fd0 sp=0x4000091f70 pc=0xaaaabb485cdc
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x4000091fd0 sp=0x4000091fd0 pc=0xaaaabb4b60e4
goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x4000042fa0 sp=0x4000042f80 pc=0xaaaabb4860a4
runtime.goparkunlock(...)
/workdir/go/src/runtime/proc.go:369
runtime.forcegchelper()
/workdir/go/src/runtime/proc.go:302 +0xac fp=0x4000042fd0 sp=0x4000042fa0 pc=0xaaaabb485f3c
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x4000042fd0 sp=0x4000042fd0 pc=0xaaaabb4b60e4
created by runtime.init.6
/workdir/go/src/runtime/proc.go:290 +0x24
goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x4000043770 sp=0x4000043750 pc=0xaaaabb4860a4
runtime.goparkunlock(...)
/workdir/go/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
/workdir/go/src/runtime/mgcsweep.go:278 +0xa4 fp=0x40000437b0 sp=0x4000043770 pc=0xaaaabb4714e4
runtime.gcenable.func1()
/workdir/go/src/runtime/mgc.go:178 +0x28 fp=0x40000437d0 sp=0x40000437b0 pc=0xaaaabb465af8
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x40000437d0 sp=0x40000437d0 pc=0xaaaabb4b60e4
created by runtime.gcenable
/workdir/go/src/runtime/mgc.go:178 +0x74
goroutine 4 [GC scavenge wait]:
runtime.gopark(0x400006c000?, 0xaaaabb5dc9f0?, 0x1?, 0x0?, 0x0?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x4000043f50 sp=0x4000043f30 pc=0xaaaabb4860a4
runtime.goparkunlock(...)
/workdir/go/src/runtime/proc.go:369
runtime.(*scavengerState).park(0xaaaabb735c80)
/workdir/go/src/runtime/mgcscavenge.go:389 +0x5c fp=0x4000043f80 sp=0x4000043f50 pc=0xaaaabb46f4cc
runtime.bgscavenge(0x0?)
/workdir/go/src/runtime/mgcscavenge.go:617 +0x44 fp=0x4000043fb0 sp=0x4000043f80 pc=0xaaaabb46fa44
runtime.gcenable.func2()
/workdir/go/src/runtime/mgc.go:179 +0x28 fp=0x4000043fd0 sp=0x4000043fb0 pc=0xaaaabb465a98
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x4000043fd0 sp=0x4000043fd0 pc=0xaaaabb4b60e4
created by runtime.gcenable
/workdir/go/src/runtime/mgc.go:179 +0xb8
goroutine 5 [finalizer wait]:
runtime.gopark(0xaaaabb736440?, 0x40000036c0?, 0x0?, 0x0?, 0x1?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x4000042580 sp=0x4000042560 pc=0xaaaabb4860a4
runtime.goparkunlock(...)
/workdir/go/src/runtime/proc.go:369
runtime.runfinq()
/workdir/go/src/runtime/mfinal.go:180 +0x120 fp=0x40000427d0 sp=0x4000042580 pc=0xaaaabb464d20
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x40000427d0 sp=0x40000427d0 pc=0xaaaabb4b60e4
created by runtime.createfing
/workdir/go/src/runtime/mfinal.go:157 +0x84
goroutine 18 [runnable]:
runtime.gopark(0x400003e6c8?, 0x2?, 0xb8?, 0xe5?, 0x400003e6bc?)
/workdir/go/src/runtime/proc.go:363 +0xe4 fp=0x400003e560 sp=0x400003e540 pc=0xaaaabb4860a4
runtime.selectgo(0x400003e6c8, 0x400003e6b8, 0xaaaabb6586be?, 0x0, 0x51b?, 0x1)
/workdir/go/src/runtime/select.go:328 +0x684 fp=0x400003e680 sp=0x400003e560 pc=0xaaaabb496d24
misc/cgo/test.runTestSetgid()
/workdir/go/misc/cgo/test/setgid_linux.go:30 +0xb4 fp=0x400003e6f0 sp=0x400003e680 pc=0xaaaabb592d34
misc/cgo/test.testSetgid(0x4000102680)
/workdir/go/misc/cgo/test/setgid_linux.go:40 +0x20 fp=0x400003e740 sp=0x400003e6f0 pc=0xaaaabb592de0
misc/cgo/test.TestSetgid(0x0?)
/workdir/go/misc/cgo/test/cgo_linux_test.go:16 +0x1c fp=0x400003e760 sp=0x400003e740 pc=0xaaaabb55e31c
testing.tRunner(0x4000102680, 0xaaaabb62cd10)
/workdir/go/src/testing/testing.go:1446 +0x10c fp=0x400003e7b0 sp=0x400003e760 pc=0xaaaabb51623c
testing.(*T).Run.func1()
/workdir/go/src/testing/testing.go:1493 +0x2c fp=0x400003e7d0 sp=0x400003e7b0 pc=0xaaaabb516f7c
runtime.goexit()
/workdir/go/src/runtime/asm_arm64.s:1155 +0x4 fp=0x400003e7d0 sp=0x400003e7d0 pc=0xaaaabb4b60e4
created by testing.(*T).Run
/workdir/go/src/testing/testing.go:1493 +0x300
exit status 2
FAIL misc/cgo/test 0.029s
2022/06/08 16:27:39 Failed: exit status 1
greplogs -l -e '(?ms)unexpected return pc for runtime\.sigpanic.*exit status 2\nFAIL\s+misc/cgo/test'
2022-06-08T15:47:58-4afb0b9/linux-arm64-packet
2022-06-04T16:11:54-fc66cae/linux-arm64-packet
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (17 by maintainers)
Commits related to this issue
- cmd/internal/obj/mips,s390x,riscv: save LR after decrementing SP Following CL 412474, for the rest of the LR architectures. On MIPS(32/64), S390X, and RISCV, there is no single instruction that saves... — committed to golang/go by cherrymui 2 years ago
- cmd/internal/obj/mips,s390x,riscv: save LR after decrementing SP Following CL 412474, for the rest of the LR architectures. On MIPS(32/64), S390X, and RISCV, there is no single instruction that saves... — committed to jproberts/go by cherrymui 2 years ago
- cmd/internal/obj/arm64: save LR and SP in one instruction for small frames When we create a thread with signals blocked. But glibc's pthread_sigmask doesn't really allow us to block SIGSETXID. So we ... — committed to jproberts/go by cherrymui 2 years ago
- cmd/internal/obj/loong64: save LR after decrementing SP Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there is no single instruction that saves the LR and decrements the SP,... — committed to xen0n/go by abner-chenc 2 years ago
- cmd/internal/obj/loong64: save LR after decrementing SP Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there is no single instruction that saves the LR and decrements the SP,... — committed to golang/go by abner-chenc 2 years ago
- cmd/internal/obj/loong64: save LR after decrementing SP Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there is no single instruction that saves the LR and decrements the SP,... — committed to Pryz/go by abner-chenc 2 years ago
- cmd/internal/obj/loong64: save LR after decrementing SP Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there is no single instruction that saves the LR and decrements the SP,... — committed to xen0n/go by abner-chenc 2 years ago
We chatted about this and the plan is to return to the old prologue for small frames as a stop-gap for 1.19, confirm by hand that this generates signal-safe prologues for the handful of functions that run before we have a signal stack, and look into enhancing the traceback metadata for 1.20 to capture ranges where the frame is non-empty but the LR should be retrieved from the LR register instead of the stack.
Not sure this is the best way to stress this, but running this on thelinux-arm64-packet builder it has a not-too-small rate to fail with seg fault. Plain seg fault with no extra output, not the unwinder error like above, though.
With the CL above, no failure in 1000 run.
I’ll see if I can make it more likely to fail.