Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd49c387 authored by Florian Mayer's avatar Florian Mayer
Browse files

Use scudo_ring_buffer_size from process_info

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

Bug: 263287052
Change-Id: I350421d1fcdf22ce3b8b73780b88c1e10fa8a074
parent de7851c2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ static void ReadCrashInfo(unique_fd& fd, siginfo_t* siginfo,
      process_info->scudo_stack_depot = crash_info->data.d.scudo_stack_depot;
      process_info->scudo_region_info = crash_info->data.d.scudo_region_info;
      process_info->scudo_ring_buffer = crash_info->data.d.scudo_ring_buffer;
      process_info->scudo_ring_buffer_size = crash_info->data.d.scudo_ring_buffer_size;
      FALLTHROUGH_INTENDED;
    case 1:
    case 2:
+1 −0
Original line number Diff line number Diff line
@@ -392,6 +392,7 @@ static int debuggerd_dispatch_pseudothread(void* arg) {
    ASSERT_SAME_OFFSET(scudo_stack_depot, scudo_stack_depot);
    ASSERT_SAME_OFFSET(scudo_region_info, scudo_region_info);
    ASSERT_SAME_OFFSET(scudo_ring_buffer, scudo_ring_buffer);
    ASSERT_SAME_OFFSET(scudo_ring_buffer_size, scudo_ring_buffer_size);
#undef ASSERT_SAME_OFFSET

    iovs[3] = {.iov_base = &thread_info->process_info,
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ struct debugger_process_info {
  const char* scudo_stack_depot;
  const char* scudo_region_info;
  const char* scudo_ring_buffer;
  size_t scudo_ring_buffer_size;
};

// These callbacks are called in a signal handler, and thus must be async signal safe.
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ struct ProcessInfo {
  uintptr_t scudo_stack_depot = 0;
  uintptr_t scudo_region_info = 0;
  uintptr_t scudo_ring_buffer = 0;
  size_t scudo_ring_buffer_size = 0;

  bool has_fault_address = false;
  uintptr_t untagged_fault_address = 0;
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ ScudoCrashData::ScudoCrashData(unwindstack::Memory* process_memory,
  auto region_info = AllocAndReadFully(process_memory, process_info.scudo_region_info,
                                       __scudo_get_region_info_size());
  auto ring_buffer = AllocAndReadFully(process_memory, process_info.scudo_ring_buffer,
                                       __scudo_get_ring_buffer_size());
                                       process_info.scudo_ring_buffer_size);
  if (!stack_depot || !region_info || !ring_buffer) {
    return;
  }
Loading