Commit graph

34622 commits

Author SHA1 Message Date
Treehugger Robot
e808f9213c Merge "reboot: only pause indefinitely for non-shutdown operations" 2017-09-29 20:53:33 +00:00
Josh Gao
39071a5177 Merge "adbd: improve thread names." 2017-09-29 18:17:33 +00:00
Mark Salyzyn
7b0f41c393 reboot: only pause indefinitely for non-shutdown operations
If -p flag specified, return immediately so that scripting code
can progress.  Shutdown is unique in that if it does happen,
the device will never come back, but if it fails one can continue
diagnosis (without the need for a script to send a SIGINT to break
out of the indefinite pause on the reboot -p command).

Yes, this will break adb shell reboot -p ; adb wait-for-device as
noted in the comment, but no one should ever expect the device to
come back if a shutdown is requested.  We do not break adb reboot ;
adb wait-for-device sequence though as we retain the pause forever.

Test: manual
Bug: 63736262
Bug: 38446744
Bug: 66912053
Change-Id: I028cd873a7193a78c6b3c342eca1e08b6b296fd2
2017-09-29 16:29:52 +00:00
Treehugger Robot
16e31801a5 Merge "fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()" 2017-09-29 06:47:27 +00:00
Treehugger Robot
8cbbacdc15 Merge "Removing $(PRODUCT_OUT)/root/root" 2017-09-29 02:33:44 +00:00
Josh Gao
bcadc77550 adbd: improve thread names.
Name each service thread specifically to improve debuggability.

Bug: http://b/65648324
Test: adb shell debuggerd -b `adb shell pidof adbd` during a sync
Change-Id: I644e25fc2f14a26eafd19f596e4e8f3c2bb79967
2017-09-28 16:45:24 -07:00
Dan Willemsen
612b47630f Merge "Rename libz-host -> libz" 2017-09-28 20:57:43 +00:00
Bowgo Tsai
144893e5ec Removing $(PRODUCT_OUT)/root/root
Bug: 65570851
Test: boot sailfish
Change-Id: I80c3c3de23c57343187fde207980731b5341bc1f
Merged-In: I80c3c3de23c57343187fde207980731b5341bc1f
(cherry picked from commit ededee3e40)
2017-09-28 18:10:58 +08:00
Bowgo Tsai
c55f188207 fs_mgr_fstab: removing fs_mgr_get_entry_for_mount_point_after()
No fs_mgr client is using fs_mgr_get_entry_for_mount_point_after(), which
supports matching a mount point iteratively by specifying a starting entry
in the fstab. So removes it.

Also switch the public API from C/C++ to C++-only:
    fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const char* path);
==> fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const std::string& path);

Bug: 67024518
Test: boot sailfish, manually test fs_mgr_get_entry_for_mount_point().

Change-Id: I38e18fa6bd9485b6cd31b55474406a511df3f506
2017-09-28 15:28:59 +08:00
Dan Willemsen
5cfa006059 Rename libz-host -> libz
Test: m host
Change-Id: Ib276431d13b3e1bd243f84a80f69aafc12e71aac
2017-09-27 16:24:45 -07:00
Tom Cherry
61578ab50b Merge "init: remove non-protobuf single persistent property file" 2017-09-27 20:35:09 +00:00
Mark Salyzyn
d2b5a2417f Merge "init: report shutdown,container for sigterm of init" 2017-09-27 19:32:31 +00:00
Treehugger Robot
ef9426d883 Merge "adb: partially revert b5e11415." 2017-09-27 18:38:28 +00:00
Tom Cherry
9614e4d4d9 init: remove non-protobuf single persistent property file
This has moved to being serialized with libprotobuf.

Test: persistent properties work on bullhead
Test: init unit tests
Change-Id: I26ebe135e37d352f9c53612301bde703144853e7
2017-09-27 18:22:35 +00:00
Tom Cherry
9c568d0fc0 Merge "init: cleanup exit() uses" 2017-09-27 17:10:31 +00:00
Mark Salyzyn
161b8626bd init: report shutdown,container for sigterm of init
Change HandleSigtermSignal() handler to report shutdown,container. Add
the new reason to bootstat.  Remove log stutter as
HandlPowerctlMessage will also do a LOG(INFO) reporting
shutdown,container as reason.

Sending SIGTERM to init is to allow a host OS to ask an Android
Container instance to shutdown.  The temptation is to report
shutdown,sigterm but that does not accurately describe the usage
scenario.

Test: compile
Bug: 63736262
Change-Id: I3c5798921bdbef5d2689ad22a2e8103741b570b4
2017-09-27 09:10:00 -07:00
Mark Salyzyn
82ee4060ed Merge "init: shutdown,thermal shut off display immediately" 2017-09-27 14:54:38 +00:00
Treehugger Robot
6832535cd5 Merge "libsync: Add fence info tests" 2017-09-26 23:46:32 +00:00
Tom Cherry
4a679454d7 init: cleanup exit() uses
Primarily, this fixes a bug where a forked child of property service
uses exit() instead of _exit, which has the unintended consequences of
running the global destructors of init proper, which leads to
unintended cleanup.

Secondly, this replaces the remaining calls of exit() that really
should be LOG(FATAL).

Test: boot sailfish
Change-Id: I779228e7d44a73186bc7685bb723c4b9278a0a2d
2017-09-26 16:30:03 -07:00
Treehugger Robot
a0dd1adab0 Merge "fs_mgr_fstab: do an exact match when searching a mount point" 2017-09-26 23:09:43 +00:00
Mark Salyzyn
bfd05b69a5 init: shutdown,thermal shut off display immediately
Remove a source of heat.

Test: manual
Change-Id: I9a7391ddb121b6748a4f49f4b5bfb77453ca1514
2017-09-26 14:06:51 -07:00
Treehugger Robot
92c355cc4f Merge "Show the number of VMAs in the tombstone." 2017-09-26 21:01:20 +00:00
Elliott Hughes
868d39a82f Show the number of VMAs in the tombstone.
Tombstones (especially ones with lots of VMAs) are regularly truncated.
We can at least show the number of VMAs, though, for anyone interested
in knowing whether they got close to the default 64Ki limit.

Bug: http://b/66911122
Test: ran crasher, examined tombstone
Change-Id: I286db66f28f132307d573dbe5164efc969dc6ddc
2017-09-26 12:01:06 -07:00
Treehugger Robot
f7d14b643b Merge "sync: store the num_fences from first SYNC_IOC_FILE_INFO" 2017-09-26 17:52:03 +00:00
Bowgo Tsai
cc323958f9 fs_mgr_fstab: do an exact match when searching a mount point
Currently when searching a mount point from a fstab, it checks whether the
mount point of an fstab entry is the prefix of a given path, and the
next char after the match is either '\0' or '/'.

However, it will always return the fstab entry with mount point
"/vendor" when searching path is "/vendor", "/vendor/abc" or "/vendor/cde"
in the following fstab. Because "/vendor" is the prefix of "/vendor/abc"
and "/vendor/cde", and the next char after the match is '/'.

    /dev/block/platform/.../by-name/vendor   /vendor      ext4  ro  wait
    /dev/block/platform/.../by-name/abc      /vendor/abc  ext4  ro  wait
    /dev/block/platform/.../by-name/cde      /vendor/cde  ext4  ro  wait

Fix this by performing an exact match when searching the mount point.

Bug: 63912287
Test: boot sailfish

Change-Id: I504655f5c71790c5d528085de416ce3c30d21fea
2017-09-26 21:06:59 +08:00
Alexandros Frantzis
68223500ea libsync: Add fence info tests
This patch adds regression tests to check that the fence info returned
by libsync contains valid data.

Test: sync-unit-tests

Change-Id: I0c57c49b7be563efc9a43f12381059f20e0a4e52
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2017-09-26 13:09:35 +03:00
Tom Cherry
dea5e081ac Merge "Reland "Remove comments and code about ro.boot.slot"" 2017-09-25 23:58:30 +00:00
Saurabh Shah
90a74600d7 sync: store the num_fences from first SYNC_IOC_FILE_INFO
Fixes a bug with the signal time of devices using the
modern sync file interface. The bug only affects kernels running
an Android kernel 4.9 and later.

b/63395253

Test: tests/sync_test.cpp

Change-Id: I6fb00bcb8e16a3268c357153edd8e35a44546caa
2017-09-25 15:51:46 -07:00
Treehugger Robot
20ae530e01 Merge "Silence static analyzer warnings about memory leaks" 2017-09-25 19:41:13 +00:00
Christopher Ferris
9b91324cb0 Merge "Add a new unwind method on error." 2017-09-25 19:16:59 +00:00
Tom Cherry
211a4a5d5a Reland "Remove comments and code about ro.boot.slot"
This reverts commit c5f5fd430a.

Dependencies are now merged.

Bug: 37663204
Bug: 66437505
Change-Id: I84284b6bc37f6aae4096dec73f45ebd85d28ca9d
2017-09-25 16:04:30 +00:00
Treehugger Robot
baea76dba7 Merge "tombstoned: fix another call to evconnlistener_new." 2017-09-25 12:57:30 +00:00
George Burgess IV
80136a1e41 Silence static analyzer warnings about memory leaks
The static analyzer complains that this memory is leaked regardless of
how I try to work around it (unless we escape the memory by using a
global or something, but...). Basically, as long as there's some sort
of operation on the reinterpret_cast'ed pointer, it complains. If we
remove the bitwise negations, it doesn't. Doing so would presumably
defeat the purpose of this test, though, so add a NOLINT.

Bug: 27101951
Test: mma. No more static analyzer warning for this file.
Change-Id: If9008946a2145d17b8651535141bfd7ec9224739
2017-09-24 13:36:29 -07:00
Treehugger Robot
7229576bfe Merge "Base: Warn on using ostream<< with std::string*" 2017-09-23 01:38:42 +00:00
Josh Gao
ce9cc4e428 tombstoned: fix another call to evconnlistener_new.
Apply the same fix from c2e98f63 to intercept_manager.cpp.

Bug: http://b/64543673
Test: debuggerd_test
Change-Id: Ibfb919e059fa62f8336cfc1426d03ef015590136
2017-09-22 18:00:35 -07:00
Christopher Ferris
b9de87f7ed Add a new unwind method on error.
If a function crashes by jumping into unexecutable code, the old method
could not unwind through that. Add a fallback method to set the pc from
the default return address location.

In addition, add a new finished check for steps. This will provide a method
to indicate that this step is the last step. This prevents cases where
the fallback method might be triggered incorrectly.

Update the libbacktrace code to unwind using the new methodology.

Update the unwind tool to use the new unwind methodology.

Add a new option to crasher that calls through a null function.

Create a new object, Unwinder, that encapsulates the a basic unwind. For now,
libbacktrace will still use the custom code.

Added new unit tests to cover the new cases. Also add a test that
crashes calling a nullptr as a function, and then has call frames in
the signal stack.

Bug: 65842173

Test: Pass all unit tests, verify crasher dumps properly.
Change-Id: Ia18430ab107e9f7bdf0e14a9b74710b1280bd7f4
2017-09-22 16:55:12 -07:00
Andreas Gampe
c8f935aa5e Base: Warn on using ostream<< with std::string*
In most reasonable cases, this is actually a bug. So add a diagnostic.

Test: m
Change-Id: Ib506b45dbdbafcb1893486b08ef13ec8f11d0357
2017-09-22 16:25:58 -07:00
Treehugger Robot
643e9a536c Merge "Revert "Add derive_gid flag for mounting sdcardfs"" 2017-09-22 17:21:55 +00:00
Richard Uhler
f09f965f9f Revert "Add derive_gid flag for mounting sdcardfs"
This reverts commit 8ca02bbeb5.

Causes boot loop on bullhead.

(cherry picked from commit 28dbcaa23b)

Bug: 63245673
Bug: 65660058
Test: m
Merged-In: Ife5f83ebf56fb956e5015d2797b5b47a515ec171
Change-Id: Ife5f83ebf56fb956e5015d2797b5b47a515ec171
2017-09-22 09:03:18 -07:00
Treehugger Robot
7178e29c22 Merge "Revert "Base: Delete ostream<< with std::string*"" 2017-09-22 03:07:23 +00:00
Andreas Gampe
2db3823632 Revert "Base: Delete ostream<< with std::string*"
This reverts commit 4ef5011a7b.

Reason for revert: Breaks an internal mocking case that cannot be changed.

Test: m
Change-Id: I83f9338bde02eb2b45b3e52b66ef78490ddbeeda
2017-09-21 17:53:00 -07:00
Treehugger Robot
0bb8dcb23e Merge "bootstat: Add reboot,userrequested" 2017-09-21 20:27:35 +00:00
Tom Cherry
eb00b1f3aa Merge "Revert "Remove comments and code about ro.boot.slot"" 2017-09-21 18:40:56 +00:00
Tom Cherry
c5f5fd430a Revert "Remove comments and code about ro.boot.slot"
This reverts commit f4ec2c50a3.

Dependencies hadn't been merged yet.

Bug: 66437505
Change-Id: I7551b7f2f184a6fefc39e184a42dc8d323c58b89
2017-09-21 18:37:22 +00:00
Mark Salyzyn
9033bf5a2e bootstat: Add reboot,userrequested
Result of holding power button down and hitting restart.

Test: compile
Bug: 63736262
Change-Id: I271bdf135cece5fd9dc9e60ddf8add595ed3da4c
2017-09-21 11:30:29 -07:00
Treehugger Robot
c7750dce6b Merge "libion: Adapt to new ION interface" 2017-09-21 01:06:32 +00:00
Treehugger Robot
e3526a5ef9 Merge "Add derive_gid flag for mounting sdcardfs" 2017-09-21 00:57:48 +00:00
Treehugger Robot
65673033ab Merge "Enable libdemangle and libunwindstack on host bionic" 2017-09-20 23:30:01 +00:00
Treehugger Robot
c849088284 Merge "libion: add 4.12+ kernel headers for forward compatibility" 2017-09-20 23:19:13 +00:00
Daniel Rosenberg
b7c118522f Add derive_gid flag for mounting sdcardfs
Turns on the derive_gid feature for sdcardfs. This was moved
under a mount flag in the kernel.

Test: If the derive_gid flag is supported, the first mount
      should succeed. If the flag is not, the second should
      succeed.
Bug: 63245673
Change-Id: If1c1bce13d14120732e420252cb5605d33ce7c40
2017-09-20 16:04:50 -07:00