* Running with ASAN needs more stack, so don't set resource constraints too
tight.
* Checking boot time memory usage doesn't make sense when running with ASAN,
it eats tons of memory for itself.
* Fixed a malloc/delete[] mismatch: Not surprisingly, the pointer wrapped by
a SmartArrayPointer should better be allocated by, well, NewArray...
Even with these 3 fixes, we still have a few failures when running our test
suite with ASAN. Most of them are either timeouts or failures caused by greatly
increased stack usage.
R=mstarzinger@chromium.org
Review URL: https://codereview.chromium.org/
15096011
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14674
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
}
+// We need at least 165kB for an x64 debug build with clang and ASAN.
+static const int stack_breathing_room = 256 * i::KB;
+
+
TEST(SetResourceConstraints) {
- static const int K = 1024;
- uint32_t* set_limit = ComputeStackLimit(128 * K);
+ uint32_t* set_limit = ComputeStackLimit(stack_breathing_room);
// Set stack limit.
v8::ResourceConstraints constraints;
uint32_t* set_limit;
{
v8::Locker locker(CcTest::default_isolate());
- static const int K = 1024;
- set_limit = ComputeStackLimit(128 * K);
+ set_limit = ComputeStackLimit(stack_breathing_room);
// Set stack limit.
v8::ResourceConstraints constraints;
}
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+#define V8_WITH_ASAN 1
+#endif
+#endif
+
+
// Here is a memory use test that uses /proc, and is therefore Linux-only. We
// do not care how much memory the simulator uses, since it is only there for
-// debugging purposes.
-#if defined(__linux__) && !defined(USE_SIMULATOR)
+// debugging purposes. Testing with ASAN doesn't make sense, either.
+#if defined(__linux__) && !defined(USE_SIMULATOR) && !defined(V8_WITH_ASAN)
static uintptr_t ReadLong(char* buffer, intptr_t* position, int base) {
reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
size_t kProgramSize = 1024 * 1024;
- i::SmartArrayPointer<char> program(
- reinterpret_cast<char*>(malloc(kProgramSize + 1)));
+ i::SmartArrayPointer<char> program(i::NewArray<char>(kProgramSize + 1));
memset(*program, '(', kProgramSize);
program[kProgramSize] = '\0';