summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/asm_arm.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-06-12 16:34:54 -0400
committerRuss Cox <rsc@golang.org>2014-06-12 16:34:54 -0400
commit9e0b48ce682f99edbddb5421518c68ec6b918bb7 (patch)
tree1a44893a143e4869e572a0f4b84611c77cb458c0 /src/pkg/runtime/asm_arm.s
parent9cd9737190e90ac51bd82311de18c49bcfad6f24 (diff)
downloadgo-9e0b48ce682f99edbddb5421518c68ec6b918bb7.tar.gz
runtime: do not trace past jmpdefer during pprof traceback on arm
jmpdefer modifies PC, SP, and LR, and not atomically, so walking past jmpdefer will often end up in a state where the three are not a consistent execution snapshot. This was causing warning messages a few frames later when the traceback realized it was confused, but given the right memory it could easily crash instead. Update issue 8153 LGTM=minux, iant R=golang-codereviews, minux, iant CC=golang-codereviews, r https://codereview.appspot.com/107970043
Diffstat (limited to 'src/pkg/runtime/asm_arm.s')
-rw-r--r--src/pkg/runtime/asm_arm.s4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/asm_arm.s b/src/pkg/runtime/asm_arm.s
index 024649be0..1aea9036a 100644
--- a/src/pkg/runtime/asm_arm.s
+++ b/src/pkg/runtime/asm_arm.s
@@ -394,6 +394,10 @@ TEXT runtime·lessstack(SB), NOSPLIT, $-4-0
// 1. grab stored LR for caller
// 2. sub 4 bytes to get back to BL deferreturn
// 3. B to fn
+// TODO(rsc): Push things on stack and then use pop
+// to load all registers simultaneously, so that a profiling
+// interrupt can never see mismatched SP/LR/PC.
+// (And double-check that pop is atomic in that way.)
TEXT runtime·jmpdefer(SB), NOSPLIT, $0-8
MOVW 0(SP), LR
MOVW $-4(LR), LR // BL deferreturn