New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 726342 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

We should have some reasonable limit on bucket count in non-sparse histograms

Project Member Reported by asvitk...@chromium.org, May 25 2017

Issue description

We should have some reasonable limit on bucket count in non-sparse histograms.

Now that there's an optimization in place to not allocate the full buckets array when only a single bucket slot is used, it's too easy for someone to specify something very unreasonable for the bucket count param, for example this CL was specifying std::numeric_limits<base::HistogramBase::Sample>::max() - 1: https://codereview.chromium.org/2897143003/

We should add a check with some limit that we don't expect any legit use of the histogram to hit. Trying out a CL that sets this to 10000 and seeing if it passes cq.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c49943dc741398caa352ace1d15c8fdf313fe942

commit c49943dc741398caa352ace1d15c8fdf313fe942
Author: asvitkine <asvitkine@chromium.org>
Date: Thu May 25 19:29:47 2017

Disallow non-sparse histograms with too many buckets.

Now that we have an optimization in place where we don't
allocate the full array until more than 1 bucket is used,
it's too easy to do something ridiculous like pass max
int32 to the bucket_count param without noticing it causing
a problem during local testing.

BUG= 726342 

Review-Url: https://codereview.chromium.org/2898953007
Cr-Commit-Position: refs/heads/master@{#474753}

[modify] https://crrev.com/c49943dc741398caa352ace1d15c8fdf313fe942/base/metrics/histogram.cc

Labels: M-60
Status: Fixed (was: Started)

Sign in to add a comment