]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: turn off 'unexpected return pc' print on arm traceback
authorRuss Cox <rsc@golang.org>
Wed, 6 Aug 2014 18:50:09 +0000 (14:50 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 6 Aug 2014 18:50:09 +0000 (14:50 -0400)
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

src/pkg/runtime/traceback_arm.c

index 757c1c39a3ec5b4f0f204e0091503e029c332310..778d95a28b1659bcd7dc13d905cef75885d1a537 100644 (file)
@@ -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");
+                               }
                        }
                }