aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2023-12-12 00:16:39 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-12-12 00:16:39 +0000
commit62691e69d9e90b52f52b1c52c39110e8a8192215 (patch)
treebad6b6ab119a2cc46fde2cabf9dce8d1fd3465cf
parentd7f564a9d3ea6c81ecad0b2dd02eac33229bc3b5 (diff)
parentcbc2c8859fb07ef2d8c0480d91ce7c04ec35c144 (diff)
downloadbionic-62691e69d9e90b52f52b1c52c39110e8a8192215.tar.gz
Merge "Plumb scudo_stack_depot_size to debuggerd_process_info" into main am: 7fdb49f129 am: cbc2c8859f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2858031 Change-Id: I9dbbd4994789989b7cff129f2755e6c5009bf87e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libc/bionic/malloc_common_dynamic.cpp2
-rw-r--r--libc/private/bionic_globals.h1
-rw-r--r--linker/linker_debuggerd_android.cpp1
3 files changed, 4 insertions, 0 deletions
diff --git a/libc/bionic/malloc_common_dynamic.cpp b/libc/bionic/malloc_common_dynamic.cpp
index 792a11428..a6bf7a7bb 100644
--- a/libc/bionic/malloc_common_dynamic.cpp
+++ b/libc/bionic/malloc_common_dynamic.cpp
@@ -372,6 +372,7 @@ extern "C" const char* __scudo_get_stack_depot_addr();
extern "C" const char* __scudo_get_region_info_addr();
extern "C" const char* __scudo_get_ring_buffer_addr();
extern "C" size_t __scudo_get_ring_buffer_size();
+extern "C" size_t __scudo_get_stack_depot_size();
// Initializes memory allocation framework once per process.
static void MallocInitImpl(libc_globals* globals) {
@@ -385,6 +386,7 @@ static void MallocInitImpl(libc_globals* globals) {
__libc_shared_globals()->scudo_region_info = __scudo_get_region_info_addr();
__libc_shared_globals()->scudo_ring_buffer = __scudo_get_ring_buffer_addr();
__libc_shared_globals()->scudo_ring_buffer_size = __scudo_get_ring_buffer_size();
+ __libc_shared_globals()->scudo_stack_depot_size = __scudo_get_stack_depot_size();
#endif
// Prefer malloc debug since it existed first and is a more complete
diff --git a/libc/private/bionic_globals.h b/libc/private/bionic_globals.h
index 15b570de2..8ea7d4d66 100644
--- a/libc/private/bionic_globals.h
+++ b/libc/private/bionic_globals.h
@@ -130,6 +130,7 @@ struct libc_shared_globals {
const char* scudo_region_info = nullptr;
const char* scudo_ring_buffer = nullptr;
size_t scudo_ring_buffer_size = 0;
+ size_t scudo_stack_depot_size = 0;
HeapTaggingLevel initial_heap_tagging_level = M_HEAP_TAGGING_LEVEL_NONE;
bool initial_memtag_stack = false;
diff --git a/linker/linker_debuggerd_android.cpp b/linker/linker_debuggerd_android.cpp
index ab6fc30c4..444da78c2 100644
--- a/linker/linker_debuggerd_android.cpp
+++ b/linker/linker_debuggerd_android.cpp
@@ -44,6 +44,7 @@ static debugger_process_info get_process_info() {
.scudo_region_info = __libc_shared_globals()->scudo_region_info,
.scudo_ring_buffer = __libc_shared_globals()->scudo_ring_buffer,
.scudo_ring_buffer_size = __libc_shared_globals()->scudo_ring_buffer_size,
+ .scudo_stack_depot_size = __libc_shared_globals()->scudo_stack_depot_size,
};
}