Plumb scudo_stack_depot_size to debuggerd_process_info

This is a no-op but will be used in upcoming scudo changes that allow to
change the depot size at process startup time, and as such we will no
longer be able to call __scudo_get_stack_depot_size in debuggerd.

We already did the equivalent change for the ring buffer size in
https://r.android.com/q/topic:%22scudo_ring_buffer_size%22

Bug: 309446692
Change-Id: Icdcf4cd0a3a486d1ea07a8c616cae776730e1047
This commit is contained in:
Florian Mayer 2023-12-04 16:38:26 -08:00
parent c43ebff0a7
commit af06759667
3 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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;

View file

@ -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,
};
}