diff options
author | David Srbecky <dsrbecky@google.com> | 2018-02-23 18:06:13 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2019-03-29 14:01:32 +0000 |
commit | 85b5fecec920208ec43b42488f08d4c2e5aaeda2 (patch) | |
tree | f247629aaf617cc5fc287cf3eb2e6f076f6a635d /debuggerd/handler/debuggerd_fallback.cpp | |
parent | e346d03c2bf198ab25e926bc2c26dd9db53b87ba (diff) |
Check for data races when reading JIT/DEX entries.
Update the entries only when the list is modified by the runtime.
Check that the list wasn't concurrently modified when being read.
Bug: 124287208
Test: libunwindstack_test
Test: art/test.py -b --host -r -t 137-cfi
Change-Id: I87ba70322053a01b3d5be1fdf6310e1dc21bb084
Diffstat (limited to 'debuggerd/handler/debuggerd_fallback.cpp')
-rw-r--r-- | debuggerd/handler/debuggerd_fallback.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/debuggerd/handler/debuggerd_fallback.cpp b/debuggerd/handler/debuggerd_fallback.cpp index bbec612a8..5f7ebc34c 100644 --- a/debuggerd/handler/debuggerd_fallback.cpp +++ b/debuggerd/handler/debuggerd_fallback.cpp @@ -42,7 +42,6 @@ #include <android-base/file.h> #include <android-base/unique_fd.h> #include <async_safe/log.h> -#include <unwindstack/DexFiles.h> #include <unwindstack/JitDebug.h> #include <unwindstack/Maps.h> #include <unwindstack/Memory.h> @@ -81,12 +80,12 @@ static void debuggerd_fallback_trace(int output_fd, ucontext_t* ucontext) { thread.pid = getpid(); thread.tid = gettid(); thread.thread_name = get_thread_name(gettid()); - unwindstack::ArchEnum arch = unwindstack::Regs::CurrentArch(); - thread.registers.reset(unwindstack::Regs::CreateFromUcontext(arch, ucontext)); + thread.registers.reset( + unwindstack::Regs::CreateFromUcontext(unwindstack::Regs::CurrentArch(), ucontext)); // TODO: Create this once and store it in a global? unwindstack::UnwinderFromPid unwinder(kMaxFrames, getpid()); - if (unwinder.Init(arch)) { + if (unwinder.Init()) { dump_backtrace_thread(output_fd, &unwinder, thread); } else { async_safe_format_log(ANDROID_LOG_ERROR, "libc", "Unable to init unwinder."); |