summaryrefslogtreecommitdiffstats
path: root/base/process
diff options
context:
space:
mode:
authormfomitchev <mfomitchev@chromium.org>2015-04-02 08:17:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-02 15:17:40 +0000
commitc694b85959b12a1a81785e5fe7a88f3b998f89d0 (patch)
tree9d763083ca196c5b50ced825e85415d318af81f0 /base/process
parent0b2cdd646a2e72c3df158b27974dc9647926d340 (diff)
downloadchromium_src-c694b85959b12a1a81785e5fe7a88f3b998f89d0.zip
chromium_src-c694b85959b12a1a81785e5fe7a88f3b998f89d0.tar.gz
chromium_src-c694b85959b12a1a81785e5fe7a88f3b998f89d0.tar.bz2
Revert of Fix OutOfMemoryDeathTest.ViaSharedLibraries. (patchset #10 id:180001 of https://codereview.chromium.org/878473002/)
Reason for revert: Looks like this broke iOS_Device bot: === BUILD TARGET malloc_wrapper OF PROJECT base WITH CONFIGURATION Release === Check dependencies CodeSign error: code signing is required for product type 'Dynamic Library' in SDK 'iOS 8.1' https://build.chromium.org/p/chromium.mac/builders/iOS_Device/builds/1689/steps/compile/logs/stdio Original issue's description: > Fix OutOfMemoryDeathTest.ViaSharedLibraries. > > This test was invalid on modern glibc: > asprintf errors EOVERFLOW without attempting an allocation > when the size is at least INT_MAX - 32. INT_MAX - 33 is the > largest size that can attempt to trigger allocation failure, > and will not necessarily accomplish that on some systems. > > Create a library that is specified to wrap malloc trivially, > to accomplish the goal of the test without external dependencies > or inconsistently implemented behavior. > > BUG=428211 > > Committed: https://crrev.com/82cb6b003c8e20e4a8386bf8698980bb4981d434 > Cr-Commit-Position: refs/heads/master@{#323197} TBR=gunsch@chromium.org,shess@chromium.org,mark@chromium.org,danakj@chromium.org,icoolidge@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=428211 Review URL: https://codereview.chromium.org/1050423002 Cr-Commit-Position: refs/heads/master@{#323491}
Diffstat (limited to 'base/process')
-rw-r--r--base/process/memory_unittest.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc
index 2e64fd7..50ba098 100644
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -26,7 +26,6 @@
#endif
#if defined(OS_LINUX)
#include <malloc.h>
-#include "base/test/malloc_wrapper.h"
#endif
#if defined(OS_WIN)
@@ -235,11 +234,13 @@ TEST_F(OutOfMemoryDeathTest, Memalign) {
TEST_F(OutOfMemoryDeathTest, ViaSharedLibraries) {
// This tests that the run-time symbol resolution is overriding malloc for
- // shared libraries as well as for our code.
+ // shared libraries (including libc itself) as well as for our code.
+ std::string format = base::StringPrintf("%%%zud", test_size_);
+ char *value = NULL;
ASSERT_DEATH({
- SetUpInDeathAssert();
- value_ = MallocWrapper(test_size_);
- }, "");
+ SetUpInDeathAssert();
+ EXPECT_EQ(-1, asprintf(&value, format.c_str(), 0));
+ }, "");
}
#endif // OS_LINUX