From 8f83908be76b0b77e718221305ce625e83fc3daa Mon Sep 17 00:00:00 2001 From: Rhys Rustad-Elliott Date: Sat, 22 Mar 2025 17:56:01 +0100 Subject: [PATCH] Fix attempting to core dump 100T of memory It seems that commit https://github.com/llvm/llvm-project/commit/c2a57034eff048cd36c563c8e0051db3a70991b3 from upstream LLVM was cherry-picked slightly incorrectly. MADV_DONTNEED should have been used when _not_ executing a dry run. --- compiler-rt/lib/msan/msan_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/msan/msan_linux.cpp b/compiler-rt/lib/msan/msan_linux.cpp index 1fa4d16386b2..138e43742611 100644 --- a/compiler-rt/lib/msan/msan_linux.cpp +++ b/compiler-rt/lib/msan/msan_linux.cpp @@ -155,7 +155,7 @@ static bool InitShadow(bool init_origins, bool dry_run) { if (!dry_run && !MmapFixedSuperNoReserve(start, size, kMemoryLayout[i].name)) return false; - if (dry_run && common_flags()->use_madv_dontdump) + if (!dry_run && common_flags()->use_madv_dontdump) DontDumpShadowMemory(start, size); } if (protect) {