win: Fix SimulateCrash.ChildDumpWithoutCrashing under ASAN, disable others

SimulateCrash.ChildDumpWithoutCrashing needed a larger threshold due to
ASAN instrumentation.

These tests expect children to crash, but ASAN captures the exception
before letting Crashpad handle it:

CrashpadClient.HandlerLaunchFailureCrash
CrashpadClient.HandlerLaunchFailureDumpAndCrash
CrashpadHandler.ExtensibilityCalloutsWork
ExceptionSnapshotWinTest.ChildCrash

(which is an upstreaming of https://chromium-review.googlesource.com/1067151).

Additionally, because Chrome doesn't build all, I noticed a missing
dependency on a test binary which is added here.


Bug: chromium:845011
Change-Id: I5c3ae5673512be29edad21e7d20dd57b8b5ce2bf
Reviewed-on: https://chromium-review.googlesource.com/1075715
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Scott Graham 2018-05-28 12:38:46 -07:00 committed by Commit Bot
parent 3033802ed4
commit 5191992ae5
4 changed files with 36 additions and 4 deletions

View File

@ -126,7 +126,13 @@ class HandlerLaunchFailureCrash : public WinMultiprocess {
}
};
TEST(CrashpadClient, HandlerLaunchFailureCrash) {
#if defined(ADDRESS_SANITIZER)
// https://crbug.com/845011
#define MAYBE_HandlerLaunchFailureCrash DISABLED_HandlerLaunchFailureCrash
#else
#define MAYBE_HandlerLaunchFailureCrash HandlerLaunchFailureCrash
#endif
TEST(CrashpadClient, MAYBE_HandlerLaunchFailureCrash) {
WinMultiprocess::Run<HandlerLaunchFailureCrash>();
}
@ -150,7 +156,14 @@ class HandlerLaunchFailureDumpAndCrash : public WinMultiprocess {
}
};
TEST(CrashpadClient, HandlerLaunchFailureDumpAndCrash) {
#if defined(ADDRESS_SANITIZER)
// https://crbug.com/845011
#define MAYBE_HandlerLaunchFailureDumpAndCrash \
DISABLED_HandlerLaunchFailureDumpAndCrash
#else
#define MAYBE_HandlerLaunchFailureDumpAndCrash HandlerLaunchFailureDumpAndCrash
#endif
TEST(CrashpadClient, MAYBE_HandlerLaunchFailureDumpAndCrash) {
WinMultiprocess::Run<HandlerLaunchFailureDumpAndCrash>();
}

View File

@ -112,6 +112,7 @@ source_set("handler_test") {
if (crashpad_is_win) {
data_deps = [
":crashpad_handler_test_extended_handler",
":fake_handler_that_crashes_at_startup",
]
}
}

View File

@ -133,7 +133,13 @@ void CrashWithExtendedHandler::ValidateGeneratedDump() {
EXPECT_EQ(found_extension_streams, 1u);
}
TEST(CrashpadHandler, ExtensibilityCalloutsWork) {
#if defined(ADDRESS_SANITIZER)
// https://crbug.com/845011
#define MAYBE_ExtensibilityCalloutsWork DISABLED_ExtensibilityCalloutsWork
#else
#define MAYBE_ExtensibilityCalloutsWork ExtensibilityCalloutsWork
#endif
TEST(CrashpadHandler, MAYBE_ExtensibilityCalloutsWork) {
WinMultiprocessWithTempDir::Run<CrashWithExtendedHandler>();
}

View File

@ -163,7 +163,13 @@ void TestCrashingChild(TestPaths::Architecture architecture) {
EXPECT_EQ(child.WaitForExit(), EXCEPTION_BREAKPOINT);
}
TEST(ExceptionSnapshotWinTest, ChildCrash) {
#if defined(ADDRESS_SANITIZER)
// https://crbug.com/845011
#define MAYBE_ChildCrash DISABLED_ChildCrash
#else
#define MAYBE_ChildCrash ChildCrash
#endif
TEST(ExceptionSnapshotWinTest, MAYBE_ChildCrash) {
TestCrashingChild(TestPaths::Architecture::kDefault);
}
@ -204,7 +210,13 @@ class SimulateDelegate : public ExceptionHandlerServer::Delegate {
// Verify the dump was captured at the expected location with some slop
// space.
#if defined(ADDRESS_SANITIZER)
// ASan instrumentation inserts more instructions between the expected
// location and what's reported. https://crbug.com/845011.
constexpr uint64_t kAllowedOffset = 500;
#else
constexpr uint64_t kAllowedOffset = 100;
#endif
EXPECT_GT(snapshot.Exception()->Context()->InstructionPointer(),
dump_near_);
EXPECT_LT(snapshot.Exception()->Context()->InstructionPointer(),