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/metrics: example panics when histogram has no counts #44148

Closed
changkun opened this issue Feb 7, 2021 · 2 comments
Closed

runtime/metrics: example panics when histogram has no counts #44148

changkun opened this issue Feb 7, 2021 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@changkun
Copy link
Member

changkun commented Feb 7, 2021

What version of Go are you using (go version)?

$ go version
go version devel +724d0720b3 Fri Feb 5 23:13:11 2021 +0000 darwin/arm64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/changkun/Library/Caches/go-build"
GOENV="/Users/changkun/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/changkun/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/changkun/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/changkun/dev/godev/go-github"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/changkun/dev/godev/go-github/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel +724d0720b3 Fri Feb 5 23:13:11 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/changkun/dev/godev/go-gerrit/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/g2/6fmr1qzx0ns3shq74zrp6bd40000gn/T/go-build3006232810=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://play.golang.org/p/sbvA_ODWDWu

What did you expect to see?

Run success

What did you see instead?

$ go run main.go
/gc/cycles/automatic:gc-cycles
/gc/cycles/automatic:gc-cycles: 0
/gc/cycles/forced:gc-cycles
/gc/cycles/forced:gc-cycles: 0
/gc/cycles/total:gc-cycles
/gc/cycles/total:gc-cycles: 0
/gc/heap/allocs-by-size:bytes
/gc/heap/allocs-by-size:bytes: 9.000000
/gc/heap/frees-by-size:bytes
panic: should not happen

goroutine 1 [running]:
main.medianBucket(0x140001061e0, 0x1c)
        /Users/changkun/dev/changkun.de/tests/metrics/main.go:64 +0xb8
main.main()
        /Users/changkun/dev/changkun.de/tests/metrics/main.go:35 +0x308
exit status 2

cc @mknyszek

@gopherbot
Copy link

Change https://golang.org/cl/290171 mentions this issue: runtime/metrics: fix panic in readingAllMetric example

@odeke-em
Copy link
Member

odeke-em commented Feb 7, 2021

Thank you for this report @changkun! This is a release blocker for Go1.16, and I shall mark it as such.

@odeke-em odeke-em added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Feb 7, 2021
@odeke-em odeke-em added this to the Go1.16 milestone Feb 7, 2021
@golang golang locked and limited conversation to collaborators Feb 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants