[compiler-rt] r295086 - [compiler-rt][asan|win] Fix flaky unittest due to large allocations

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 10:57:18 PST 2017


Author: etienneb
Date: Tue Feb 14 12:57:17 2017
New Revision: 295086

URL: http://llvm.org/viewvc/llvm-project?rev=295086&view=rev
Log:
[compiler-rt][asan|win] Fix flaky unittest due to large allocations

Summary:
Coverage is using large arrays which requires large allocations.
These allocations are flaky and often failing on win64.

We are using the 32-bits size until this gets a better fix.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits, kubamracek, chrisha, dberris

Differential Revision: https://reviews.llvm.org/D29945

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc?rev=295086&r1=295085&r2=295086&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Tue Feb 14 12:57:17 2017
@@ -171,7 +171,11 @@ class CoverageData {
   //   - not thread-safe;
   //   - does not support long traces;
   //   - not tuned for performance.
-  static const uptr kTrEventArrayMaxSize = FIRST_32_SECOND_64(1 << 22, 1 << 30);
+  // Windows doesn't do overcommit (committed virtual memory costs swap), so
+  // programs can't reliably map such large amounts of virtual memory.
+  // TODO(etienneb): Find a way to support coverage of larger executable
+static const uptr kTrEventArrayMaxSize =
+    (SANITIZER_WORDSIZE == 32 || SANITIZER_WINDOWS) ? 1 << 22 : 1 << 30;
   u32 *tr_event_array;
   uptr tr_event_array_size;
   u32 *tr_event_pointer;




More information about the llvm-commits mailing list