Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime/pprof: shows invalid instruction addresses #70609

Closed
alexanius opened this issue Nov 28, 2024 · 2 comments
Closed

runtime/pprof: shows invalid instruction addresses #70609

alexanius opened this issue Nov 28, 2024 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.

Comments

@alexanius
Copy link

Go version

go version devel go1.24-caee788a48 Thu Nov 28 02:59:28 2024 +0000 linux/arm64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/amarkin/.cache/go-build'
GODEBUG=''
GOENV='/home/amarkin/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2308839239=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/amarkin/test/bench/go1/go.mod'
GOMODCACHE='/home/amarkin/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/amarkin/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/amarkin/repo/go_trunk'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/amarkin/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/amarkin/repo/go_trunk/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='devel go1.24-caee788a48 Thu Nov 28 02:59:28 2024 +0000'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

go test -c -o go1.go.out

./go1.go.out -test.bench=. -test.cpuprofile=t.pgo -test.count=5

go tool pprof -raw -addresses t.pgo | grep "0x2ab6.[^0-9a-f]"
  1429: 0x2ab64 M=1 runtime.gcBgMarkWorker.func2 /home/amarkin/repo/go_trunk/src/runtime/mgc.go:1496:0 s=1483
  5624: 0x2ab63 M=1 runtime.gcBgMarkWorker.func2 /home/amarkin/repo/go_trunk/src/runtime/mgc.go:1495:0 s=1483

go tool objdump go1.go.out | grep "0x2ab6.[^0-9a-f]"
  mgc.go:1495           0x2ab60                 94008e48                CALL runtime.casGToWaitingForGC(SB)
  mgc.go:1496           0x2ab64                 f9401be3                MOVD 48(RSP), R3
  mgc.go:1496           0x2ab68                 3980007b                MOVB (R3), R27
  mgc.go:1496           0x2ab6c                 f9491c64                MOVD 4664(R3), R4

What did you see happen?

We see, that the pprof shows an instruction with an address 0x2ab63, that actually cannot be in the arm binary. Additional check with objdump shows, that this binary does not have instruction with such address. In large applications the number of such incorrect instructions makes almost impossible performance analysis of particular instructions.

The image shows the output of more complicated application with this problem
image

What did you expect to see?

I expect to see correct instructions in the pprof tool.

@seankhliao seankhliao changed the title import/path: issue Pprof shows invalid instruction address runtime/pprof: shows invalid instruction addresses Nov 28, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 28, 2024
@seankhliao
Copy link
Member

Duplicate of #41338

@seankhliao seankhliao marked this as a duplicate of #41338 Nov 28, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

4 participants