Commit graph

42195 commits

Author SHA1 Message Date
Hans Boehm
b708511f78 Merge "Prepare to fail in RefBase destructor if count is untouched"
am: f502182ac6

Change-Id: I91ff7140a9a72c910ef01a2e13f277fa36c82b50
2018-08-06 11:01:28 -07:00
Hans Boehm
f502182ac6 Merge "Prepare to fail in RefBase destructor if count is untouched" 2018-08-06 16:53:12 +00:00
Christopher Ferris
5aa46568b3 Merge "Be permissive about badly formed elf files."
am: c7815d675a

Change-Id: Ie62a0bd4f1fb50a2a02a0129a5006485a51ae734
2018-08-04 10:33:46 -07:00
Christopher Ferris
c7815d675a Merge "Be permissive about badly formed elf files." 2018-08-04 17:28:35 +00:00
Hans Boehm
9d3146af22 Prepare to fail in RefBase destructor if count is untouched
Move towards crashing if a normally configured RefBase object is
destroyed without ever incrementing the reference count. We've been
threatening to do this for a long time. The previously last known
violation had been fixed.

This also fixes stack trace printing from RefBase, which had previously
been broken, and which we found necessary to track down further
violations of this rule.

Unfortunately, we found several more violations with the aid of
that fix. After existing CLs are submitted, there are
still some failures, but they are no longer numerous. Thus this CL
doesn't actually crash in the event of a violation, but does log a
verbose stack trace if it encounters one.

Bugs have been filed against the remaining known RefBase client offenders.
We plan to enable crashing on usage violations once those are fixed.

The fix for the stack trace printing breakage unfortunately requires
the use of weak symbols in order to avoid a circular build dependency.
We expect to eventually replace this with execinfo.h functionality.

Some random reformatting, driven by consistency with current formatting
requirements.

Add missing include to BacktraceMap.h.

Bug: 79112958
Bug: 30292291
Test: Boot AOSP, Master
Change-Id: I8151c54560c3b6f75ffc4c48229f0388a2066958
2018-08-03 17:56:47 -07:00
Tom Cherry
5744e4d7d2 Merge "Split init's source files init first stage and second stage"
am: e0f6dc46d8

Change-Id: Iec525d3fb0e09550895d67709ed958f8337d9e34
2018-08-03 16:00:05 -07:00
Calin Juravle
d856c9c2c5 Merge "Accept DexMetadata files (.dm) for install-multiple"
am: d560f39fd7

Change-Id: Ib41e955f4e9d20b10ddd517507142346b273b683
2018-08-03 15:59:18 -07:00
David Anderson
8660f5a85c Merge "liblp: Try to merge extents during partition resizes."
am: b0c9318493

Change-Id: Ib124843c47f710665e1d9134eae11edb7575863e
2018-08-03 15:58:35 -07:00
Christopher Ferris
497d0dd5e5 Merge "Fix incorrect left shifts."
am: d2b5a53ef8

Change-Id: Ica7dcb8d4606aeeeae71667400ddb833a03cd808
2018-08-03 15:57:57 -07:00
David Anderson
727c80765d Merge "liblp: Add more logging for logical partition operations."
am: 805bc5d757

Change-Id: If08681fc946f0bd21854459c7efd5986e81a7823
2018-08-03 15:57:21 -07:00
Tom Cherry
e0f6dc46d8 Merge "Split init's source files init first stage and second stage" 2018-08-03 22:44:31 +00:00
Christopher Ferris
5acf069a7a Be permissive about badly formed elf files.
Here is the allowable issues with an elf file that will not result in an error:
- The program headers/section headers offset points to unreadable memory.
- Allow missing program header and/or section headers.
- Allow a symbol table section header to point to invalid symbol table values.

There is no real reason to require the elf file be perfect. Everything in
the code has sane defaults, so any missing information won't cause any
problems.

This gets rid of the warning that occurs any time an elf is loaded
from memory. In memory elf files never contain all of the section headers,
and do not contain the symbol table data.

Update tests to test these new cases.

Test: Builds and unit tests all pass.
Change-Id: Iaefe2cd6b6c965a01ed425a112d6afae339f3b78
2018-08-03 22:02:05 +00:00
Tom Cherry
44aceed016 Split init's source files init first stage and second stage
This is a baseline for splitting init first and second stage into
their own executables.

Bug: 79758715
Test: sailfish boots
Change-Id: I549ad4502893b3a5e4c2a9886f66850f6d31b619
2018-08-03 13:40:17 -07:00
Treehugger Robot
d560f39fd7 Merge "Accept DexMetadata files (.dm) for install-multiple" 2018-08-03 20:14:28 +00:00
Treehugger Robot
b0c9318493 Merge "liblp: Try to merge extents during partition resizes." 2018-08-03 20:02:41 +00:00
Christopher Ferris
d2b5a53ef8 Merge "Fix incorrect left shifts." 2018-08-03 19:58:06 +00:00
Treehugger Robot
805bc5d757 Merge "liblp: Add more logging for logical partition operations." 2018-08-03 19:52:47 +00:00
Tom Cherry
3676564019 Merge "Move watchdogd out of init"
am: 132615b803

Change-Id: Icfc2511dfa3b905e25d6b8187557871960c0f9b1
2018-08-03 12:37:22 -07:00
Tom Cherry
132615b803 Merge "Move watchdogd out of init" 2018-08-03 19:28:14 +00:00
Calin Juravle
f03eebdd59 Accept DexMetadata files (.dm) for install-multiple
Allow .dm files (DexMetadata) to be passed to adb install-multiple.

Do not rename the input files based on their indices as the naming matters
for associating an .dm file to an .apk file.

Test: adb install-multiple -p com.android.cts.classloadersplitapp base.apk
     split.apk split.dm

Bug: 30934496
Change-Id: I2ac39e00d64eae938124250033f79e02f3c3f9c0
(cherry picked from commit aa7753871e)
2018-08-03 11:21:06 -07:00
David Anderson
1aab3909f7 liblp: Try to merge extents during partition resizes.
When adding extents to partitions, if the previous extent and new extent
are contiguous, merge them together to avoid allocating unnecessary
device-mapper targets.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I80087df9aea8141c5e16f8d4cdb3dd7da02aee8c
2018-08-03 11:02:25 -07:00
David Anderson
b9f734c936 liblp: Add more logging for logical partition operations.
This logs when partition tables update, when partitions resize, and when
partitions are unmapped from device mapper.

Bug: N/A
Test: N/A
Change-Id: I1125332c79fccc3ebc556b3b48856901e2503c47
2018-08-03 10:59:43 -07:00
Suren Baghdasaryan
5d95ac61d7 [automerger skipped] Merge "Enable lmkd kill tracing everywhere"
am: e961bbcadc  -s ours

Change-Id: I8551e637d4aec87c75ff6079040d0cde1b8f248c
2018-08-03 10:58:06 -07:00
Suren Baghdasaryan
e961bbcadc Merge "Enable lmkd kill tracing everywhere" 2018-08-03 17:49:29 +00:00
Suren Baghdasaryan
9461708ec9 Merge "lmkd: Disable memory.stat usage when per-application memcgs are not used"
am: 615745cead

Change-Id: I57f3142ed217d4f1b3edb526087076fc588354d7
2018-08-03 09:14:09 -07:00
Daniel Colascione
cd9ba8cbad Enable lmkd kill tracing everywhere
Test: asdf
Exempt-From-Owner-Approval: vacation
Merged-In: If6af7df74d303466aac4a69cdfe558e9748f72b9
Change-Id: If6af7df74d303466aac4a69cdfe558e9748f72b9
2018-08-03 16:08:01 +00:00
Treehugger Robot
615745cead Merge "lmkd: Disable memory.stat usage when per-application memcgs are not used" 2018-08-03 16:07:24 +00:00
Suren Baghdasaryan
ce13cb52fe lmkd: Disable memory.stat usage when per-application memcgs are not used
Per-application memory.stat files are not available when per-application
memcgs are not used (per_app_memcg=false). Disable its usage based on
ro.config.per_app_memcg property.

minchan:
* correct indentation of memory_stat_parse
* move per_app_memcg check into memory_stat_parse inside
* change low_ram_device to per_app_memcg

Bug: 110384555
Test: manual test to see lkmd log message with memory hogger
Merged-In: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
Change-Id: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-08-03 16:06:54 +00:00
Elliott Hughes
71797610f0 Merge "Remove dead gglFastDivx."
am: a02ca9e7ae

Change-Id: I2f836242c432b3695f768b184b87cef1a1f8ea1e
2018-08-03 07:33:41 -07:00
Elliott Hughes
a02ca9e7ae Merge "Remove dead gglFastDivx." 2018-08-03 14:24:22 +00:00
Christopher Ferris
2786608743 Fix incorrect left shifts.
Bug: 112142060

Test: New unit tests pass.
Change-Id: I0c47b22582f0bf75ab503364a337c7de4de3ec43
2018-08-02 18:01:02 -07:00
Aaron Wisner
794fb0107b Merge "Minor fixes to fastboot_driver"
am: 8cf510ff81

Change-Id: I358512c168fbe19c164bb201cf57accdb613f1a3
2018-08-02 17:49:30 -07:00
Treehugger Robot
8cf510ff81 Merge "Minor fixes to fastboot_driver" 2018-08-03 00:41:16 +00:00
Josh Gao
fbe62c5aaf Merge "adb: delete hellish hodgepodge."
am: acc0a90869

Change-Id: I966ae7f468885ca2c9d1d633ef40def3a3e8627a
2018-08-02 17:06:35 -07:00
Treehugger Robot
acc0a90869 Merge "adb: delete hellish hodgepodge." 2018-08-02 23:46:50 +00:00
Elliott Hughes
a55c033d92 Remove dead gglFastDivx.
Bug: http://b/112155920
Bug: https://www.viva64.com/en/b/0579/
Test: builds
Change-Id: Ia55245ce4484d5376abef16c9863015b0a0ca2b1
2018-08-02 16:18:24 -07:00
Josh Gao
2784b0a6bd Merge "adbd: when rebooting, don't close socket before pausing."
am: 9c16700e36

Change-Id: Id83a13aa4ad09de0cd9b6f63d0135b0c25132503
2018-08-02 16:13:36 -07:00
Aaron Wisner
c771ae0fd4 Minor fixes to fastboot_driver
- Make RCString() static
- Add clearer error message for 0 length upload error
- Fix regex hex matching for partition-size
- Move ZLP packet checking to SparseWriteCallback()

Test: build fastboot on glinux
Change-Id: I51a040e07b9698a41f64b35a9e2baa8d575527a9
2018-08-02 17:47:38 -05:00
Treehugger Robot
9c16700e36 Merge "adbd: when rebooting, don't close socket before pausing." 2018-08-02 22:21:43 +00:00
Josh Gao
3b4de3c355 adb: delete hellish hodgepodge.
This code was unreachable, since all of the callers were calling
register_socket_transport with foo.c_str() as the serial. Lift this
assumption into the type system by switching from char* to std::string
for the argument type.

Bug: http://b/112147760
Bug: https://www.viva64.com/en/b/0579/
Test: mma
Change-Id: I5a6ee265feee6b83bc933a64d895eed39fce68e7
2018-08-02 14:51:05 -07:00
Josh Gao
6fb9461103 adbd: when rebooting, don't close socket before pausing.
An accidental side-effect of the change to unique_fd was that we
started closing the reboot service socket before pausing and waiting
for our death. This results in the client immediately returning, which
means they might get a chance to run other commands before we actually
manage to reboot.

Bug: http://b/112104037
Test: adb reboot; adb devices
Change-Id: Id61321da0c08ebd1ab57f1ce926bafd9109dd9c2
2018-08-02 12:52:26 -07:00
Tom Cherry
106e66e475 Merge "ueventd: require opt-in for modalias handling"
am: d52b17ff0a

Change-Id: Id827bf76f889ebd996954448648365d20350ca01
2018-08-02 12:32:55 -07:00
David Anderson
0bade5b848 Merge changes from topic "liblp-blocksize"
am: d0e5bcc13f

Change-Id: I95e14110705740db955800fc05ff9b1371226cc1
2018-08-02 12:31:15 -07:00
Tom Cherry
40acb379cd Move watchdogd out of init
We're moving past a world where static executables are needed,
including watchdogd, so treat this like any other executable and place
it in /system/bin.

Bug: 73660730
Test: watchdogd still runs
Change-Id: I1f7508fd55dce6e9ee72a6ab7a085011a76c0053
2018-08-02 12:25:58 -07:00
Tom Cherry
d52b17ff0a Merge "ueventd: require opt-in for modalias handling" 2018-08-02 19:22:13 +00:00
Treehugger Robot
d0e5bcc13f Merge changes from topic "liblp-blocksize"
* changes:
  liblp: Require block-aligned partition sizes.
  liblp: Simplify GrowPartition().
2018-08-02 19:20:58 +00:00
David Anderson
4d9c7459c4 liblp: Require block-aligned partition sizes.
DM_TABLE_LOAD will reject dm-linear entries if their size is not a
multiple of the backing device's logical block size. For example, a
partition of 10GiB+512 bytes will fail to map in device-mapper if the
logical block size is 4096 bytes. To address this, this patch adds a
few changes to liblp:

The block size given to lpmake is now recorded in LpGeometryMetadata.
The block size must be a multiple of the sector size. In addition,
partiton sizes are now aligned to the block size, and the super
partition must have enough free space to allocate at least one block (in
addition to storing metadata).

GrowPartition now has multiple checks that the block-size invariant is not
violated, to ensure that no invalid partition tables will be created.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I484aac1f9b90ebd92dc1c89ce1e09cd89bbb441e
2018-08-02 10:33:41 -07:00
David Anderson
de1daa72aa liblp: Simplify GrowPartition().
The partition resize algorithm duplicates a lot of logic because it
handles the final free interval separately from other free intervals.
This is unnecessary and makes it harder to change the actual algorithm.

This change makes GrowPartition() treat the final free space region the
same as free gaps in between partitions. It does this by converting the
extent list into a gap list, and then adds a final gap for the remainder
of the free space. The resize function no longer has to treat the end of
the disk separately.

This patch does not change the way partitions are allocated, it is
purely a refactoring.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I4780f20b23fe021eac62de874b061857712c04fe
2018-08-02 09:14:47 -07:00
David Anderson
432a51dcdc Merge "liblp: Add a ResizePartition helper to MetadataBuilder."
am: ddcee93c01

Change-Id: I187c1aba212a754d282f3ec7a65f3fda549f6e28
2018-08-02 09:13:02 -07:00
Treehugger Robot
ddcee93c01 Merge "liblp: Add a ResizePartition helper to MetadataBuilder." 2018-08-02 16:01:24 +00:00