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

panics if profile is not found #863

Closed
rhysh opened this issue May 23, 2024 · 1 comment · Fixed by #864
Closed

panics if profile is not found #863

rhysh opened this issue May 23, 2024 · 1 comment · Fixed by #864

Comments

@rhysh
Copy link

rhysh commented May 23, 2024

Hello! I opened golang/go#67626 for the Go project to track consuming a fix; my guess is there should be an issue on this project to track creation of a fix.

What version of pprof are you using?

I've checked out 9665fa2 from May 20, currently the latest version of the main branch.

What operating system and processor architecture are you using?

linux/amd64

What did you do?

$ go run . ./missing

What did you expect to see?

$ go run . ./missing
./missing: open ./missing: no such file or directory
pprof: failed to fetch any source profiles
exit status 2

What did you see instead?

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

goroutine 19 [running]:
github.com/google/pprof/internal/driver.fetch({0x7fffec08a721, 0x9}, 0xffffffffc4653600, 0xffffffffc4653600, {0x7fc040045278, 0xc000080210}, {0xa68860, 0xc0000aa840})
	/home/rhysh/pprof/internal/driver/fetch.go:514 +0x2f7
github.com/google/pprof/internal/driver.grabProfile(0xc0001e28c0, {0x7fffec08a721?, 0x0?}, {0x0?, 0x0?}, {0xa69c80, 0xc000032fd0}, {0x7fc040045278, 0xc000080210}, {0xa68860, ...})
	/home/rhysh/pprof/internal/driver/fetch.go:334 +0x131
github.com/google/pprof/internal/driver.concurrentGrab.func1(0xc000234000)
	/home/rhysh/pprof/internal/driver/fetch.go:211 +0x86
created by github.com/google/pprof/internal/driver.concurrentGrab in goroutine 34
	/home/rhysh/pprof/internal/driver/fetch.go:209 +0x8f
exit status 2

Bisect says " a5a03c7 is the first bad commit".

CC @cuishuang, @aalexand

aalexand added a commit to aalexand/pprof that referenced this issue May 23, 2024
odeke-em added a commit to orijtech/pprof that referenced this issue May 24, 2024
This change inverts checks to ensure that we return
a wrapped fs.ErrNotExist error if we completely fail
to find a source fetcher, instead of panicking.

Fixes google#863
@cuishuang
Copy link
Contributor

Sorry I introduced this unexpected error.

aalexand added a commit that referenced this issue May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants