Commit 582eca66 authored by avi@chromium.org's avatar avi@chromium.org

MacTerminateOnHeapCorruption shouldn't leak the OOM killer into the shared test context.

BUG=196349
TEST=SecurityTest.NewOverflow and CallocOverflow should not fail as part of a long test run


Review URL: https://chromiumcodereview.appspot.com/13529020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192660 0039d316-1c4b-4281-b951-d872f2087c98
parent b9cff569
......@@ -543,9 +543,6 @@ TEST_F(ProcessUtilTest, LaunchAsUser) {
// The following code tests the system implementation of malloc() thus no need
// to test it under AddressSanitizer.
TEST_F(ProcessUtilTest, MacMallocFailureDoesNotTerminate) {
// Install the OOM killer.
base::EnableTerminationOnOutOfMemory();
// Test that ENOMEM doesn't crash via CrMallocErrorBreak two ways: the exit
// code and lack of the error string. The number of bytes is one less than
// MALLOC_ABSOLUTE_MAX_SIZE, more than which the system early-returns NULL and
......@@ -553,7 +550,11 @@ TEST_F(ProcessUtilTest, MacMallocFailureDoesNotTerminate) {
// EnableTerminationOnOutOfMemory() for more information.
void* buf = NULL;
ASSERT_EXIT(
buf = malloc(std::numeric_limits<size_t>::max() - (2 * PAGE_SIZE) - 1),
{
base::EnableTerminationOnOutOfMemory();
buf = malloc(std::numeric_limits<size_t>::max() - (2 * PAGE_SIZE) - 1);
},
testing::KilledBySignal(SIGTRAP),
"\\*\\*\\* error: can't allocate region.*"
"(Terminating process due to a potential for future heap "
......
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