Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Issue 4174002: Try to detect internal corruption of histogram instances.... (Closed)

Created:
10 years, 1 month ago by jar (doing other things)
Modified:
9 years, 7 months ago
Reviewers:
Mike Belshe
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Try to detect internal corruption of histogram instances. Corruptions can include changes in bucket boundaries, large changes in sample counts (in a bucket), etc. We now detect problems, and don't forward the corrupt data any further. This means it won't exit the renderer and go to the browser if corrupt, and it won't exit the browser and be sent up via UMA if corrupt. IF the would-be corruption is caused by a race to snapshot the data, then a later snapshot should get the clean copy, and all data (across the precluded period) will be sent onward. BUG=61281 r=mbelshe Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=64687

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 12

Patch Set 5 : '' #

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+242 lines, -19 lines) Patch
M base/metrics/histogram.h View 1 2 3 4 5 12 chunks +56 lines, -5 lines 0 comments Download
M base/metrics/histogram.cc View 1 2 3 4 21 chunks +97 lines, -9 lines 0 comments Download
M base/metrics/histogram_unittest.cc View 3 4 1 chunk +53 lines, -0 lines 0 comments Download
M chrome/common/metrics_helpers.cc View 1 2 3 4 1 chunk +17 lines, -1 line 0 comments Download
M chrome/renderer/renderer_histogram_snapshots.cc View 2 3 4 2 chunks +19 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
jar (doing other things)
10 years, 1 month ago (2010-10-30 01:37:27 UTC) #1
Mike Belshe
lgtm with comments http://codereview.chromium.org/4174002/diff/18001/19001 File base/metrics/histogram.cc (right): http://codereview.chromium.org/4174002/diff/18001/19001#newcode309 base/metrics/histogram.cc:309: } nit: It seems like there ...
10 years, 1 month ago (2010-11-01 20:09:09 UTC) #2
jar (doing other things)
10 years, 1 month ago (2010-11-01 21:33:55 UTC) #3
Changes made per comments by mbelshe.

http://codereview.chromium.org/4174002/diff/18001/19001
File base/metrics/histogram.cc (right):

http://codereview.chromium.org/4174002/diff/18001/19001#newcode309
base/metrics/histogram.cc:309: }
On 2010/11/01 20:09:10, Mike Belshe wrote:
> nit:  It seems like there should be a function:
>    int64 ComputeChecksum();
> 
> Then ResetRangeChecksum should be:
>     range_checksum_ = ComputeChecksum();
> 
> and HasValidRangeChecksum should be:
>     return range_checksum_ == ComputeChecksum();
> 

Done.

http://codereview.chromium.org/4174002/diff/18001/19001#newcode551
base/metrics/histogram.cc:551: const int kCommonRaceBasedCountMismatch = 3;
On 2010/11/01 20:09:10, Mike Belshe wrote:
> nit:  I'd prefer 1 for slop (or 0 :-)  your call.

Done.

http://codereview.chromium.org/4174002/diff/18001/19002
File base/metrics/histogram.h (right):

http://codereview.chromium.org/4174002/diff/18001/19002#newcode401
base/metrics/histogram.h:401: Inconsistencies FindCorruption(const SampleSet&
snapshot) const;
Per our offline discussion, if we had a bool return, we should change the
name... but with the current return value identifying the nature (if any!) of
corruption, this name is about as good as any.

On 2010/11/01 20:09:10, Mike Belshe wrote:
> nit:  rename "FindCorruption" to "VerifyData" or "CheckForCorruption"?

http://codereview.chromium.org/4174002/diff/18001/19003
File base/metrics/histogram_unittest.cc (right):

http://codereview.chromium.org/4174002/diff/18001/19003#newcode316
base/metrics/histogram_unittest.cc:316: 
On 2010/11/01 20:09:10, Mike Belshe wrote:
> nit:  nix blank line

Done.

http://codereview.chromium.org/4174002/diff/18001/19004
File chrome/common/metrics_helpers.cc (right):

http://codereview.chromium.org/4174002/diff/18001/19004#newcode496
chrome/common/metrics_helpers.cc:496: static ProblemMap* inconsistencies =
new(ProblemMap);
On 2010/11/01 20:09:10, Mike Belshe wrote:
> bug: shouldn't this be "new ProblemMap()"

Done.

http://codereview.chromium.org/4174002/diff/18001/19005
File chrome/renderer/renderer_histogram_snapshots.cc (right):

http://codereview.chromium.org/4174002/diff/18001/19005#newcode72
chrome/renderer/renderer_histogram_snapshots.cc:72: static ProblemMap*
inconsistencies = new(ProblemMap);
On 2010/11/01 20:09:10, Mike Belshe wrote:
> bug:  I think this needs to be "new ProblemMap()"
> 
> note also:  this static is not thread-safe on initialization.  But I think
that
> is ok here.

Done.

Powered by Google App Engine
This is Rietveld 408576698