Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sanitizers] Bump malloc limit to 1TB for MSAN, LSAN & DFSAN #89728

Merged
merged 1 commit into from
May 22, 2024

Conversation

yingcong-wu
Copy link
Contributor

@yingcong-wu yingcong-wu commented Apr 23, 2024

We already have const uptr kMaxAllowedMallocSize = 1ULL << 40; set for ASAN, HWASAN, memprof, TSAN. This patch bumps the malloc limit for MSAN, LSAN and DFSAN to 1TB as well. 8GB is simply not enough nowadays.

@llvmbot
Copy link

llvmbot commented Apr 23, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Wu Yingcong (yingcong-wu)

Changes

We already have const uptr kMaxAllowedMallocSize = 1ULL &lt;&lt; 40; set for ASAN, HWASAN, memprof, TSAN. This patch bumps the malloca limit for MSAN, LSAN and DFSAN to 1TB as well. 8GB is not enough for now.


Full diff: https://github.com/llvm/llvm-project/pull/89728.diff

3 Files Affected:

  • (modified) compiler-rt/lib/dfsan/dfsan_allocator.cpp (+1-1)
  • (modified) compiler-rt/lib/lsan/lsan_allocator.cpp (+1-1)
  • (modified) compiler-rt/lib/msan/msan_allocator.cpp (+1-1)
diff --git a/compiler-rt/lib/dfsan/dfsan_allocator.cpp b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
index 63475f434cd100..682df8c6e0346f 100644
--- a/compiler-rt/lib/dfsan/dfsan_allocator.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_allocator.cpp
@@ -45,7 +45,7 @@ const uptr kAllocatorSpace = 0xE00000000000ULL;
 #else
 const uptr kAllocatorSpace = 0x700000000000ULL;
 #endif
-const uptr kMaxAllowedMallocSize = 8UL << 30;
+const uptr kMaxAllowedMallocSize = 1ULL << 40;
 
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
   static const uptr kSpaceBeg = kAllocatorSpace;
diff --git a/compiler-rt/lib/lsan/lsan_allocator.cpp b/compiler-rt/lib/lsan/lsan_allocator.cpp
index 12d579a9385b17..493bf5f9efc578 100644
--- a/compiler-rt/lib/lsan/lsan_allocator.cpp
+++ b/compiler-rt/lib/lsan/lsan_allocator.cpp
@@ -31,7 +31,7 @@ static const uptr kMaxAllowedMallocSize = 1ULL << 30;
 #elif defined(__mips64) || defined(__aarch64__)
 static const uptr kMaxAllowedMallocSize = 4ULL << 30;
 #else
-static const uptr kMaxAllowedMallocSize = 8ULL << 30;
+static const uptr kMaxAllowedMallocSize = 1ULL << 40;
 #endif
 
 static Allocator allocator;
diff --git a/compiler-rt/lib/msan/msan_allocator.cpp b/compiler-rt/lib/msan/msan_allocator.cpp
index b1bc5b9390f75b..8350106dc8175f 100644
--- a/compiler-rt/lib/msan/msan_allocator.cpp
+++ b/compiler-rt/lib/msan/msan_allocator.cpp
@@ -71,7 +71,7 @@ static const uptr kAllocatorSpace = 0x700000000000ULL;
 #else
 static const uptr kAllocatorSpace = 0x600000000000ULL;
 #endif
-static const uptr kMaxAllowedMallocSize = 8UL << 30;
+static const uptr kMaxAllowedMallocSize = 1ULL << 40;
 
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
   static const uptr kSpaceBeg = kAllocatorSpace;

@yingcong-wu
Copy link
Contributor Author

Hi @MaskRay @kcc , would you please help review this patch? Thank you!

@yingcong-wu
Copy link
Contributor Author

Kindly ping @vitalybuka to review this as well.

@yingcong-wu
Copy link
Contributor Author

Kindly ping @MaskRay @kcc @vitalybuka to review the patch. Thanks.

1 similar comment
@yingcong-wu
Copy link
Contributor Author

Kindly ping @MaskRay @kcc @vitalybuka to review the patch. Thanks.

@Enna1 Enna1 requested review from MaskRay and vitalybuka May 6, 2024 02:09
@yingcong-wu
Copy link
Contributor Author

Kindly ping @MaskRay @vitalybuka to review the patch. Thanks.

@yingcong-wu
Copy link
Contributor Author

Hi @MaskRay , I don't have commit access, could you please help land this patch? Thanks.

1 similar comment
@yingcong-wu
Copy link
Contributor Author

Hi @MaskRay , I don't have commit access, could you please help land this patch? Thanks.

@Enna1 Enna1 merged commit 511077d into llvm:main May 22, 2024
9 checks passed
@yingcong-wu yingcong-wu deleted the yc/0423-bump-msan-malloc-limit branch November 13, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants