chrome quietly ignores histograms when the number of buckets is greater than the range |
||
Issue description
In chromium/src/base/histogram.cc, there are a few places where a histogram is deemed not valid, but the error is not logged. For instance:
if (*bucket_count > static_cast<uint32_t>(*maximum - *minimum + 2)) {
check_okay = false;
*bucket_count = static_cast<uint32_t>(*maximum - *minimum + 2);
}
The cros metrics library does not make these checks, so it is possible to send cros histogram samples which are completely ignored. This can cause problems when testing. (See if you can guess who had such problems.)
Even if these errors were logged, it would be better to replicate these checks on the cros side. The checks are intrinsic to the definition of the histograms, so the code duplication is acceptable.
,
Sep 21
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/2970c740cee32a3d2ba36d6f8b1a729a8a12269c commit 2970c740cee32a3d2ba36d6f8b1a729a8a12269c Author: Luigi Semenzato <semenzato@chromium.org> Date: Fri Sep 21 07:51:23 2018 metrics: add sanity checks for histogram samples Certain kinds of malformed histogram samples are ignored by Chrome, without logging any errors. This change causes failures when attempting to send such samples. BUG= chromium:882903 ,chromium:338015 TEST=unit test Change-Id: Ib86db80717ed286706b83f6727be6c0844c777c5 Reviewed-on: https://chromium-review.googlesource.com/1237266 Commit-Ready: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> [modify] https://crrev.com/2970c740cee32a3d2ba36d6f8b1a729a8a12269c/metrics/serialization/metric_sample.cc [modify] https://crrev.com/2970c740cee32a3d2ba36d6f8b1a729a8a12269c/metrics/serialization/serialization_utils_test.cc
,
Oct 2
This should be fixed. |
||
►
Sign in to add a comment |
||
Comment 1 by semenzato@chromium.org
, Sep 20Owner: semenzato@chromium.org
Status: Started (was: Untriaged)