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

Commit 671dfc10 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9794275 from a3d74369 to udc-release

Change-Id: I7df31424734bcc16f345193ca3b55d8abd5f3497
parents a589bec2 a3d74369
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -368,6 +368,7 @@ cc_binary {
    name: "crash_dump",
    srcs: [
        "crash_dump.cpp",
        "tombstone_handler.cpp",
        "util.cpp",
    ],
    defaults: ["debuggerd_defaults"],
@@ -509,6 +510,9 @@ prebuilt_etc {
        arm64: {
            src: "seccomp_policy/crash_dump.arm.policy",
        },
        riscv64: {
            enabled: false,
        },
        x86: {
            src: "seccomp_policy/crash_dump.x86_64.policy",
        },
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
    },
    {
      "name": "libtombstoned_client_rust_test"
    },
    {
      "name": "MicrodroidHostTestCases"
    }
  ],
  "hwasan-presubmit": [
+7 −6
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
#include "libdebuggerd/utility.h"

#include "debuggerd/handler.h"
#include "tombstoned/tombstoned.h"
#include "tombstone_handler.h"

#include "protocol.h"
#include "util.h"
@@ -215,8 +215,8 @@ static void Initialize(char** argv) {
    // If we abort before we get an output fd, contact tombstoned to let any
    // potential listeners know that we failed.
    if (!g_tombstoned_connected) {
      if (!tombstoned_connect(g_target_thread, &g_tombstoned_socket, &g_output_fd, &g_proto_fd,
                              kDebuggerdAnyIntercept)) {
      if (!connect_tombstone_server(g_target_thread, &g_tombstoned_socket, &g_output_fd,
                                    &g_proto_fd, kDebuggerdAnyIntercept)) {
        // We failed to connect, not much we can do.
        LOG(ERROR) << "failed to connected to tombstoned to report failure";
        _exit(1);
@@ -589,8 +589,8 @@ int main(int argc, char** argv) {
  {
    ATRACE_NAME("tombstoned_connect");
    LOG(INFO) << "obtaining output fd from tombstoned, type: " << dump_type;
    g_tombstoned_connected = tombstoned_connect(g_target_thread, &g_tombstoned_socket, &g_output_fd,
                                                &g_proto_fd, dump_type);
    g_tombstoned_connected = connect_tombstone_server(g_target_thread, &g_tombstoned_socket,
                                                      &g_output_fd, &g_proto_fd, dump_type);
  }

  if (g_tombstoned_connected) {
@@ -673,7 +673,8 @@ int main(int argc, char** argv) {

  // Close stdout before we notify tombstoned of completion.
  close(STDOUT_FILENO);
  if (g_tombstoned_connected && !tombstoned_notify_completion(g_tombstoned_socket.get())) {
  if (g_tombstoned_connected &&
      !notify_completion(g_tombstoned_socket.get(), g_output_fd.get(), g_proto_fd.get())) {
    LOG(ERROR) << "failed to notify tombstoned of completion";
  }

+32 −33
Original line number Diff line number Diff line
@@ -6,39 +6,38 @@ crash1:
	sd ra, 8(sp)
	.cfi_offset ra, -8

	li	x0,0xdead0000+0
	li	x1,0xdead0000+1
	li	x2,0xdead0000+2
	li	x3,0xdead0000+3
	li	x4,0xdead0000+4
	li	x5,0xdead0000+5
	li	x6,0xdead0000+6
	li	x7,0xdead0000+7
	li	x8,0xdead0000+8
	li	x9,0xdead0000+9
	li	x10,0xdead0000+10
	li	x11,0xdead0000+11
	li	x12,0xdead0000+12
	li	x13,0xdead0000+13
	li	x14,0xdead0000+14
	li	x15,0xdead0000+15
	li	x16,0xdead0000+16
	li	x17,0xdead0000+17
	li	x18,0xdead0000+18
	li	x19,0xdead0000+19
	li	x20,0xdead0000+20
	li	x21,0xdead0000+21
	li	x22,0xdead0000+22
	li	x23,0xdead0000+23
	li	x24,0xdead0000+24
	li	x25,0xdead0000+25
	li	x26,0xdead0000+26
	li	x27,0xdead0000+27
	li	x28,0xdead0000+28
	# don't trash the stack otherwise the signal handler won't run
	#li	x29,0xdead0000+29
	li	x30,0xdead0000+30
	li	x31,0xdead0000+31
	li	x0,0xa5a50000
	li	x1,0xa5a50001
	li	x2,0xa5a50002
	li	x3,0xa5a50003
	li	x4,0xa5a50004
	li	x5,0xa5a50005
	li	x6,0xa5a50006
	li	x7,0xa5a50007
	li	x8,0xa5a50008
	li	x9,0xa5a50009
	li	x10,0xa5a50010
	li	x11,0xa5a50011
	li	x12,0xa5a50012
	li	x13,0xa5a50013
	li	x14,0xa5a50014
	li	x15,0xa5a50015
	li	x16,0xa5a50016
	li	x17,0xa5a50017
	li	x18,0xa5a50018
	li	x19,0xa5a50019
	li	x20,0xa5a50020
	li	x21,0xa5a50021
	li	x22,0xa5a50022
	li	x23,0xa5a50023
	li	x24,0xa5a50024
	li	x25,0xa5a50025
	li	x26,0xa5a50026
	li	x27,0xa5a50027
	li	x28,0xa5a50028
	li	x29,0xa5a50029
	li	x30,0xa5a50030
	li	x31,0xa5a50031

	li sp, 0
	ld t2, 0(zero)
+19 −12
Original line number Diff line number Diff line
@@ -2437,35 +2437,42 @@ TEST_F(CrasherTest, verify_dex_pc_with_function_name) {
#if defined(__arm__)
    asm volatile(
        "mov r1, %[base]\n"
        "mov r2, 0\n"
        "str r3, [r2]\n"
        "mov r2, #0\n"
        "str r2, [r2]\n"
        : [base] "+r"(ptr)
        :
        : "r1", "r2", "r3", "memory");
        : "r1", "r2", "memory");
#elif defined(__aarch64__)
    asm volatile(
        "mov x1, %[base]\n"
        "mov x2, 0\n"
        "str x3, [x2]\n"
        "mov x2, #0\n"
        "str xzr, [x2]\n"
        : [base] "+r"(ptr)
        :
        : "x1", "x2", "x3", "memory");
        : "x1", "x2", "memory");
#elif defined(__riscv)
    // TODO: x1 is ra (the link register) on riscv64, so this might have
    // unintended consequences, but we'll need to change the .cfi_escape if so.
    asm volatile(
        "mv x1, %[base]\n"
        "sw zero, 0(zero)\n"
        : [base] "+r"(ptr)
        :
        : "x1", "memory");
#elif defined(__i386__)
    asm volatile(
        "mov %[base], %%ecx\n"
        "movl $0, %%edi\n"
        "movl 0(%%edi), %%edx\n"
        "movl $0, 0\n"
        : [base] "+r"(ptr)
        :
        : "edi", "ecx", "edx", "memory");
        : "ecx", "memory");
#elif defined(__x86_64__)
    asm volatile(
        "mov %[base], %%rdx\n"
        "movq 0, %%rdi\n"
        "movq 0(%%rdi), %%rcx\n"
        "movq $0, 0\n"
        : [base] "+r"(ptr)
        :
        : "rcx", "rdx", "rdi", "memory");
        : "rdx", "memory");
#else
#error "Unsupported architecture"
#endif
Loading