Commit 2046ecf9 authored by Vlad Tsyrklevich's avatar Vlad Tsyrklevich Committed by Commit Bot

GWP-ASan: Report histogram on GWP-ASan crash

In https://cr-rev.appspot.com/c/1594825 I refactored histogram reporting
and accidentally changed it to only report error values and never report
that a GWP-ASan crash was seen. Fix that.

Bug: 956824
Change-Id: I4a1a55fe45db380fc5a00952f304212698c37994
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632896
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663906}
parent 6a1c44ea
...@@ -255,6 +255,7 @@ bool CrashAnalyzer::AnalyzeCrashedAllocator( ...@@ -255,6 +255,7 @@ bool CrashAnalyzer::AnalyzeCrashedAllocator(
metadata.dealloc, proto->mutable_deallocation()); metadata.dealloc, proto->mutable_deallocation());
} }
ReportHistogram(allocator, GwpAsanCrashAnalysisResult::kGwpAsanCrash);
return true; return true;
} }
......
...@@ -100,7 +100,9 @@ TEST_F(CrashAnalyzerTest, StackTraceCollection) { ...@@ -100,7 +100,9 @@ TEST_F(CrashAnalyzerTest, StackTraceCollection) {
CrashAnalyzer::GetExceptionInfo(process_snapshot_, &proto); CrashAnalyzer::GetExceptionInfo(process_snapshot_, &proto);
ASSERT_TRUE(proto_present); ASSERT_TRUE(proto_present);
histogram_tester.ExpectTotalCount(kMallocHistogramName, 0); int result = static_cast<int>(GwpAsanCrashAnalysisResult::kGwpAsanCrash);
EXPECT_THAT(histogram_tester.GetAllSamples(kMallocHistogramName),
testing::ElementsAre(base::Bucket(result, 1)));
histogram_tester.ExpectTotalCount(kPartitionAllocHistogramName, 0); histogram_tester.ExpectTotalCount(kPartitionAllocHistogramName, 0);
ASSERT_TRUE(proto.has_allocation()); ASSERT_TRUE(proto.has_allocation());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment