From d2db5ff98889fbe0bb75bcf34c3ef31672bb38e4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 8 Oct 2013 19:03:23 -0400 Subject: [PATCH] crash_reporter: clarify chrome crash ignore message We ignore Chrome crashes when it is the kernel that runs us. When Chrome itself runs us, we will take their crashes. The log output here though has long confused developers, so rephrase it slightly. BUG=None TEST=`cros_run_unit_tests -p crash-reporter --board x86-alex` passes TEST=`cbuildbot {amd64,x86}-generic-full` passes (VMTests) Change-Id: Ia13a766134f5a20a1cc4eaab74ac46633d3177eb Reviewed-on: https://chromium-review.googlesource.com/172261 Reviewed-by: Chris Masone Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger --- crash_reporter/user_collector.cc | 3 ++- crash_reporter/user_collector_test.cc | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/crash_reporter/user_collector.cc b/crash_reporter/user_collector.cc index eefe5dfca..014394aab 100644 --- a/crash_reporter/user_collector.cc +++ b/crash_reporter/user_collector.cc @@ -584,7 +584,8 @@ bool UserCollector::ShouldDump(bool has_owner_consent, // crashes towards user crashes, so user crashes really mean non-Chrome // user-space crashes. if (!handle_chrome_crashes && IsChromeExecName(exec)) { - *reason = "ignoring - chrome crash"; + *reason = "ignoring call by kernel - chrome crash; " + "waiting for chrome to call us directly"; return false; } diff --git a/crash_reporter/user_collector_test.cc b/crash_reporter/user_collector_test.cc index d1a3bcf04..71fc01531 100644 --- a/crash_reporter/user_collector_test.cc +++ b/crash_reporter/user_collector_test.cc @@ -20,6 +20,11 @@ static bool s_metrics = false; static const char kFilePath[] = "/my/path"; +// Keep in sync with UserCollector::ShouldDump. +static const char kChromeIgnoreMsg[] = + "ignoring call by kernel - chrome crash; " + "waiting for chrome to call us directly"; + using base::FilePath; using chromeos::FindLog; @@ -159,25 +164,25 @@ TEST_F(UserCollectorTest, ShouldDumpChromeOverridesDeveloperImage) { // When running a crash test, behave as normal. EXPECT_FALSE(collector_.ShouldDump(false, false, false, "chrome", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "supplied_Compositor", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "supplied_PipelineThread", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "Chrome_ChildIOThread", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "supplied_Chrome_ChildIOT", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "supplied_ChromotingClien", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); EXPECT_FALSE(collector_.ShouldDump(false, false, false, "supplied_LocalInputMonit", &reason)); - EXPECT_EQ("ignoring - chrome crash", reason); + EXPECT_EQ(kChromeIgnoreMsg, reason); // When running a developer image, test that chrome crashes are handled // when the "handle_chrome_crashes" flag is set. @@ -243,7 +248,7 @@ TEST_F(UserCollectorTest, HandleChromeCrashWithConsent) { collector_.HandleCrash("5:2:ignored", "chrome"); EXPECT_TRUE(FindLog( "Received crash notification for chrome[5] sig 2")); - EXPECT_TRUE(FindLog("(ignoring - chrome crash)")); + EXPECT_TRUE(FindLog(kChromeIgnoreMsg)); ASSERT_EQ(s_crashes, 0); } @@ -252,7 +257,7 @@ TEST_F(UserCollectorTest, HandleSuppliedChromeCrashWithConsent) { collector_.HandleCrash("0:2:chrome", NULL); EXPECT_TRUE(FindLog( "Received crash notification for supplied_chrome[0] sig 2")); - EXPECT_TRUE(FindLog("(ignoring - chrome crash)")); + EXPECT_TRUE(FindLog(kChromeIgnoreMsg)); ASSERT_EQ(s_crashes, 0); }