From: Andrew Gerrand Date: Mon, 11 Aug 2014 23:46:42 +0000 (+1000) Subject: [release-branch.go1.3] runtime: turn off 'unexpected return pc' print on arm traceback X-Git-Tag: go1.3.1~8 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6b0ac0f972de8c55503ccb0e056a0113c4bf4970;p=gostls13.git [release-branch.go1.3] runtime: turn off 'unexpected return pc' print on arm traceback ««« CL 118670043 / 671fa8a9eb80 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 »»» TBR=rsc CC=golang-codereviews https://golang.org/cl/127950044 --- diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c index d15244c2a9..30f43d54c2 100644 --- a/src/pkg/runtime/traceback_arm.c +++ b/src/pkg/runtime/traceback_arm.c @@ -128,9 +128,14 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, frame.lr = *(uintptr*)frame.sp; flr = runtime·findfunc(frame.lr); if(flr == nil) { - runtime·printf("runtime: unexpected return pc for %s called from %p\n", runtime·funcname(f), frame.lr); - if(callback != nil) + // This happens if you get a profiling interrupt at just the wrong time. + // In that context it is okay to stop early. + // But if callback is set, we're doing a garbage collection and must + // get everything, so crash loudly. + if(callback != nil) { + runtime·printf("runtime: unexpected return pc for %s called from %p\n", runtime·funcname(f), frame.lr); runtime·throw("unknown caller pc"); + } } }