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

Unified Diff: chrome/common/metrics_helpers.cc

Issue 6577013: Crash when we notice a corruption of the histogram range-vector... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/metrics_helpers.cc
===================================================================
--- chrome/common/metrics_helpers.cc (revision 76117)
+++ chrome/common/metrics_helpers.cc (working copy)
@@ -531,6 +531,18 @@
const std::string& histogram_name = histogram.histogram_name();
int corruption = histogram.FindCorruption(snapshot);
+
+ // Crash if we detect that our histograms have been overwritten. This may be
+ // a fair distance from the memory smasher, but we hope to correlate these
+ // crashes with other events, such as plugins, or usage patterns, etc.
+ if (Histogram::BUCKET_ORDER_ERROR & corruption) {
+ // The checksum should have caught this, so crash separately if it didn't.
+ CHECK_NE(0, Histogram::RANGE_CHECKSUM_ERROR & corruption);
+ CHECK(false); // Crash for the bucket order corruption.
+ }
+ // Checksum corruption might not have caused order corruption.
+ CHECK_EQ(0, Histogram::RANGE_CHECKSUM_ERROR & corruption);
+
if (corruption) {
NOTREACHED();
InconsistencyDetected(corruption);

Powered by Google App Engine
This is Rietveld 408576698