]> Cypherpunks repositories - gostls13.git/commit
runtime: fix cgo signals detection
authorMichael Pratt <mpratt@google.com>
Wed, 4 Aug 2021 15:24:28 +0000 (11:24 -0400)
committerMichael Pratt <mpratt@google.com>
Tue, 26 Oct 2021 21:17:38 +0000 (21:17 +0000)
commit091db6392da5913e4bd4806215102e461dc5649c
treee250f5d5bc183388f465efdb5b42f341c55a9694
parent3a0cd1121413ad02172784114318ac6b0c2801c1
runtime: fix cgo signals detection

CL 64070 removed lockOSThread from the cgocall path, but didn't update
the signal-in-cgo detection in sighandler. As a result, signals that
arrive during a cgo call are treated like they arrived during Go
execution, breaking the traceback.

Update the cgo detection to fix the backtrace.

Fixes #47522

Change-Id: I61d77ba6465f55e3e6187246d79675ba8467ec23
Reviewed-on: https://go-review.googlesource.com/c/go/+/339989
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/crash_cgo_test.go
src/runtime/signal_unix.go
src/runtime/signal_windows.go
src/runtime/testdata/testprogcgo/panic.go [new file with mode: 0644]
src/runtime/testdata/testprogcgo/sigthrow.go [new file with mode: 0644]