Skip to content

Commit e5e547c

Browse files
committed
runtime: turn off 'unexpected return pc' print on arm traceback
It can happen legitimately if a profiling signal arrives at just the wrong moment. It's harmless. Fixes #8153. LGTM=minux R=golang-codereviews, minux CC=golang-codereviews, iant, r https://golang.org/cl/118670043
1 parent 14e8885 commit e5e547c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pkg/runtime/traceback_arm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,14 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip,
128128
frame.lr = *(uintptr*)frame.sp;
129129
flr = runtime·findfunc(frame.lr);
130130
if(flr == nil) {
131-
runtime·printf("runtime: unexpected return pc for %s called from %p\n", runtime·funcname(f), frame.lr);
132-
if(callback != nil)
131+
// This happens if you get a profiling interrupt at just the wrong time.
132+
// In that context it is okay to stop early.
133+
// But if callback is set, we're doing a garbage collection and must
134+
// get everything, so crash loudly.
135+
if(callback != nil) {
136+
runtime·printf("runtime: unexpected return pc for %s called from %p\n", runtime·funcname(f), frame.lr);
133137
runtime·throw("unknown caller pc");
138+
}
134139
}
135140
}
136141

0 commit comments

Comments
 (0)