summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2015-11-20 18:42:01 +0000
committerAnna Zaks <ganna@apple.com>2015-11-20 18:42:01 +0000
commit8d225205e37187cf2695fa3c421794fcaf9e0030 (patch)
treeeb5181293a445e70f505d6e108cbc6f90af31e33 /compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
parent2ce9f9447c9503534a75315d058fb50f07a01c45 (diff)
downloadbcm5719-llvm-8d225205e37187cf2695fa3c421794fcaf9e0030.tar.gz
bcm5719-llvm-8d225205e37187cf2695fa3c421794fcaf9e0030.zip
[asan] Fix the deadlocks introduced by "On OS X, log reports to syslog and os_trace" commit
[asan] On OS X, log reports to syslog and os_trace, has been reverted in r252076 due to deadlocks on earlier versions of OS X. Alexey has also noticed deadlocks in some corner cases on Linux. This patch, if applied on top of the logging patch (http://reviews.llvm.org/D13452), addresses the known deadlock issues. (This also proactively removes the color escape sequences from the error report buffer since we have to copy the buffer anyway.) Differential Revision: http://reviews.llvm.org/D14470 llvm-svn: 253689
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_posix.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
index 9ad66bec2ad..333fbe1f13e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
@@ -112,14 +112,14 @@ uptr GetMaxVirtualAddress() {
#endif // SANITIZER_WORDSIZE
}
-void *MmapOrDie(uptr size, const char *mem_type) {
+void *MmapOrDie(uptr size, const char *mem_type, bool raw_report) {
size = RoundUpTo(size, GetPageSizeCached());
uptr res = internal_mmap(nullptr, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
int reserrno;
if (internal_iserror(res, &reserrno))
- ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno);
+ ReportMmapFailureAndDie(size, mem_type, "allocate", reserrno, raw_report);
IncreaseTotalMmap(size);
return (void *)res;
}
OpenPOWER on IntegriCloud