From 72d0f9b6e7942e1366f0388c97864df864a82397 Mon Sep 17 00:00:00 2001 From: yidong zhang Date: Thu, 24 Jun 2021 17:51:56 +0800 Subject: [PATCH] Avoid using thread cache in unwinder. Using thread cache will cause SIGSEGV for 32bit+kernel4.9 device. Bug: 190579082 Bug: 189803009 Test: run cts -m CtsSeccompHostTestCases Change-Id: I47b13d02674aadbacd8dac36d8382eed0885413c Merged-In: I47b13d02674aadbacd8dac36d8382eed0885413c Signed-off-by: yidong zhang (cherry picked from commit cbf7c466e65eba2b285b28292a5e4934b6655c8a) --- debuggerd/libdebuggerd/tombstone.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp index ad903cee4..9c01f15eb 100644 --- a/debuggerd/libdebuggerd/tombstone.cpp +++ b/debuggerd/libdebuggerd/tombstone.cpp @@ -593,6 +593,9 @@ void engrave_tombstone_ucontext(int tombstone_fd, int proto_fd, uint64_t abort_m }; unwindstack::UnwinderFromPid unwinder(kMaxFrames, pid, unwindstack::Regs::CurrentArch()); + auto process_memory = + unwindstack::Memory::CreateProcessMemoryCached(getpid()); + unwinder.SetProcessMemory(process_memory); if (!unwinder.Init()) { async_safe_fatal("failed to init unwinder object"); }