diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-11-07 01:03:26 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2018-11-07 01:03:26 +0000 |
commit | d657f109d7080bd51ad70e88859acf64931152fe (patch) | |
tree | 1e2e1a27ae1e991b751ef422db2cc61923d1e034 /compiler-rt/lib/sanitizer_common | |
parent | b1abf9e670dcda82deb3b582fa921a62cea4e814 (diff) | |
download | bcm5719-llvm-d657f109d7080bd51ad70e88859acf64931152fe.tar.gz bcm5719-llvm-d657f109d7080bd51ad70e88859acf64931152fe.zip |
[sanitizer] Only set soft coredump limit.
Summary: If user wants to raise it back, let them.
Reviewers: kcc, vitalybuka
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D54190
llvm-svn: 346284
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc index 266e9bdba05..3006e60d89f 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc @@ -94,10 +94,12 @@ static rlim_t getlim(int res) { } static void setlim(int res, rlim_t lim) { - // The following magic is to prevent clang from replacing it with memset. - volatile struct rlimit rlim; + struct rlimit rlim; + if (getrlimit(res, const_cast<struct rlimit *>(&rlim))) { + Report("ERROR: %s getrlimit() failed %d\n", SanitizerToolName, errno); + Die(); + } rlim.rlim_cur = lim; - rlim.rlim_max = lim; if (setrlimit(res, const_cast<struct rlimit *>(&rlim))) { Report("ERROR: %s setrlimit() failed %d\n", SanitizerToolName, errno); Die(); |