]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: see whether gp==nil before checking preemption state
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 28 Feb 2021 11:24:02 +0000 (12:24 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 8 Apr 2021 19:51:32 +0000 (19:51 +0000)
commit98dd205fa4f125c8ba8099c3d84d95189666068e
tree056146dfa023ce2648a776345099ffe4dbfef33e
parent46ffbec1d6715f62c724a7180aec12ffd8acf57f
runtime: see whether gp==nil before checking preemption state

Recent we changed from using gFromTLS to using gFromSP, which apparently
sometimes returns nil. This causes crashes when dereferenced. Fix that
by not checking for preemption in the case that gFromSP returns nil.

Fixes #44679.

Change-Id: I0199ebe7cd113379c5fa35c27932d913df79092a
Reviewed-on: https://go-review.googlesource.com/c/go/+/297390
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/os_windows.go