Skip to content

fix: prevent panic in histogram RecordValue for NaN and +Inf#274

Open
SAY-5 wants to merge 1 commit into
uber-go:masterfrom
SAY-5:fix-histogram-nan-panic
Open

fix: prevent panic in histogram RecordValue for NaN and +Inf#274
SAY-5 wants to merge 1 commit into
uber-go:masterfrom
SAY-5:fix-histogram-nan-panic

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 13, 2026

Copy link
Copy Markdown

sort.Search returns len(h.buckets) when the value compares as not <= any bucket upper bound, which happens for NaN and +Inf, so RecordValue panics with an index out of range. This clamps the index to the last bucket. Closes #195.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Panic on RecordValue

2 participants