Loading debuggerd/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,12 @@ cc_binary { apex_available: [ "com.android.runtime", ], product_variables: { experimental_mte: { cflags: ["-DANDROID_EXPERIMENTAL_MTE"], }, }, } cc_binary { Loading debuggerd/crash_dump.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <bionic/mte_kernel.h> #include <bionic/reserved_signals.h> #include <cutils/sockets.h> #include <log/log.h> Loading Loading @@ -486,6 +487,17 @@ int main(int argc, char** argv) { continue; } #ifdef ANDROID_EXPERIMENTAL_MTE struct iovec iov = { &info.tagged_addr_ctrl, sizeof(info.tagged_addr_ctrl), }; if (ptrace(PTRACE_GETREGSET, thread, NT_ARM_TAGGED_ADDR_CTRL, reinterpret_cast<void*>(&iov)) == -1) { info.tagged_addr_ctrl = -1; } #endif if (thread == g_target_thread) { // Read the thread's registers along with the rest of the crash info out of the pipe. ReadCrashInfo(input_pipe, &siginfo, &info.registers, &process_info); Loading debuggerd/debuggerd_test.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,11 @@ TEST_F(CrasherTest, smoke) { std::string result; ConsumeFd(std::move(output_fd), &result); ASSERT_MATCH(result, R"(signal 11 \(SIGSEGV\), code 1 \(SEGV_MAPERR\), fault addr 0xdead)"); if (mte_supported()) { // Test that the default TAGGED_ADDR_CTRL value is set. ASSERT_MATCH(result, R"(tagged_addr_ctrl: 000000000007fff3)"); } } TEST_F(CrasherTest, tagged_fault_addr) { Loading debuggerd/libdebuggerd/include/libdebuggerd/types.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ struct ThreadInfo { std::unique_ptr<unwindstack::Regs> registers; long tagged_addr_ctrl = -1; pid_t uid; Loading debuggerd/libdebuggerd/tombstone.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) { _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", thread_info.pid, thread_info.tid, thread_info.thread_name.c_str(), thread_info.process_name.c_str()); _LOG(log, logtype::HEADER, "uid: %d\n", thread_info.uid); if (thread_info.tagged_addr_ctrl != -1) { _LOG(log, logtype::HEADER, "tagged_addr_ctrl: %016lx\n", thread_info.tagged_addr_ctrl); } } static std::string get_addr_string(uint64_t addr) { Loading Loading
debuggerd/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,12 @@ cc_binary { apex_available: [ "com.android.runtime", ], product_variables: { experimental_mte: { cflags: ["-DANDROID_EXPERIMENTAL_MTE"], }, }, } cc_binary { Loading
debuggerd/crash_dump.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <bionic/mte_kernel.h> #include <bionic/reserved_signals.h> #include <cutils/sockets.h> #include <log/log.h> Loading Loading @@ -486,6 +487,17 @@ int main(int argc, char** argv) { continue; } #ifdef ANDROID_EXPERIMENTAL_MTE struct iovec iov = { &info.tagged_addr_ctrl, sizeof(info.tagged_addr_ctrl), }; if (ptrace(PTRACE_GETREGSET, thread, NT_ARM_TAGGED_ADDR_CTRL, reinterpret_cast<void*>(&iov)) == -1) { info.tagged_addr_ctrl = -1; } #endif if (thread == g_target_thread) { // Read the thread's registers along with the rest of the crash info out of the pipe. ReadCrashInfo(input_pipe, &siginfo, &info.registers, &process_info); Loading
debuggerd/debuggerd_test.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,11 @@ TEST_F(CrasherTest, smoke) { std::string result; ConsumeFd(std::move(output_fd), &result); ASSERT_MATCH(result, R"(signal 11 \(SIGSEGV\), code 1 \(SEGV_MAPERR\), fault addr 0xdead)"); if (mte_supported()) { // Test that the default TAGGED_ADDR_CTRL value is set. ASSERT_MATCH(result, R"(tagged_addr_ctrl: 000000000007fff3)"); } } TEST_F(CrasherTest, tagged_fault_addr) { Loading
debuggerd/libdebuggerd/include/libdebuggerd/types.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ struct ThreadInfo { std::unique_ptr<unwindstack::Regs> registers; long tagged_addr_ctrl = -1; pid_t uid; Loading
debuggerd/libdebuggerd/tombstone.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) { _LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", thread_info.pid, thread_info.tid, thread_info.thread_name.c_str(), thread_info.process_name.c_str()); _LOG(log, logtype::HEADER, "uid: %d\n", thread_info.uid); if (thread_info.tagged_addr_ctrl != -1) { _LOG(log, logtype::HEADER, "tagged_addr_ctrl: %016lx\n", thread_info.tagged_addr_ctrl); } } static std::string get_addr_string(uint64_t addr) { Loading