From 6fe3ccd74c4bf53552da3d9f59463a8a291f59db Mon Sep 17 00:00:00 2001 From: qmuntal Date: Fri, 14 Oct 2022 17:30:45 +0200 Subject: runtime: ignore exceptions from non-Go threads on windows arm/arm64 If there is no current G while handling an exception it means the exception was originated in a non-Go thread. The best we can do is ignore the exception and let it flow through other vectored and structured error handlers. I've removed badsignal2 from sigtramp because we can't really know if the signal is bad or not, it might be handled later in the chain. Fixes #50877 Updates #56082 Change-Id: Ica159eb843629986d1fb5482f0b59a9c1ed91698 Reviewed-on: https://go-review.googlesource.com/c/go/+/442896 Reviewed-by: Alex Brainman Auto-Submit: Michael Pratt TryBot-Result: Gopher Robot Reviewed-by: Michael Pratt Run-TryBot: Quim Muntal Reviewed-by: David Chase --- src/runtime/sys_windows_arm.s | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/runtime/sys_windows_arm.s') diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index 5dc576a260..db6d8f1a08 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -123,8 +123,14 @@ TEXT sigtramp<>(SB),NOSPLIT|NOFRAME,$0 MOVW R1, R7 // Save param1 BL runtime·load_g(SB) - CMP $0, g // is there a current g? - BL.EQ runtime·badsignal2(SB) + CMP $0, g // is there a current g? + BNE g_ok + ADD $(8+20), R13 // free locals + MOVM.IA.W (R13), [R3, R4-R11, R14] // pop {r3, r4-r11, lr} + MOVW $0, R0 // continue + BEQ return + +g_ok: // save g and SP in case of stack switch MOVW R13, 24(R13) -- cgit v1.3-5-g9baa