Commit graph

38159 commits

Author SHA1 Message Date
Treehugger Robot
a281389bf4 Merge "Remove unreachable condition" 2018-03-02 00:48:42 +00:00
Tom Cherry
fe6cc42de4 Merge "Clean up property set error handling" 2018-03-01 22:54:24 +00:00
Yi Kong
141cceee58 Remove unreachable condition
Comparison of unsigned enum expression < 0 is always false. Fixes
tautological-unsigned-enum-zero-compare warning.

Bug: 72331526
Test: m
Change-Id: I17eb218b256015f5f406fd24324a49b05a0e8866
2018-03-01 22:54:08 +00:00
Treehugger Robot
10f62351eb Merge "Add a NOLINT for the memory leak we added" 2018-03-01 22:00:02 +00:00
Tom Cherry
69d47aa829 Clean up property set error handling
Currently we only report why a property set call has failed but drop
the context of what was trying to set the property.  This change
adds information about why a property was trying to be set when it
fails.

It also unifies property_set() within init to go through the same
HandlePropertySet() function as normal processes do, removing unneeded
special cases.

Test: boot bullhead
Test: attempt to set invalid properties and see better error messages
Change-Id: I5cd3a40086fd3b226e9c8a5e3a84cb3b31399c0d
2018-03-01 11:14:02 -08:00
George Burgess IV
657db00e3d Add a NOLINT for the memory leak we added
Added by I7255d45335fa009dc9e5de99dff67af52bd70e06

Bug: None
Test: Ran the analyzer. Complaint is gone.
Change-Id: Id9b8debd8b9690210f5a8e19154ee3a5095b8fbd
2018-03-01 18:59:50 +00:00
Tom Cherry
45ee43b1ac Merge "Don't build host_init_verifier on Android either" 2018-03-01 05:46:39 +00:00
Tom Cherry
547f7318c2 Don't build host_init_verifier on Android either
Also fixes another mac build issue...

Test: linux builds still work...
Change-Id: I549891c7e38729bd5fbe79f79b7345dabd9b4b28
2018-02-28 21:43:59 -08:00
Tom Cherry
28d364792f Merge "Don't build host_init_verifier for darwin" 2018-03-01 01:25:32 +00:00
Tom Cherry
96ff0fed82 Don't build host_init_verifier for darwin
And therefore fix the mac build break.

Test: none
Change-Id: Ice28780abc62fc3e46119497d23bcbc124354159
2018-02-28 17:21:14 -08:00
Tom Cherry
49fd480ede Merge "init: add host side parser for init" 2018-03-01 00:04:49 +00:00
Treehugger Robot
1ac7150590 Merge "adb: add a way to make the server intentionally leak." 2018-02-28 22:56:30 +00:00
Josh Gao
e2176118f4 adb: add a way to make the server intentionally leak.
Add a way to test LeakSanitizer with the server by adding an
environment variable that intentionally leaks.

Test: ASAN_OPTIONS=detect_leaks=1:leak_check_at_exit=1 ADB_LEAK=1 adb server nodaemon
Change-Id: I7255d45335fa009dc9e5de99dff67af52bd70e06
2018-02-28 14:16:14 -08:00
Colin Cross
c8a22bc1af Merge "Make memunreachable_binder_test suitable for VTS" 2018-02-28 19:11:42 +00:00
Tom Cherry
de6bd50d42 init: add host side parser for init
Create a host side parser for init such that init rc files can be
verified for syntax correctness before being used on the device.

Bug: 36970783
Test: run the parser on init files on host

Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
2018-02-28 10:45:45 -08:00
Treehugger Robot
d24c8484c8 Merge "Change the remount command to be more container-friendly" 2018-02-28 16:48:37 +00:00
Tom Cherry
304dacae8a Merge "libprocessgroup: remove legacy C string handling and build for host" 2018-02-28 16:22:09 +00:00
Treehugger Robot
c0d4786989 Merge "Mark crash_dump.policy as not supported on mips" 2018-02-28 03:07:21 +00:00
Colin Cross
51e6c252c4 Make memunreachable_binder_test suitable for VTS
Link statically against libmemunreachable to avoid runtime
dependency on libmemunreachable.so.
Provide a better error when run as non-root.
Rename the test to MemunreachableBinderTest.
Add comments explaining the test sequence.

Bug: 28275695
Test: memunreachable_binder_test
Change-Id: Iddfba636205b7ca3ad31a6ba2c4e85abadd32d0d
2018-02-27 18:29:18 -08:00
Josh Gao
09d5e258ef Merge changes I0783be05,Id8178913
* changes:
  adb: allow reentrant calls to fdevent_run_on_main_thread.
  adb: stop using quick_exit.
2018-02-28 00:14:58 +00:00
Dan Willemsen
e2b6cd28f2 Mark crash_dump.policy as not supported on mips
The recent change to detect missing source files broke reading makefiles
for mips, since this didn't specify a source file.

Bug: 73904572
Test: lunch aosp_mips-eng; m nothing
Test: lunch aosp_arm-eng; m crash_dump.policy
Test: lunch aosp_arm64-eng; m crash_dump.policy
Test: lunch aosp_x86-eng; m crash_dump.policy
Test: lunch aosp_x86_64-eng; m crash_dump.policy
Change-Id: I28864b5af59267f1ab83084128f2c59b04039374
2018-02-27 15:35:11 -08:00
Josh Gao
e39ccd3cbd adb: allow reentrant calls to fdevent_run_on_main_thread.
Previously, reentrant calls to fdevent_run_on_main_thread would
deadlock.

Test: adb_test on host
Change-Id: I0783be0558dcaf61ddbe76d13ac6917fc2de0be0
2018-02-27 14:50:07 -08:00
Josh Gao
d51c6df1ef adb: stop using quick_exit.
We don't actually need to use quick_exit to avoid calling static
destructors, since we have -Wexit-time-destructors to guarantee we
don't actually have any, and this precludes the use of asan's exit time
leak checking, so switch back to atexit/exit.

Test: ASAN_OPTIONS=detect_leaks=1:leak_check_at_exit=1 adb server nodaemon with a manually inserted leak
Change-Id: Id8178913f64cb02c820c5073351369a9e4d8c74d
2018-02-27 14:50:07 -08:00
Luis Hector Chavez
0db4b7a95b Change the remount command to be more container-friendly
Passing in MS_REMOUNT | MS_BIND tells the kernel to only remove the
MS_RDONLY flag and keep all the other flags the same. This is also the
only kind of remount that is allowed in Linux containers (to be more
precise, within user namespaces).

This change also attempts to always run the remount command when dealing
with /, since containers will almost always run a loop device, and since
the number of the device changes, it is not convenient to put it in the
fstab. Plus, the container won't have permission to modify it, but might
be able to perform the remount.

Bug: 72178046
Test: `adb remount` works in both sailfish and Chrome OS
Change-Id: I9e8ec8afcd57f67875a312824667768b3aa89faa
2018-02-27 14:37:26 -08:00
Tom Cherry
574a081623 libprocessgroup: remove legacy C string handling and build for host
Bug: 36970783
Test: kill zygote and see that its children die correctly
Change-Id: I1b0e9a9cdb834a000fec82323d690e3bd288692d
2018-02-27 14:12:19 -08:00
Treehugger Robot
73664df55e Merge "EndsWith *suffix*" 2018-02-27 16:39:43 +00:00
Erik Kline
b154d18d11 EndsWith *suffix*
Possibly an old copy and paste error.

Test: built
Change-Id: Ie86203d65b4021ed4b787d2330729ab0b1d73e9d
2018-02-27 16:12:55 +09:00
Jaegeuk Kim
badaa56639 Merge "fs_mgr: add sysfs_path=%s to indicate a location of sysfs entry" 2018-02-27 06:20:23 +00:00
Jaegeuk Kim
efd3b9c28f fs_mgr: add sysfs_path=%s to indicate a location of sysfs entry
This patch adds sysfs_path=%s in fstab to get the sysfs entry path.
One example is that vold is able to conduct UFS-specific operations given the
below fstab entry.

/dev/block/bootdevice/by-name/userdata  /data f2fs  noatime,nosuid,nodev,discard
  latemount,wait,check,fileencryption=ice,quota,formattable,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc

Bug: 63264275
Bug: 68721792
Change-Id: I5097873893948f12296ac5eaa0c2a59a6e6dd9e1
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-02-26 15:47:09 -08:00
Tom Cherry
89063827b1 Merge "init: Reboot after timeout passes during reboot" 2018-02-26 17:41:11 +00:00
Treehugger Robot
876d9c3159 Merge "libutils: remove subdirs" 2018-02-24 00:42:15 +00:00
Treehugger Robot
581a4ceb00 Merge "adb: switch apacket over to a std::string payload." 2018-02-24 00:40:35 +00:00
Steven Moreland
9571234e22 libutils: remove subdirs
no longer used in Android

Test/Bug: none

Change-Id: I155d5ade02527bf47893a8bf8bcbb07b0aae53d8
2018-02-23 14:44:22 -08:00
Treehugger Robot
a4644c9bc4 Merge "Document property expansion." 2018-02-23 20:41:36 +00:00
Treehugger Robot
e0068770e3 Merge "debuggerd_fallback: don't recursively abort." 2018-02-23 19:58:59 +00:00
David Srbecky
bc8446992f Merge "Modify the offline handling interface." 2018-02-23 19:25:02 +00:00
Tom Cherry
c9fec9d2be init: Reboot after timeout passes during reboot
There is currently a timeout for reboot, however if the system gets
stuck, particularly during file system operations, there is no safety
mechanism that guarantees the system will still reboot.

This change does all of the optional reboot steps in a separate thread
and waits for this thread with a timeout, such that if the reboot
steps get hung, the system is guaranteed to still reboot.

This is specific to 'reboot'.  Shutdown continues to run unbounded to
run fsck.

Bug: 72781711
Test: Reboot devices hitting and not hitting this timeout
Change-Id: Id5e1b3693bab00602177e28b9b662e1499c32961
2018-02-23 11:03:01 -08:00
Elliott Hughes
7e469ce60c Document property expansion.
Bug: N/A
Test: N/A
Change-Id: I54b9d2d08d98d83060b54981b1c5dc9660b93e8f
2018-02-23 10:40:53 -08:00
David Srbecky
8fbdbba9f5 Merge "Adjust DEX file reading to follow layout changes in ART." 2018-02-23 17:53:23 +00:00
Christopher Ferris
432981b905 Modify the offline handling interface.
- Add a new function Backtrace::UnwindOffline that takes the stack data.
- Modify BacktraceMap::CreateOffline so it doesn't take the stack data.
  This makes it easier to reuse the map object created this way.

Reusing the map object increases simpleperf speed (unwinds per second) by 50%.

Test: backtrace_test libunwindstack_test
Change-Id: I90cfbae9e50d95d8a0e3cd394b33ba36d65d45f7
2018-02-23 09:14:06 -08:00
Treehugger Robot
47354e76eb Merge "Remove fs_config entries for webview_zygote." 2018-02-23 17:12:17 +00:00
Josh Gao
70adac6a8a debuggerd_fallback: don't recursively abort.
Calls to abort() will always result in our signal handler being called,
because abort will manually unblock SIGABRT before raising it. This
can lead to deadlock when handling address space exhaustion in the
fallback handler. To fix this, switch our mutex to a recursive mutex,
and manually keep track of our lock count.

Bug: http://b/72929749
Test: debuggerd_test --gtest_filter="CrasherTest.seccomp_crash_oom"
Change-Id: I609f263ce93550350b17757189326b627129d4a7
2018-02-22 16:31:38 -08:00
Christopher Ferris
cdf778f5d9 Merge "Change the GetAdjustedRelPc to GetPcAdjustment." 2018-02-22 17:44:19 +00:00
Tom Cherry
0f8a67d6a8 Merge "init: log control messages along with the process that sent them" 2018-02-22 16:21:05 +00:00
Christopher Ferris
a2ec50bf57 Change the GetAdjustedRelPc to GetPcAdjustment.
This cleans up a bit of the Unwinder code to make it clear what's
going on.

Modify the offline unit tests to verify the pc and sp to make sure
that those values get computed correctly.

Test: Passes unit tests.
Test: Passes 137-cfi art tests.
Change-Id: I0787a1d77b8726d3defd08f31c7476f6798f8d0d
2018-02-21 20:16:39 -08:00
Tom Cherry
6f2d56d584 init: log control messages along with the process that sent them
It's currently not clear that init stops processes due to being sent a
control message nor who sent that message.

Bug: 73343913
Test: send control messages and see the logs
Change-Id: I9e9eff2001e649814107ea961b3b747a1f6da598
2018-02-21 16:36:03 -08:00
Josh Gao
f571fcbe87 adb: switch apacket over to a std::string payload.
Test: python test_device.py with walleye/x86_64 emulator
Change-Id: I0a18941af1cb2279e5019a24ace25741def1202f
2018-02-21 14:30:17 -08:00
Christopher Ferris
2733708cfb Merge "Add ability to skip function name resolution." 2018-02-21 20:13:24 +00:00
Treehugger Robot
9b4d7dd51e Merge "Base: Add an NDK-compiled version of libbase" 2018-02-21 06:37:08 +00:00
Andreas Gampe
af05f3b761 Base: Add an NDK-compiled version of libbase
To support building libraries for CTS.

Bug: 73206894
Bug: 73659009
Test: mmma system/core/base
Change-Id: I630be88f44cf5cefcb13be7959fc1a710686e29b
2018-02-21 01:59:24 +00:00