Commit graph

48083 commits

Author SHA1 Message Date
Tom Cherry
d52a5b3c10 init: simplify keyword_map
I've heard that keyword_map is too complex, in particular the tuple
and the pair in BuiltinFunctionMap, so this change removes a lot of
that complexity and, more importantly, better documents how all of
this works.

Test: boot, init unit tests

Change-Id: I74e5f9de7f2ec524cb6127bb9da2956b5f307f56
2019-07-23 14:39:38 -07:00
Christopher Ferris
b3fc1b7441 Merge "Remove demangle, everyone use libc++ demangle." 2019-07-22 19:43:21 +00:00
Treehugger Robot
44e343837f Merge "Add wchan data to ANR dump" 2019-07-20 16:40:54 +00:00
Tianjie Xu
cccb573f93 Merge "init: Write the reason in BCB on "reboot recovery"" 2019-07-20 05:03:41 +00:00
Christopher Ferris
df7939a26c Remove demangle, everyone use libc++ demangle.
Bug: 136138882

Test: Builds.
Change-Id: I7575871e26fac36e4946588784fff165c7df47bf
2019-07-19 16:15:52 -07:00
Christopher Ferris
89bb586d52 Merge "Move to the libc++ demangler." 2019-07-19 22:48:37 +00:00
Tianjie Xu
5e98b633a7 init: Write the reason in BCB on "reboot recovery"
Without this change "adb reboot recovery" leads to normal boot.

Bug: 137523800
Test: peform factory reset, adb reboot recovery
Change-Id: Ie791c8107d3434bf4ae6f5785b24e7d97921a7a9
2019-07-19 13:02:59 -07:00
Treehugger Robot
0b7dd9f40d Merge "Fix darwin build" 2019-07-19 16:32:06 +00:00
Treehugger Robot
879415f6c0 Merge "Revert "Revert "add unittests for libnativeloader""" 2019-07-19 11:43:57 +00:00
Treehugger Robot
85bbbe5695 Merge "Revert "init: Write the reason in BCB on "reboot recovery""" 2019-07-19 05:34:43 +00:00
Treehugger Robot
18545d3852 Merge "Replace xargs with other shell command" 2019-07-19 01:20:15 +00:00
Christopher Ferris
4ec93a7ee5 Move to the libc++ demangler.
Bug: 136138882

Test: Unit tests pass.
Test: Did a kill -3 on a zygote process to verify art demangles properly.
Change-Id: Iaf4fab191e84871be906b39cc32dd7c97c5d385a
2019-07-18 17:57:04 -07:00
Jiyong Park
78cc06a22e Revert "Revert "add unittests for libnativeloader""
This reverts commit 4ec2b28983.

Bug: 137881576
Bug: 130388701
Test: libnativeloader_test
Test: m libnativeloader_test on full-eng
Change-Id: Ib96f7235845b68cde713af278313c5aa751ff738
2019-07-19 09:03:55 +09:00
Colin Cross
3defd5237f Fix darwin build
Disable host libmeminfo and showmap when building on darwin.

Test: m on darwin
Change-Id: Ie9342eff8d9e33c706edbb068d4ec405b480e599
2019-07-18 16:25:15 -07:00
Kalesh Singh
1489e27bda Add wchan data to ANR dump
Since only privileged processes with CAP_SYS_ADMIN can read kernel
stack traces from /proc/*/stack, we dump the waiting channels
instead to provide some insight as to where the process might
be stuck in the kernel.

Bug: 135458700
Fixes: 135458700
Test: adb shell am hang; Check /data/anr/<anr-file> for
      wchan data.
Change-Id: I9f13511ad89a259ce5e5465155db15d45d2c46d8
2019-07-18 16:02:57 -07:00
David Anderson
45a1c998d1 Merge "Add a metadata folder for libsnapshot." 2019-07-18 22:42:13 +00:00
David Anderson
3dcb41b224 Merge "Sketch out libsnapshot for update_engine integration." 2019-07-18 22:42:13 +00:00
Raman Tenneti
80fa85c594 Merge "Revert "add unittests for libnativeloader"" 2019-07-18 21:50:31 +00:00
Raman Tenneti
4ec2b28983 Revert "add unittests for libnativeloader"
This reverts commit 6b6437bab5.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ice571bf7379743d516e0185fd9f1f0ffb284240a
2019-07-18 21:48:36 +00:00
Treehugger Robot
ce813ef66f Merge "add unittests for libnativeloader" 2019-07-18 21:14:23 +00:00
Christopher Ferris
604ccb147c Merge "Move to isolated testing." 2019-07-18 19:00:46 +00:00
Christopher Ferris
bcc00c5c8f Merge "Add cause message when stack overflow is detected." 2019-07-18 18:55:46 +00:00
Tianjie Xu
137943d31b Revert "init: Write the reason in BCB on "reboot recovery""
This reverts commit 4d35f2e59c.

Reason for revert: b/137523800 This breaks factory reset on all devices (and potentially rescue party and non-ab updates). Because the init code unconditionally clear the arguments like "--wipe_data" written by framework; as a result, device boots into recovery without doing wipe. 

I guess one fix is to check the content of BCB, and skip the overwrite if it already boots into recovery. Revert the cl first to unblock p1, will submit the fix separately.

Change-Id: Iccaf3dce6999005c2199490a138844d5a5d99e7f
2019-07-18 11:42:14 -07:00
Kiyoung Kim
95d55818a4 Replace xargs with other shell command
Recently Android build team changed environment to use prebuilt toybox
binaries for common tools (aosp/852849). However, as toybox xargs does
not support -I option, update_and_install_ld_config.mk started to fail
filtering out private vndk libraries from the list. To resolve this,
xargs usages are replaced with other shell command (read).

Bug: 137832162
Test: m -j && tested on Cuttlefish
Change-Id: I218ce6272c781f826b87c8efc0d3c77bf6bc3af5
2019-07-18 20:30:44 +09:00
Martijn Coenen
3f2d17632e Merge "Ignore class_{reset|start}_post_data on non-updatable APEX." 2019-07-18 07:51:51 +00:00
Jiyong Park
6b6437bab5 add unittests for libnativeloader
libnativeloader hasn't had a unit test. Now we have it. The unittest
mocks calls to libdl, libbridgedloader, and JNI using gmock.

Not all tests are added yet. To ease the review, a few tests for core
scenarios are added.

Bug: 130388701
Test: libnativeloader_test

Change-Id: I518512047da66b44bc99cec26e2c34ba4985cca3
2019-07-18 16:04:55 +09:00
David Anderson
8a0f82fefa Sketch out libsnapshot for update_engine integration.
This is a skeleton API so we can begin implementing both libsnapshot and
the relevant changes in update_engine.

Bug: 136678799
Test: builds
Change-Id: I5dc0fc1f401e94da2b5996cd69ab4076847282a4
2019-07-17 20:30:51 -07:00
David Anderson
001747e890 Add a metadata folder for libsnapshot.
/metadata/ota will store the update state ("none", "applying",
"booting", "merging") for each dynamic partition. The data will be
managed by libsnapshot, whose primary consumer will be update_engine
but will also be available to recovery/fastbootd.

Bug: 136678799
Test: /metadata/ota exists
Change-Id: I3e06484cafeb363904914767abc8984adaa37021
2019-07-17 19:17:27 -07:00
Christopher Ferris
ea8e7d10d7 Move to isolated testing.
Modify the MapInfoCreateMemoryTest to work in the isolated mode.

Test: Ran unit tests on host/target.
Change-Id: I84e01d96e852acd813e0f203b4a207cfaf8ca556
2019-07-17 18:08:32 -07:00
Christopher Ferris
19b24bada5 Merge "Move to the libc++ demangler." 2019-07-18 00:19:37 +00:00
Mathieu Chartier
856544f8b1 Merge "Re-make showmap host supported" 2019-07-17 23:50:05 +00:00
Christopher Ferris
481e8379d3 Add cause message when stack overflow is detected.
Test: Ran new unit tests.
Test: Ran crasher stack-overflow, crasher64 stack-overflow and verified
Test: stack overflow cause is shown.
Test: Ran stack overflow app and verified tombstone includes stack-overflow
Test: message.
Change-Id: I9bb01186dff5ed81c77d84b6aaedb5332ddd7256
2019-07-17 14:14:26 -07:00
Christopher Ferris
a74aae8033 Move to the libc++ demangler.
The previous versions of the libc++ demangler crashed on bad input.
However, the new version passes a fuzzer and has a lot of tests. Since
it's more complete than the local demangler, use it instead.

Modified the expected output of an offline test since the new demangler
handles a case that didn't work before.

Verified that the time it takes for the check_for_leak tests did not
change after this.

Bug: 136138882

Test: Ran the unit tests.
Test: Verified the __cxa_demangle function passes the fuzzer when run for
Test: hours. Both the 32 bit and 64 bit version of __cxa_demangle were
Test: fuzzed using external/libcxxabi/fuzz.
Change-Id: I10c06b589d57c36d89dbecba020b1ef2da69634a
2019-07-17 13:49:37 -07:00
Mathieu Chartier
c0c28faa97 Re-make showmap host supported
Also fix bugs that made it not compile on host. Motivation is to be
able to analyze smaps files easily on the host.

Test: showmap -f maps.txt
Bug: 137034556

Change-Id: I7b8ca1237ce1ec17d02cd5217c73b62ee978cb05
2019-07-17 12:28:27 -07:00
Treehugger Robot
97c06703f6 Merge "Remove perfprofd reference." 2019-07-17 18:30:37 +00:00
Josh Gao
1f1a0009fc Merge changes I35f8843e,Icd2a94f8,I6c20f3b3
* changes:
  adb: win32: don't shutdown socket when closing.
  adb: win32: silence wine test failure.
  adb: win32: fix adb_test.
2019-07-17 18:04:29 +00:00
Treehugger Robot
6b924d5a97 Merge "libutils: RefBase remove 'basetype' typedefs" 2019-07-17 17:49:28 +00:00
Elliott Hughes
ffaabf54ba Remove perfprofd reference.
Dead and gone.

Test: treehugger
Change-Id: I8c08cada5313ddede5ebb4973d61cef2bb8a0a7e
2019-07-17 08:17:44 -07:00
Martijn Coenen
728586f5b2 Ignore class_{reset|start}_post_data on non-updatable APEX.
For devices that use FDE and don't support updatable APEXes, don't
stop and restart all processes - there is no need and it only increases
boot time for these devices.

Additionally, some daemons have never been restarted in the past, and
restarting them exposes certain issues.

Bug: 137251597
Bug: 136777273
Bug: 135627804
Test: verified manually w/ ro.updatable.apex=false
Change-Id: I9590f2c2cdfab0a49f39846896460305d44221ee
2019-07-17 08:49:44 +02:00
Tri Vo
e75c6c841b Merge "Set /sys/power/wake_lock permissions on init." 2019-07-17 01:30:45 +00:00
Josh Gao
08bd13eb3d adb: win32: don't shutdown socket when closing.
This appears to be an attempt to do orderly shutdown, but it doesn't
wait until the socket becomes readable, so it doesn't actually work. We
implement orderly shutdown elsewhere already, so delete this so that we
don't accidentally shutdown a duped socket.

Test: wine adb_test
Change-Id: I35f8843e8e6dbc7886fd545f0e43375a005e160f
2019-07-16 15:22:58 -07:00
Josh Gao
2ad4c3696f adb: win32: silence wine test failure.
Wine implements sockets with their own internal socketpair, which
results in the poll disconnect test failing.

Bug: http://b/117568356
Test: wine adb_test.exe
Change-Id: Icd2a94f8297fefd5c02e6517568fe288b168032c
2019-07-16 15:22:51 -07:00
Josh Gao
efd8ae2d54 adb: win32: fix adb_test.
At some point between Q and master, adb_test.exe stopped working because
it wasn't being linked with -municode?

Test: wine adb_test.exe
Change-Id: I6c20f3b3241cee2052d31d1ca85b8a9738828f6e
2019-07-16 15:21:59 -07:00
Tri Vo
c6a84e873b Set /sys/power/wake_lock permissions on init.
system_suspend need to be an early_hal as it's required before storage
encryption can get unlock on FDE devices.

/sys/power/wake_lock is a dependency of system_suspend (only in Q and
earlier). Permissions on this file need to be set early enough.

Bug: 136777986
Bug: 133175847
Test: boot blueline
Change-Id: I8a9d3374b327e451fb98d2279d1bac9477a9560d
2019-07-16 14:33:00 -07:00
Steven Moreland
18daa7b5f0 libutils: RefBase remove 'basetype' typedefs
useless/unused

Bug: N/A
Test: N/A
Change-Id: I72462a64411a58d22e071f20e2c950bd99fdffb1
2019-07-16 21:06:28 +00:00
David Anderson
eb599db1c5 Merge "Revert "Revert "Remove libfiemap_writer from fs_mgr and move it to gsid.""" 2019-07-16 19:03:09 +00:00
David Anderson
974dadf904 Merge "libdm: Fix race conditions in LoopControl::Attach." 2019-07-16 19:03:09 +00:00
Treehugger Robot
8987f061c4 Merge "Add nolint for implicit borrowed_fd constructors" 2019-07-16 04:11:20 +00:00
Treehugger Robot
a19f51eccc Merge "Reserve 'init'." 2019-07-16 02:35:29 +00:00
Treehugger Robot
100e8ffbcd Merge "Remove obsolete subdirs entry." 2019-07-16 02:02:40 +00:00