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

cmd/pprof: panics if profile is not found #67626

Closed
rhysh opened this issue May 23, 2024 · 6 comments
Closed

cmd/pprof: panics if profile is not found #67626

rhysh opened this issue May 23, 2024 · 6 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rhysh
Copy link
Contributor

rhysh commented May 23, 2024

Go version

go version devel go1.23-019353d532 Thu May 23 18:51:17 2024 +0000 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/rhysh/.cache/go-build'
GOENV='/home/rhysh/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/rhysh/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/rhysh/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/rhysh/sdk/go-dev'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/rhysh/sdk/go-dev/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.23-019353d532 Thu May 23 18:51:17 2024 +0000'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/rhysh/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3616585202=/tmp/go-build -gno-record-gcc-switches'

What did you do?

$ ./bin/go tool pprof ./missing

What did you see happen?

$ ./bin/go tool pprof ./missing
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x91c737]

goroutine 17 [running]:
cmd/vendor/github.com/google/pprof/internal/driver.fetch({0x7fff1e6ef510, 0x9}, 0xffffffffc4653600, 0xffffffffc4653600, {0x7ff5e88cb1f8, 0xc000080238}, {0xb2eca0, 0xc00009e8a0})
	/home/rhysh/sdk/go-dev/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go:514 +0x2f7
cmd/vendor/github.com/google/pprof/internal/driver.grabProfile(0xc0001ec960, {0x7fff1e6ef510?, 0x9?}, {0x7ff5e88cb1d8?, 0xf1e060?}, {0xb2fc68, 0xc0000331d0}, {0x7ff5e88cb1f8, 0xc000080238}, {0xb2eca0, ...})
	/home/rhysh/sdk/go-dev/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go:334 +0x131
cmd/vendor/github.com/google/pprof/internal/driver.concurrentGrab.func1(0xc000209000)
	/home/rhysh/sdk/go-dev/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go:211 +0x86
created by cmd/vendor/github.com/google/pprof/internal/driver.concurrentGrab in goroutine 7
	/home/rhysh/sdk/go-dev/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go:209 +0x8f

What did you expect to see?

$ ./bin/go tool pprof ./missing
./missing: open ./missing: no such file or directory
failed to fetch any source profiles

Go 1.22 works.

Bisect of this repo says "63dd79c07b0026b58f421a5273c41e705ccb73d1 is the first bad commit". I haven't bisected github.com/google/pprof.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 23, 2024
@rhysh rhysh added this to the Go1.23 milestone May 23, 2024
@prattmic
Copy link
Member

prattmic commented May 23, 2024

google/pprof@a5a03c7 looks like it would cause this.

@dmitshur when do we typically update the vendored version of pprof? If we haven't done so yet, the best bet is probably an upstream fix and then update from upstream.

@rhysh
Copy link
Contributor Author

rhysh commented May 23, 2024

Upstream is still broken, and yes a bisect there points to google/pprof@a5a03c7

@dmitshur
Copy link
Contributor

dmitshur commented May 23, 2024

@prattmic We will update it soon, now that we've entered the release freeze, as part of #36905. It's also fine to update it separately for this as needed.

@odeke-em
Copy link
Member

I've mailed out a fix for the google/pprof library per PR google/pprof#865.

@cagedmantis cagedmantis added the NeedsFix The path to resolution is known, but the work has not been done. label May 24, 2024
@cuishuang
Copy link
Contributor

The upstream has been updated (google/pprof#864). Thanks for the corresponding update.

This issue was caused by my modifications to solve the colon issue with pprof on Windows, including upstream pprof and Go.

Apologies for any inconvenience caused.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/588655 mentions this issue: cmd/vendor: update github.com/google/pprof

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. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Status: Done
Development

No branches or pull requests

7 participants