Commit Graph

35943 Commits

Author SHA1 Message Date
Jerry Zhang 6fe5cda8aa Merge "adb: Use kernel aio for functionfs."
am: aaa90cfe06

Change-Id: Ia89f076b94c8974544923b64ea53dffd6b8c8397
2017-08-29 03:38:26 +00:00
Treehugger Robot aaa90cfe06 Merge "adb: Use kernel aio for functionfs." 2017-08-29 03:28:26 +00:00
Christopher Ferris 458cc66b07 Update the tests.
- Change all load_base to load_bias in the test files.
- Add the test files to the backtrace_test.
- Add a function to get the path to the test libraries.
- Change aarch64 to arm64 for offline test code.
- Modify the offline tests so that they can be easily updated when
  unwinding on any arch for any other arch is possible.
- Add tests of CreateNew for remote debugging.

Test: Ran unit tests on host and angler.
Change-Id: Id6c5afe73aeb2ac22463dd81f061799fcb1c178b
2017-08-28 18:08:52 -07:00
Josh Gao 3c186bc32c Merge "adb: improve CHECKs." am: 9f38e19b88
am: f628362478

Change-Id: I4d381032b4dfbca95a203473af4fcc6164b1fca8
2017-08-28 23:46:24 +00:00
Josh Gao f628362478 Merge "adb: improve CHECKs."
am: 9f38e19b88

Change-Id: Icc50ced0faeda5653288922ec787311e30c5085d
2017-08-28 23:40:23 +00:00
Treehugger Robot 9f38e19b88 Merge "adb: improve CHECKs." 2017-08-28 23:35:44 +00:00
Tom Cherry 5727a169c1 Merge "init: fix signal handling and LOG(FATAL) in child processes" am: 30bf4b7500
am: 43e92299e9

Change-Id: I1df0e8ced15a283cccda88f24ebcfcb33b23c3c3
2017-08-28 22:01:16 +00:00
Tom Cherry 43e92299e9 Merge "init: fix signal handling and LOG(FATAL) in child processes"
am: 30bf4b7500

Change-Id: I9147d02a9e710f9e8068a9b3b061768daf2648e9
2017-08-28 21:55:45 +00:00
Josh Gao fdf832dfd3 base: add Pipe and Socketpair wrappers.
Also, switch debuggerd_handler over to using android::base::unique_fd.

Test: treehugger
Change-Id: I97b2ce22f1795ce1c4370f95d00d769846cc54b8
2017-08-28 14:51:07 -07:00
Tom Cherry 30bf4b7500 Merge "init: fix signal handling and LOG(FATAL) in child processes" 2017-08-28 21:45:38 +00:00
Josh Gao e46720938d adb: improve CHECKs.
Use CHECK_LT(foo, 1234) instead of CHECK(foo < 1234) so that failing
checks have the values emitted.

Bug: http://b/65063965
Test: adb server nodaemon
Change-Id: I094287f7c4d2d177ea216568d06e9e425a28dd96
2017-08-28 14:43:24 -07:00
Josh Gao 43898a6add Merge "adbd: don't spin if file sync read fails." am: 32d2eae8b9
am: 4dc1892491

Change-Id: If487706ed52943b8034334146286026ddbc5535a
2017-08-28 21:21:15 +00:00
Josh Gao 4dc1892491 Merge "adbd: don't spin if file sync read fails."
am: 32d2eae8b9

Change-Id: Ie104bb8ea8d67b5a7ce896d2237a44cc8ea1ab4f
2017-08-28 21:16:13 +00:00
Treehugger Robot 32d2eae8b9 Merge "adbd: don't spin if file sync read fails." 2017-08-28 21:06:48 +00:00
Tom Cherry cb5fccc83c Globally allow up to 32K FDs open per process
We've seen crashes due to processes exceeding the current soft limit
for open FDs of 1024, mainly due to increases in using FDs for shared
memory and gralloc memory objects.

There is not a compelling reason to keep this limit artificially low,
so we raise it to 32K.  This matches my desktop linux limit, so it is
with precedent.

Bug: 64894637
Test: open 32K FDs in a process without failure then fail after 32K
Change-Id: Ibecfc486e9c61f273a432a108893137d2d13a530
2017-08-28 13:08:24 -07:00
Tom Cherry d47ccf8277 Merge "init: support setting rlimits per service" am: 459aa1cac6
am: c39a5082dc

Change-Id: I1f302dccc0f93c61da8d1d7df99d7086ce33ed20
2017-08-28 19:45:40 +00:00
Tom Cherry c39a5082dc Merge "init: support setting rlimits per service"
am: 459aa1cac6

Change-Id: I4ef5abc3371ce52783bfb14669bcffe33febb73e
2017-08-28 19:39:08 +00:00
Treehugger Robot 459aa1cac6 Merge "init: support setting rlimits per service" 2017-08-28 19:27:08 +00:00
Josh Gao 1d6c01b53d adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
2017-08-28 11:21:31 -07:00
Tom Cherry fb32e15da8 Merge "init: log all failures of Service::Start()" am: 9bde0dc769
am: 849b481786

Change-Id: Ia6fc0b0917d6b35dda5270c9fa416fb46a6743ed
2017-08-28 17:36:00 +00:00
Tom Cherry 849b481786 Merge "init: log all failures of Service::Start()"
am: 9bde0dc769

Change-Id: Ibb27338bb694482108ffc558b2823c583a9701d3
2017-08-28 17:30:28 +00:00
Tom Cherry 9bde0dc769 Merge "init: log all failures of Service::Start()" 2017-08-28 17:22:11 +00:00
Tom Cherry 7ac013de7e init: support setting rlimits per service
Add a new service option, `rlimit` that allows a given rlimit to be
set for a specific service instead of globally.

Use the same parsing, now allowing text such as 'cpu' or 'rtprio'
instead of relying on the enum value for the `setrlimit` builtin
command as well.

Bug: 63882119
Bug: 64894637

Test: boot bullhead, run a test app that attempts to set its rtprio to
      95, see that the priority set fails normally but passes when
      `rlimit rtprio 99 99` is used as its service option.
      See that this fails when `rlimit rtprio 50 50` is used as well.
Test: new unit tests

Change-Id: I4a13ca20e8529937d8b4bc11718ffaaf77523a52
2017-08-28 10:19:50 -07:00
Christopher Ferris 4c4b8edb19 Merge "Add missing include for readv." am: 1f6a807bac
am: 831140358d

Change-Id: I06445320fb9ec382af117612cb64e9c35949ef00
2017-08-26 15:22:14 +00:00
Christopher Ferris 831140358d Merge "Add missing include for readv."
am: 1f6a807bac

Change-Id: Ib0530b4e3ea1a9fdc779c87cdd12489859a35bff
2017-08-26 15:19:14 +00:00
Christopher Ferris 1f6a807bac Merge "Add missing include for readv." 2017-08-26 15:12:14 +00:00
Christopher Ferris 5d6a0325ef Add missing include for readv.
Test: Builds.
Change-Id: Ia8511dcec6f49d3f6016a4dac88ccf343495349b
2017-08-25 17:33:38 -07:00
Josh Gao dca8180110 Merge "libunwindstack: make machine type a property of Regs." am: 75a40988c0
am: 310f3e114a

Change-Id: I319cbb0ca2bbb569f7c8e989764243825a0cdeea
2017-08-26 00:19:10 +00:00
Josh Gao 310f3e114a Merge "libunwindstack: make machine type a property of Regs."
am: 75a40988c0

Change-Id: I237904de44d478b03b74dda42f1b6a6ce5c36aa0
2017-08-26 00:15:22 +00:00
Treehugger Robot 75a40988c0 Merge "libunwindstack: make machine type a property of Regs." 2017-08-26 00:02:46 +00:00
Nick Kralevich 787b5038f4 Merge "Clarify SELinux service error message" am: 54a28300b7
am: 706a898cd0

Change-Id: I3ab507e09016b94efb1440a4ad77a03918d361a5
2017-08-25 23:18:46 +00:00
Nick Kralevich 706a898cd0 Merge "Clarify SELinux service error message"
am: 54a28300b7

Change-Id: I638bad81212c20b1c0065eab98ab2e043b643aac
2017-08-25 23:16:47 +00:00
Treehugger Robot 54a28300b7 Merge "Clarify SELinux service error message" 2017-08-25 23:10:06 +00:00
Tom Cherry 1ca83249a1 init: fix signal handling and LOG(FATAL) in child processes
Child processes inherit the signal handlers and the 'Aborter' for
logging from their parent process.  In the case of init, fork()'ed
processes, will attempt to reboot the system if they receive a fatal
signal or if they call LOG(FATAL).  This is not the correct behavior;
these processes should terminate due to the provided signal like other
processes on the system.

This is particularly important as there are multiple LOG(FATAL) calls
in service.cpp for failures after fork() but before execv() when a
service is started.

Note, that pthread_atfork() is not a viable solution since clone() is
used in some cases instead of fork() and atfork handlers are not
called with clone().

Test: LOG(FATAL) from a child process of init and see that it
      terminates due to a signal correctly
Test: LOG(FATAL) from init proper and see that it reboots to the
      bootloader

Change-Id: I875ebd7a5f6b3f5e3e2c028af3306917c4409db3
2017-08-25 15:10:48 -07:00
Josh Gao 0953ecd03a libunwindstack: make machine type a property of Regs.
There are no actual users of the machine type output parameter to
Regs::RemoteGet. The concrete implementations of Regs know what machine
type they represent anyway, so provide an accessor to query.

Test: treehugger
Test: libunwindstack tests on 32/64-bit host, hikey960
Change-Id: Ia25910531d36c41b2b6919f154cfa914aae63117
2017-08-25 14:48:09 -07:00
Nick Kralevich 1ea19eb44d Clarify SELinux service error message
1) Attempt to make the error message associated with a missing service
better.
2) Provide a link to more in-depth documentation.

Bug: 65023716
Test: code compiles.
Change-Id: Ie0f1896fb41d5afd11501f046cb51d4c8afe0a62
2017-08-25 14:01:06 -07:00
Christopher Ferris bd048209b4 Merge "Speed up map creation." am: df3e89be94
am: 2bf9cbf233

Change-Id: I1298f1c8b9e7ee6abad624513be5c365389804f7
2017-08-25 19:16:30 +00:00
Christopher Ferris 2bf9cbf233 Merge "Speed up map creation."
am: df3e89be94

Change-Id: Iba6f292a4448f065dcf64c6f3e40107b5042a62d
2017-08-25 19:12:29 +00:00
Christopher Ferris df3e89be94 Merge "Speed up map creation." 2017-08-25 19:04:14 +00:00
Tom Cherry 702ca9ada2 init: log all failures of Service::Start()
The move to returning Result from Service::Start() for better context
when starting process through init's builtins stops Service::Start()
failures from being logged from other contexts.  This change adds
those logs along with their context.

Test: boot bullhead, fail to start services via `setprop ctl.start`,
      see the expected error in dmesg

Change-Id: I45294f6abf00852f3d4c549a32eaf4920a51e6f0
2017-08-25 11:01:52 -07:00
Max Bires c564cb0bec Merge "Add a feature to show which bugs are tracking which se denials" am: 06e0c704d7
am: 08e66e7796

Change-Id: I13bca0fe36876dc680fdaddd9d65a40cf209a688
2017-08-25 17:05:14 +00:00
Max Bires 08e66e7796 Merge "Add a feature to show which bugs are tracking which se denials"
am: 06e0c704d7

Change-Id: I67dab1bfe2e400189669dfe48e8683ec15591c34
2017-08-25 17:01:14 +00:00
Max Bires 06e0c704d7 Merge "Add a feature to show which bugs are tracking which se denials" 2017-08-25 16:54:19 +00:00
Tom Cherry ec9aa8ce7c Merge "init: do not load persistent properties from temporary /data" am: b1d93a8136
am: b916f49bd7

Change-Id: Id3706892e6d34ca97ac2824099d7830b2340e78c
2017-08-25 16:46:58 +00:00
Alan Stokes 32636f0f4c Merge "Small liblog test fixes & readability improvements." am: 332370d14d
am: 511cc67633

Change-Id: I9495eb03997b7759786f02d24b92657381053f2f
2017-08-25 16:46:22 +00:00
Tom Cherry b916f49bd7 Merge "init: do not load persistent properties from temporary /data"
am: b1d93a8136

Change-Id: I3dd6423db9bf9e799e438f2e5f50dfc77a0d78f8
2017-08-25 16:43:22 +00:00
Alan Stokes 511cc67633 Merge "Small liblog test fixes & readability improvements."
am: 332370d14d

Change-Id: Id3ba8e43ac60fdfe33b40e0f78629ae3312afb50
2017-08-25 16:42:37 +00:00
Tom Cherry b1d93a8136 Merge "init: do not load persistent properties from temporary /data" 2017-08-25 16:37:20 +00:00
Alan Stokes 332370d14d Merge "Small liblog test fixes & readability improvements." 2017-08-25 16:35:55 +00:00
Alan Stokes 50289204e5 Merge "Reading from logd in WRAP mode is expected to take a long time, don't abort it after 30s." am: 974ab46561
am: 9181fe6427

Change-Id: I4d151187abe53d6c6094521436ddd86129c3cb24
2017-08-25 14:45:09 +00:00