diff options
| author | Cherry Zhang <cherryyz@google.com> | 2019-11-10 13:18:06 -0500 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2019-11-11 15:16:05 +0000 |
| commit | 75c839af22a50cb027766ea54335e234dac32836 (patch) | |
| tree | 7fd053338aafb680c696f070f77667f309190079 /src/encoding/json/encode.go | |
| parent | c31bcd13909edb53621c3dc47aa987365247df8d (diff) | |
| download | go-75c839af22a50cb027766ea54335e234dac32836.tar.xz | |
runtime: don't save G during VDSO if we're handling signal
On some platforms (currently ARM and ARM64), when calling into
VDSO we store the G to the gsignal stack, if there is one, so if
we receive a signal during VDSO we can find the G.
If we receive a signal during VDSO, and within the signal handler
we call nanotime again (e.g. when handling profiling signal),
we'll save/clear the G slot on the gsignal stack again, which
clobbers the original saved G. If we receive a second signal
during the same VDSO execution, we will fetch a nil G, which will
lead to bad things such as deadlock.
Don't save G if we're calling VDSO code from the gsignal stack.
Saving G is not necessary as we won't receive a nested signal.
Fixes #35473.
Change-Id: Ibfd8587a3c70c2f1533908b056e81b94d75d65a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/206397
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions
