[compiler-rt] allocation_ring_buffer_size <= 0 disables buffer (PR #71791)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 02:41:44 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Florian Mayer (fmayer)
<details>
<summary>Changes</summary>
Prevent a null pointer exception for allocation_ring_buffer_size < 0.
---
Full diff: https://github.com/llvm/llvm-project/pull/71791.diff
2 Files Affected:
- (modified) compiler-rt/lib/scudo/standalone/combined.h (+1-1)
- (modified) compiler-rt/lib/scudo/standalone/flags.inc (+2-1)
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h
index b1700e5ecef7f5b..cb48c8c1e3a1e77 100644
--- a/compiler-rt/lib/scudo/standalone/combined.h
+++ b/compiler-rt/lib/scudo/standalone/combined.h
@@ -886,7 +886,7 @@ class Allocator {
void setTrackAllocationStacks(bool Track) {
initThreadMaybe();
- if (getFlags()->allocation_ring_buffer_size == 0) {
+ if (getFlags()->allocation_ring_buffer_size <= 0) {
DCHECK(!Primary.Options.load().get(OptionBit::TrackAllocationStacks));
return;
}
diff --git a/compiler-rt/lib/scudo/standalone/flags.inc b/compiler-rt/lib/scudo/standalone/flags.inc
index 60aeb1f1df570ac..f5a2bab5057ae13 100644
--- a/compiler-rt/lib/scudo/standalone/flags.inc
+++ b/compiler-rt/lib/scudo/standalone/flags.inc
@@ -47,4 +47,5 @@ SCUDO_FLAG(int, release_to_os_interval_ms, SCUDO_ANDROID ? INT32_MIN : 5000,
"memory to the OS. Negative values disable the feature.")
SCUDO_FLAG(int, allocation_ring_buffer_size, 32768,
- "Entries to keep in the allocation ring buffer for scudo.")
+ "Entries to keep in the allocation ring buffer for scudo. "
+ "Values less or equal to zero disable the buffer.")
``````````
</details>
https://github.com/llvm/llvm-project/pull/71791
More information about the llvm-commits
mailing list