mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: traceback: include pc=0x%x for inline frames
Crash monitoring tools may parse the PC values and feed them to CallersFrames, which does not run the inline unwinder, since Callers already did so. So, the GOTRACEBACK=system output must also include PC values even for inlined frames. (The actual values are just marker NOP instructions, but that isn't important.) This CL also includes a test that the PC values can be parsed out of the crash report and fed to CallersFrames to yield a sensible result. (The logic is a distillation of the x/telemetry crashmonitor.) The previously printed PCs were in fact slightly wrong for frames containing inlined calls: instead of the virtual CALL instruction (a NOP) to the first inlined call, it would display the PC of the CALL in the innermost inlined function. Change-Id: I64a06771fc191ba16c1383b8139b714f4f299703 Reviewed-on: https://go-review.googlesource.com/c/go/+/561635 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
08370dcd9a
commit
643d816c8b
3 changed files with 266 additions and 6 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"internal/testenv"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -23,7 +24,19 @@ import (
|
|||
|
||||
var toRemove []string
|
||||
|
||||
const entrypointVar = "RUNTIME_TEST_ENTRYPOINT"
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
switch entrypoint := os.Getenv(entrypointVar); entrypoint {
|
||||
case "crash":
|
||||
crash()
|
||||
panic("unreachable")
|
||||
default:
|
||||
log.Fatalf("invalid %s: %q", entrypointVar, entrypoint)
|
||||
case "":
|
||||
// fall through to normal behavior
|
||||
}
|
||||
|
||||
_, coreErrBefore := os.Stat("core")
|
||||
|
||||
status := m.Run()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue