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

net/http/pprof: Index doesn't include Symbol #69897

Closed
HouzuoGuo opened this issue Oct 15, 2024 · 3 comments
Closed

net/http/pprof: Index doesn't include Symbol #69897

HouzuoGuo opened this issue Oct 15, 2024 · 3 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.
Milestone

Comments

@HouzuoGuo
Copy link

HouzuoGuo commented Oct 15, 2024

Go version

go version go1.23.2 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/howard/.cache/go-build'
GOENV='/home/howard/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/howard/go/pkg/mod'
GONOPROXY='[email protected]'
GONOSUMDB='[email protected]'
GOOS='linux'
GOPATH='/home/howard/go'
GOPRIVATE='[email protected]'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/howard/sdk/go1.23.2'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/howard/sdk/go1.23.2/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/howard/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/howard/git/better-strat/go.mod'
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-build2913638291=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Create a minimum http server to serve the default profiling handlers:

package main

import (
	"net/http"
	_ "net/http/pprof"
)

func main() {
	http.ListenAndServe(":8080", http.DefaultServeMux)
}

What did you see happen?

https://pkg.go.dev/net/http/pprof#Index lists all registered profiles, however the output is missing the symbol profile:

<li><div class=profile-name>allocs: </div> A sampling of all past memory allocations</li>
<li><div class=profile-name>block: </div> Stack traces that led to blocking on synchronization primitives</li>
<li><div class=profile-name>cmdline: </div> The command line invocation of the current program</li>
<li><div class=profile-name>goroutine: </div> Stack traces of all current goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.</li>
<li><div class=profile-name>heap: </div> A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.</li>
<li><div class=profile-name>mutex: </div> Stack traces of holders of contended mutexes</li>
<li><div class=profile-name>profile: </div> CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.</li>
<li><div class=profile-name>threadcreate: </div> Stack traces that led to the creation of new OS threads</li>
<li><div class=profile-name>trace: </div> A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.</li>

What did you expect to see?

Either https://pkg.go.dev/net/http/pprof#Index is mistaken and missed the symbol profile, or https://pkg.go.dev/net/http/pprof#Symbol is mistaken and it the package initialisation does not register it at /debug/pprof/symbol.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 15, 2024
@seankhliao seankhliao changed the title net/http/pprof: Symbol should but is not registered at /debug/pprof/symbol net/http/pprof: Index doesn't include Symbol Oct 15, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/620455 mentions this issue: net/http/pprof: include Symbol in Index

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Oct 16, 2024
@dmitshur dmitshur added this to the Backlog milestone Oct 16, 2024
@dmitshur
Copy link
Contributor

CC @cherrymui.

@dmitshur dmitshur modified the milestones: Backlog, Go1.24 Oct 21, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 21, 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. 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.
Projects
Development

No branches or pull requests

4 participants