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

Issue 882903 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

chrome quietly ignores histograms when the number of buckets is greater than the range

Project Member Reported by semenzato@chromium.org, Sep 11

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.
 
Labels: -Pri-3 Pri-2
Owner: semenzato@chromium.org
Status: Started (was: Untriaged)
Sorry, the file is chromium/src/base/metrics/histogram.cc.
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
This should be fixed.

Sign in to add a comment