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

Commit 4d03a384 authored by David Srbecky's avatar David Srbecky Committed by android-build-merger
Browse files

Merge "Check for data races when reading JIT/DEX entries." am: 59c70a5b

am: 93634859

Change-Id: If702c873330b09020dd701f5e786a03ca4d28ac0
parents 0a2e8e94 93634859
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
#define ATRACE_TAG ATRACE_TAG_BIONIC
#include <utils/Trace.h>

#include <unwindstack/DexFiles.h>
#include <unwindstack/JitDebug.h>
#include <unwindstack/Maps.h>
#include <unwindstack/Memory.h>
@@ -567,7 +566,7 @@ int main(int argc, char** argv) {

  // TODO: Use seccomp to lock ourselves down.
  unwindstack::UnwinderFromPid unwinder(256, vm_pid);
  if (!unwinder.Init(unwindstack::Regs::CurrentArch())) {
  if (!unwinder.Init()) {
    LOG(FATAL) << "Failed to init unwinder object.";
  }

+3 −4
Original line number Diff line number Diff line
@@ -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.");
+1 −2
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@
#include <log/log.h>
#include <log/logprint.h>
#include <private/android_filesystem_config.h>
#include <unwindstack/DexFiles.h>
#include <unwindstack/JitDebug.h>
#include <unwindstack/Maps.h>
#include <unwindstack/Memory.h>
@@ -650,7 +649,7 @@ void engrave_tombstone_ucontext(int tombstone_fd, uint64_t abort_msg_address, si
  };

  unwindstack::UnwinderFromPid unwinder(kMaxFrames, pid);
  if (!unwinder.Init(unwindstack::Regs::CurrentArch())) {
  if (!unwinder.Init()) {
    LOG(FATAL) << "Failed to init unwinder object.";
  }

+0 −11
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@
#include <unwindstack/Regs.h>
#include <unwindstack/RegsGetLocal.h>

#if !defined(NO_LIBDEXFILE_SUPPORT)
#include <unwindstack/DexFiles.h>
#endif
#include <unwindstack/Unwinder.h>

#include "BacktraceLog.h"
@@ -50,14 +47,6 @@ bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
                                 regs, stack_map->process_memory());
  unwinder.SetResolveNames(stack_map->ResolveNames());
  stack_map->SetArch(regs->Arch());
  if (stack_map->GetJitDebug() != nullptr) {
    unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch());
  }
#if !defined(NO_LIBDEXFILE_SUPPORT)
  if (stack_map->GetDexFiles() != nullptr) {
    unwinder.SetDexFiles(stack_map->GetDexFiles(), regs->Arch());
  }
#endif
  unwinder.Unwind(skip_names, &stack_map->GetSuffixesToIgnore());
  if (error != nullptr) {
    switch (unwinder.LastErrorCode()) {
+0 −7
Original line number Diff line number Diff line
@@ -43,13 +43,6 @@ bool UnwindStackMap::Build() {
  // Create the process memory object.
  process_memory_ = unwindstack::Memory::CreateProcessMemory(pid_);

  // Create a JitDebug object for getting jit unwind information.
  std::vector<std::string> search_libs_{"libart.so", "libartd.so"};
  jit_debug_.reset(new unwindstack::JitDebug(process_memory_, search_libs_));
#if !defined(NO_LIBDEXFILE_SUPPORT)
  dex_files_.reset(new unwindstack::DexFiles(process_memory_, search_libs_));
#endif

  if (!stack_maps_->Parse()) {
    return false;
  }
Loading