Commit 4ddc9f1c authored by mbrandy's avatar mbrandy Committed by Commit bot

[test] Protect against infinite loops in LiveRange logic.

A subset of the LiveRangeUnitTests (SplitInvalidPreStart,
InvalidSplitEnd, SplitInvalidPostEnd) fail or hang on AIX in release
mode.

These tests fork a child which is expected to crash in
register-allocator code after feeding in bad inputs.

In debug mode, they behave as expected due to hitting a debug assert.

In release mode, however, the tests rely only on the fact that
dereferencing a null pointer will cause a SEGFAULT.  This is true on
most platforms, but not AIX.  An AIX process has valid low memory
pages mapped for reading and will not fault.  Thus, these tests fail
or hang because the child process survives the load from address zero
and either completes (with undefined results) or goes into an infinite
loop.

R=bmeurer@chromium.org, danno@chromium.org, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1384733002

Cr-Commit-Position: refs/heads/master@{#31090}
parent 75f6ad74
......@@ -11,9 +11,11 @@
#ifdef DEBUG
#define V8_ASSERT_DEBUG_DEATH(statement, regex) \
ASSERT_DEATH_IF_SUPPORTED(statement, regex)
#define DISABLE_IN_RELEASE(Name) Name
#else
#define V8_ASSERT_DEBUG_DEATH(statement, regex) statement
#define DISABLE_IN_RELEASE(Name) DISABLED_##Name
#endif // DEBUG
namespace v8 {
......@@ -83,19 +85,19 @@ TEST_F(LiveRangeUnitTest, SplitInvalidStart) {
}
TEST_F(LiveRangeUnitTest, InvalidSplitEnd) {
TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(InvalidSplitEnd)) {
TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1);
ASSERT_DEATH_IF_SUPPORTED(Split(range, 1), ".*");
}
TEST_F(LiveRangeUnitTest, SplitInvalidPreStart) {
TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(SplitInvalidPreStart)) {
TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(1, 2);
ASSERT_DEATH_IF_SUPPORTED(Split(range, 0), ".*");
}
TEST_F(LiveRangeUnitTest, SplitInvalidPostEnd) {
TEST_F(LiveRangeUnitTest, DISABLE_IN_RELEASE(SplitInvalidPostEnd)) {
TopLevelLiveRange* range = TestRangeBuilder(zone()).Build(0, 1);
ASSERT_DEATH_IF_SUPPORTED(Split(range, 2), ".*");
}
......
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