[compiler-rt] [scudo] Add parameters for ring buffer and stack depot sizes (PR #74539)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 16:00:39 PST 2023


https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/74539

These will be used in follow-up CLs, committing this separately because it needs a matching change in AOSP. This way we can avoid complicated multi-repo rollbacks if something is wrong with the follow up CLs.

>From 1c4803fe92ea7111b5207bb24bc0a7c527144d5d Mon Sep 17 00:00:00 2001
From: Florian Mayer <fmayer at google.com>
Date: Tue, 5 Dec 2023 15:56:29 -0800
Subject: [PATCH] [scudo] Add parameters for ring buffer and stack depot sizes

These will be used in follow-up CLs, committing this separately
because it needs a matching change in AOSP. This way we can avoid
complicated multi-repo rollbacks if something is wrong with the follow
up CLs.
---
 .../lib/scudo/standalone/include/scudo/interface.h  |  3 ++-
 .../lib/scudo/standalone/wrappers_c_bionic.cpp      | 13 +++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/compiler-rt/lib/scudo/standalone/include/scudo/interface.h b/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
index 260f1a7bd84bb..a664b9825f209 100644
--- a/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
+++ b/compiler-rt/lib/scudo/standalone/include/scudo/interface.h
@@ -72,7 +72,8 @@ typedef void (*iterate_callback)(uintptr_t base, size_t size, void *arg);
 // pointer.
 void __scudo_get_error_info(struct scudo_error_info *error_info,
                             uintptr_t fault_addr, const char *stack_depot,
-                            const char *region_info, const char *ring_buffer,
+                            size_t stack_depot_size, const char *region_info,
+                            const char *ring_buffer, size_t ring_buffer_size,
                             const char *memory, const char *memory_tags,
                             uintptr_t memory_addr, size_t memory_size);
 
diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp b/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
index 4fed44779b902..f203615ab3602 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c_bionic.cpp
@@ -38,12 +38,13 @@ static scudo::Allocator<scudo::Config, SCUDO_PREFIX(malloc_postinit)>
 // TODO(kostyak): support both allocators.
 INTERFACE void __scudo_print_stats(void) { Allocator.printStats(); }
 
-INTERFACE void
-__scudo_get_error_info(struct scudo_error_info *error_info,
-                       uintptr_t fault_addr, const char *stack_depot,
-                       const char *region_info, const char *ring_buffer,
-                       const char *memory, const char *memory_tags,
-                       uintptr_t memory_addr, size_t memory_size) {
+INTERFACE void __scudo_get_error_info(
+    struct scudo_error_info *error_info, uintptr_t fault_addr,
+    const char *stack_depot, size_t stack_depot_size, const char *region_info,
+    const char *ring_buffer, size_t ring_buffer_size, const char *memory,
+    const char *memory_tags, uintptr_t memory_addr, size_t memory_size) {
+  (void)(stack_depot_size);
+  (void)(ring_buffer_size);
   Allocator.getErrorInfo(error_info, fault_addr, stack_depot, region_info,
                          ring_buffer, memory, memory_tags, memory_addr,
                          memory_size);



More information about the llvm-commits mailing list