You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"net/http"
_ "net/http/pprof"
)
var sink []byte
func main() {
for i := 0; i < 10; i++ {
sink = make([]byte, 1<<20)
}
panic(http.ListenAndServe("127.0.0.1:8080", nil))
}
test.sh:
#!/usr/bin/env bash
go version
go build -o ./server ./main.go
./server &
server="$!"
sleep 1
echo '--- debug=1 ---'
go tool pprof -raw -output=/dev/null 'http://127.0.0.1:8080/debug/pprof/goroutine?debug=1'
echo '--- debug=0 ---'
go tool pprof -raw -output=/dev/null 'http://127.0.0.1:8080/debug/pprof/goroutine?debug=0'
echo '--- end ---'
kill -KILL -- "$server"
rm ./server
What did you expect to see?
To begin, I expected go tool pprof to not panic on any input.
Second of all, I expected the runtime/pprof and net/http/pprof packages to not produce content that would trigger panics in cmd/pprof or github.com/google/pprof.
The
go tool pprof
command panics when retrieving/debug/pprof/goroutine?debug=0
profiles.What did you do?
Test cases are adapted from #16892.
main.go:
test.sh:
What did you expect to see?
To begin, I expected
go tool pprof
to not panic on any input.Second of all, I expected the runtime/pprof and net/http/pprof packages to not produce content that would trigger panics in cmd/pprof or github.com/google/pprof.
What did you see instead?
However,
cmd/pprof
(be8a6fd) andgithub.com/google/pprof
(google/pprof@01ea337) both panic.Here's the output of the cmd/pprof panic:
/cc @matloob @rauls5382
The text was updated successfully, but these errors were encountered: