Skip to content

Commit

Permalink
Merge tag 'android-14.0.0_r29' into staging/lineage-21.0_merge-androi…
Browse files Browse the repository at this point in the history
…d-14.0.0_r29

Android 14.0.0 release 29

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZeZW5wAKCRDorT+BmrEO
# eEwSAJ47w4AahQ9gy0/YRYxV/Iudu9sNNgCdGNZA2y1a9r2I8sC8pzBhUiUR68c=
# =5AtG
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Mar  5 01:19:03 2024 EET
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <[email protected]>" [marginal]
# gpg: [email protected]: Verified 2364 signatures in the past
#      2 years.  Encrypted 4 messages in the past 2 years.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By David Anderson (107) and others
# Via Automerger Merge Worker (3820) and others
* tag 'android-14.0.0_r29': (594 commits)
  Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
  Revert "task_profiles.json: Set io.prio.class"
  Revert "Migrate the blkio controller to the v2 cgroup hierarchy"
  Revert "task_profiles.json: Set io.prio.class"
  Disable DSU in recovery mode
  Use correct stack depot size in __scudo_get_error
  libsnapshot: skip connecting to daemon for legacy VAB
  Revert "snapuserd: opt out of Global ThinLTO to workaround segfault"
  healthd: Add handling for "Calibration required" battery health.
  healthd: Add support for the new Health HAL v3 properties.
  fastboot: Add getvar commands to query battery part info.
  Update fastbootd to use Health AIDL HAL V3.
  Update healthd to use Health AIDL HAL V3.
  Update storaged to use Health AIDL HAL V3.
  fastboot: fix network connected device status
  Revert "libprocessgroup: Poll on cgroup.events"
  Revert "libprocessgroup: Use cgroup.kill"
  Revert "Revert "Calculate ro.vendor.api_level with the new vendo..."
  Introduce libutils_binder_sdk
  trusty: apploader: fail specifically if app package is 0 bytes
  ...

 Conflicts:
	fastboot/fastboot.cpp
	libdiskconfig/Android.bp
	libsparse/Android.bp

Change-Id: Icc161fdb8a933b98ddf263423fcc41260ce5397a
  • Loading branch information
mikeNG committed Mar 9, 2024
2 parents bb90095 + 5dfa67b commit 6f626a5
Show file tree
Hide file tree
Showing 602 changed files with 27,268 additions and 15,058 deletions.
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Bug component: 128577
[email protected]
3 changes: 0 additions & 3 deletions bootstat/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ cc_binary {
],
init_rc: ["bootstat.rc"],
product_variables: {
pdk: {
enabled: false,
},
debuggable: {
init_rc: ["bootstat-debug.rc"],
},
Expand Down
10 changes: 10 additions & 0 deletions bootstat/bootstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ const std::map<std::string, int32_t> kBootReasonMap = {
{"reboot,sys_ldo_ok,pmic,main", 227},
{"reboot,sys_ldo_ok,pmic,sub", 228},
{"reboot,smpl_timeout,pmic,main", 229},
{"reboot,ota,.*", 230},
{"reboot,periodic,.*", 231},
{"reboot,early,abl", 232},
{"reboot,early,bl2", 233},
{"reboot,longkey,pmic_cold", 234},
{"reboot,longkey,master_dc", 235},
{"reboot,ocp2,pmic,if", 236},
{"reboot,ocp,pmic,if", 237},
{"reboot,fship", 238},
{"reboot,ocp,.*", 239},
};

// Converts a string value representing the reason the system booted to an
Expand Down
57 changes: 52 additions & 5 deletions debuggerd/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cc_defaults {
"-Wno-unused-argument",
"-Wno-unused-function",
"-Wno-nullability-completeness",
"-Wno-reorder-init-list",
"-Os",
"-fno-finite-loops",
"-DANDROID_DEBUGGABLE=0",
Expand Down Expand Up @@ -185,9 +186,45 @@ cc_library {
export_include_dirs: ["include"],
}

cc_library {
name: "libdebuggerd_tombstone_proto_to_text",
defaults: ["debuggerd_defaults"],
ramdisk_available: true,
recovery_available: true,
vendor_ramdisk_available: true,

local_include_dirs: ["libdebuggerd/include"],
export_include_dirs: ["libdebuggerd/include"],

srcs: [
"libdebuggerd/tombstone_proto_to_text.cpp",
],

header_libs: [
"bionic_libc_platform_headers",
],

static_libs: [
"libbase",
"liblog_for_runtime_apex",
"libunwindstack",
],

whole_static_libs: [
"libtombstone_proto",
"libprotobuf-cpp-lite",
],

apex_available: [
"//apex_available:platform",
"com.android.runtime",
],
}

cc_library_static {
name: "libdebuggerd",
defaults: ["debuggerd_defaults"],
ramdisk_available: true,
recovery_available: true,
vendor_ramdisk_available: true,

Expand All @@ -197,7 +234,6 @@ cc_library_static {
"libdebuggerd/open_files_list.cpp",
"libdebuggerd/tombstone.cpp",
"libdebuggerd/tombstone_proto.cpp",
"libdebuggerd/tombstone_proto_to_text.cpp",
"libdebuggerd/utility.cpp",
],

Expand All @@ -221,11 +257,9 @@ cc_library_static {
"libbase",
"libcutils",
],
runtime_libs: [
"libdexfile", // libdexfile_support dependency
],

whole_static_libs: [
"libdebuggerd_tombstone_proto_to_text",
"libasync_safe",
"gwp_asan_crash_handler",
"libtombstone_proto",
Expand All @@ -250,6 +284,19 @@ cc_library_static {
"libdexfile",
],
},
ramdisk: {
exclude_static_libs: [
"libdexfile_support",
],
exclude_runtime_libs: [
"libdexfile",
],
},
android: {
runtime_libs: [
"libdexfile", // libdexfile_support dependency
],
},
},

product_variables: {
Expand Down Expand Up @@ -297,7 +344,7 @@ cc_test {
"libdebuggerd/test/elf_fake.cpp",
"libdebuggerd/test/log_fake.cpp",
"libdebuggerd/test/open_files_list_test.cpp",
"libdebuggerd/test/utility_test.cpp",
"libdebuggerd/test/tombstone_proto_to_text_test.cpp",
],

target: {
Expand Down
7 changes: 7 additions & 0 deletions debuggerd/client/debuggerd_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int
return false;
}

// WARNING: It's not possible to replace the below with a splice call.
// Due to the way debuggerd does many small writes across the pipe,
// this would cause splice to copy a page for each write. The second
// pipe fills up based on the number of pages being copied, even
// though there is not much data being transferred per page. When
// the second pipe is full, everything stops since there is nothing
// reading the second pipe to clear it.
char buf[1024];
rc = TEMP_FAILURE_RETRY(read(pipe_read.get(), buf, sizeof(buf)));
if (rc == 0) {
Expand Down
30 changes: 20 additions & 10 deletions debuggerd/client/debuggerd_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <fcntl.h>
#include <stdio.h>
#include <sys/eventfd.h>
#include <unistd.h>

#include <chrono>
Expand Down Expand Up @@ -51,23 +52,35 @@ static int getThreadCount() {

TEST(debuggerd_client, race) {
static int THREAD_COUNT = getThreadCount();
pid_t forkpid = fork();

ASSERT_NE(-1, forkpid);
// Semaphore incremented once per thread started.
unique_fd barrier(eventfd(0, EFD_SEMAPHORE));
ASSERT_NE(-1, barrier.get());

pid_t forkpid = fork();
ASSERT_NE(-1, forkpid);
if (forkpid == 0) {
// Spawn a bunch of threads, to make crash_dump take longer.
std::vector<std::thread> threads;
threads.reserve(THREAD_COUNT);
for (int i = 0; i < THREAD_COUNT; ++i) {
threads.emplace_back([]() {
while (true) {
std::this_thread::sleep_for(60s);
threads.emplace_back([&barrier]() {
uint64_t count = 1;
ASSERT_NE(-1, write(barrier.get(), &count, sizeof(count)));
for (;;) {
pause();
}
});
}
for (;;) {
pause();
}
}

std::this_thread::sleep_for(60s);
exit(0);
// Wait for the child to spawn all of its threads.
for (int i = 0; i < THREAD_COUNT; ++i) {
uint64_t count;
ASSERT_NE(-1, read(barrier.get(), &count, sizeof(count)));
}

unique_fd pipe_read, pipe_write;
Expand All @@ -77,9 +90,6 @@ TEST(debuggerd_client, race) {
constexpr int PIPE_SIZE = 16 * 1024 * 1024;
ASSERT_EQ(PIPE_SIZE, fcntl(pipe_read.get(), F_SETPIPE_SZ, PIPE_SIZE));

// Wait for a bit to let the child spawn all of its threads.
std::this_thread::sleep_for(1s);

ASSERT_TRUE(
debuggerd_trigger_dump(forkpid, kDebuggerdNativeBacktrace, 60000, std::move(pipe_write)));
// Immediately kill the forked child, to make sure that the dump didn't return early.
Expand Down
24 changes: 11 additions & 13 deletions debuggerd/common/include/dump_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,24 @@ enum DebuggerdDumpType : uint8_t {
kDebuggerdTombstoneProto,
};

inline std::ostream& operator<<(std::ostream& stream, const DebuggerdDumpType& rhs) {
switch (rhs) {
inline const char* get_dump_type_name(const DebuggerdDumpType& dump_type) {
switch (dump_type) {
case kDebuggerdNativeBacktrace:
stream << "kDebuggerdNativeBacktrace";
break;
return "kDebuggerdNativeBacktrace";
case kDebuggerdTombstone:
stream << "kDebuggerdTombstone";
break;
return "kDebuggerdTombstone";
case kDebuggerdJavaBacktrace:
stream << "kDebuggerdJavaBacktrace";
break;
return "kDebuggerdJavaBacktrace";
case kDebuggerdAnyIntercept:
stream << "kDebuggerdAnyIntercept";
break;
return "kDebuggerdAnyIntercept";
case kDebuggerdTombstoneProto:
stream << "kDebuggerdTombstoneProto";
break;
return "kDebuggerdTombstoneProto";
default:
stream << "[unknown]";
return "[unknown]";
}
}

inline std::ostream& operator<<(std::ostream& stream, const DebuggerdDumpType& rhs) {
stream << get_dump_type_name(rhs);
return stream;
}
1 change: 1 addition & 0 deletions debuggerd/crash_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ static void ReadCrashInfo(unique_fd& fd, siginfo_t* siginfo,
process_info->gwp_asan_state = crash_info->data.d.gwp_asan_state;
process_info->gwp_asan_metadata = crash_info->data.d.gwp_asan_metadata;
process_info->scudo_stack_depot = crash_info->data.d.scudo_stack_depot;
process_info->scudo_stack_depot_size = crash_info->data.d.scudo_stack_depot_size;
process_info->scudo_region_info = crash_info->data.d.scudo_region_info;
process_info->scudo_ring_buffer = crash_info->data.d.scudo_ring_buffer;
process_info->scudo_ring_buffer_size = crash_info->data.d.scudo_ring_buffer_size;
Expand Down
24 changes: 21 additions & 3 deletions debuggerd/crasher/arm/crashglue.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2006, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.globl crash1
.type crash1, %function
crash1:
Expand All @@ -23,10 +39,11 @@ crash1:
ldr lr, [lr]
b .
.cfi_endproc
.size crash1, .-crash1

.globl crashnostack
.type crashnostack, %function
crashnostack:
.globl crash_no_stack
.type crash_no_stack, %function
crash_no_stack:
.cfi_startproc
mov r1, sp
.cfi_def_cfa_register r1
Expand All @@ -35,3 +52,4 @@ crashnostack:
ldr r0, [r0]
b .
.cfi_endproc
.size crash_no_stack, .-crash_no_stack
61 changes: 58 additions & 3 deletions debuggerd/crasher/arm64/crashglue.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2013, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.globl crash1
.type crash1, %function
crash1:
Expand Down Expand Up @@ -41,11 +57,12 @@ crash1:
ldr x30, [x30]
b .
.cfi_endproc
.size crash1, .-crash1


.globl crashnostack
.type crashnostack, %function
crashnostack:
.globl crash_no_stack
.type crash_no_stack, %function
crash_no_stack:
.cfi_startproc
mov x1, sp
.cfi_def_cfa_register x1
Expand All @@ -54,3 +71,41 @@ crashnostack:
ldr x0, [x0]
b .
.cfi_endproc
.size crash_no_stack, .-crash_no_stack


.globl crash_bti
.type crash_bti, %function
crash_bti:
.cfi_startproc
adr x16, 1f
br x16
1: // Deliberatly not a bti instruction so we crash here.
b .
.cfi_endproc
.size crash_bti, .-crash_bti


.globl crash_pac
.type crash_pac, %function
crash_pac:
.cfi_startproc
paciasp
// Since sp is a pac input, this ensures a mismatch.
sub sp, sp, #16
autiasp
b .
.cfi_endproc
.size crash_pac, .-crash_pac

// Set the PAC and BTI bits for this object file.
.section .note.gnu.property, "a"
.balign 8
.long 4
.long 0x10
.long 0x5
.asciz "GNU"
.long 0xc0000000
.long 4
.long 0x3
.long 0
Loading

0 comments on commit 6f626a5

Please sign in to comment.