]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] runtime: block signals in needm before allocating M
authorIan Lance Taylor <iant@golang.org>
Tue, 27 Oct 2020 23:09:40 +0000 (16:09 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 20 Nov 2020 20:38:22 +0000 (20:38 +0000)
commit9e27a089d644950cba52108f6634badc5880c6e0
tree22629176feef07f275cceed5e7176341e877cd4e
parent71778525e1d92150daa0b05fe4c0fa734dc83f1b
[release-branch.go1.14] runtime: block signals in needm before allocating M

Otherwise, if a signal occurs just after we allocated the M,
we can deadlock if the signal handler needs to allocate an M
itself.

For #42207
Fixes #42635

Change-Id: I76f44547f419e8b1c14cbf49bf602c6e645d8c14
Reviewed-on: https://go-review.googlesource.com/c/go/+/265759
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 368c40116434532dc0b53b72fa04788ca6742898)
Reviewed-on: https://go-review.googlesource.com/c/go/+/271848
src/runtime/crash_cgo_test.go
src/runtime/os_js.go
src/runtime/os_plan9.go
src/runtime/os_windows.go
src/runtime/proc.go
src/runtime/signal_unix.go
src/runtime/testdata/testprogcgo/needmdeadlock.go [new file with mode: 0644]