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

Commit 52cbc2a3 authored by Christopher Ferris's avatar Christopher Ferris Committed by Automerger Merge Worker
Browse files

Merge "Avoid thread cache in unwinder." am: 4c68e77b

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1737076

Change-Id: Iaf9b2732f22e6929093493202681ee9f7a8d5bf8
parents 06dce5e6 4c68e77b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -87,6 +87,12 @@ static void debuggerd_fallback_trace(int output_fd, ucontext_t* ucontext) {

    // TODO: Create this once and store it in a global?
    unwindstack::UnwinderFromPid unwinder(kMaxFrames, getpid());
    // Do not use the thread cache here because it will call pthread_key_create
    // which doesn't work in linker code. See b/189803009.
    // Use a normal cached object because the process is stopped, and there
    // is no chance of data changing between reads.
    auto process_memory = unwindstack::Memory::CreateProcessMemoryCached(getpid());
    unwinder.SetProcessMemory(process_memory);
    dump_backtrace_thread(output_fd, &unwinder, thread);
  }
  __linker_disable_fallback_allocator();