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.
Comment 1 by bugdroid1@chromium.org
, May 25 2017