Skip to content

Commit

Permalink
[sanitizer] Suggest checking ulimit -d in addition to ulimit -v (llvm…
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
iii-i authored and aaryanshukla committed Jul 14, 2024
1 parent 73f510e commit 4fa6b64
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 4fa6b64

Please sign in to comment.