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

fix array index out of bounds #3661

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

novahe
Copy link

@novahe novahe commented Feb 25, 2025

panic stack:

panic: runtime error: index out of range [-1]

goroutine 565 [running]:
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.Uint64Slice.GetPercentile({0xc001216ba0?, 0x1, 0x1000000000008?}, 0x3fee666666666666)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/percentiles.go:50 +0x16a
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.(*resource).GetAllPercentiles(0xc001026440)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/percentiles.go:123 +0xef
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.GetDerivedPercentiles({0xc000435848, 0x1, 0xc0010265a0?})
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/percentiles.go:145 +0x2a8
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.(*StatsSummary).getDerivedUsage(0x7fac0c1608c0?, 0x3c)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/summary.go:157 +0x252
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.(*StatsSummary).updateDerivedStats(0xc001f0b040)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/summary.go:127 +0x1c9
k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary.(*StatsSummary).AddSample(_, {{0xc1e67c2f39724857, 0xeeb2856cf, 0x55d669537980}, {{0xcef01a09f, {0x0, 0x0, 0x0}, 0xa33478c80, 0x260903c80}, ...}, ...})
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/summary/summary.go:88 +0x3bb
k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager.(*containerData).updateStats(0xc001c37b80)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager/container.go:677 +0x345
k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager.(*containerData).housekeepingTick(0xc001c37b80, 0x7c?, 0x5f5e100)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager/container.go:595 +0x165
k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager.(*containerData).housekeeping(0xc001c37b80)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager/container.go:543 +0x446
created by k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager.(*containerData).Start
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/google/cadvisor/manager/container.go:130 +0x56

Copy link

google-cla bot commented Feb 25, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@novahe
Copy link
Author

novahe commented Feb 25, 2025

@Creatone @bobbypage @haircommander review will be appreciated.

@novahe
Copy link
Author

novahe commented Mar 4, 2025

PTAL @SuperQ @cwangVT

Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, otherwise LGTM.

@novahe novahe requested a review from SuperQ March 5, 2025 08:57
@novahe
Copy link
Author

novahe commented Mar 5, 2025

Use testtable to make it clearer, please take a look again.

@novahe novahe requested a review from SuperQ March 5, 2025 09:37
@novahe
Copy link
Author

novahe commented Mar 5, 2025

PTAL @iwankgb
/ok-to-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants