[compiler-rt] 7232763 - [sanitizer] Suggest checking ulimit -d in addition to ulimit -v (#98625)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 01:30:54 PDT 2024


Author: Ilya Leoshkevich
Date: 2024-07-13T10:30:51+02:00
New Revision: 7232763a965e1d34a14f745d74245685898e4907

URL: https://github.com/llvm/llvm-project/commit/7232763a965e1d34a14f745d74245685898e4907
DIFF: https://github.com/llvm/llvm-project/commit/7232763a965e1d34a14f745d74245685898e4907.diff

LOG: [sanitizer] Suggest checking ulimit -d in addition to ulimit -v (#98625)

Since Linux 4.7, RLIMIT_DATA may result in mmap() returning ENOMEM.
Example:

    $ clang -fsanitize=address -o hello hello.c
    $ ulimit -d 100000
    $ ./hello
==3349007==ERROR: AddressSanitizer failed to allocate 0x10000000
(268435456) bytes at address 7fff7000 (errno: 12)
==3349007==ReserveShadowMemoryRange failed while trying to map
0x10000000 bytes. Perhaps you're using ulimit -v

Suggest checking ulimit -d in addition to ulimit -v.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
index a174ae7be991d..3966d82d51ee9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
@@ -169,7 +169,7 @@ void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name,
                      : !MmapFixedNoReserve(beg, size, name)) {
     Report(
         "ReserveShadowMemoryRange failed while trying to map 0x%zx bytes. "
-        "Perhaps you're using ulimit -v\n",
+        "Perhaps you're using ulimit -v or ulimit -d\n",
         size);
     Abort();
   }


        


More information about the llvm-commits mailing list