Commit graph

40554 commits

Author SHA1 Message Date
Christopher Ferris
8dc3f94113 Merge "Fix null pointer dereference in RegsArm." into pi-dev 2018-03-29 14:35:05 +00:00
Logan Chien
8667747a0e Allow VNDK-SP extensions to use vendor lib
This commit adds a wildcard linker namespace link between the "vndk"
namespace and the "sphal" namespace of the system processes.  This is
created for VNDK-SP-Ext to load vendor libs in "sphal" namespace.

Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8  # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8  # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I71b0fb604a84272156aa119130c272f891847008
2018-03-29 17:18:40 +08:00
Josh Gao
83ebd8da84 adb: fix windows test build.
The switch over to soong unintentionally turned off building the
Windows tests (and there's a bug preventing them from being turned on).
Preemptively fix the build breakages that'll happen when we turn them
back on.

Bug: http://b/74616284
Test: mma with Android.bp 's/cc_test_host/cc_binary_host' hacks
Change-Id: I6582cfc61b96052537d50d8ba90533dbb66e3e1d
(cherry picked from commit 2e1e789e2a)
2018-03-28 23:36:38 -07:00
Josh Gao
abb634308f adb: bump the local socket backlog to the maximum.
The listen backlog seems to be more meaningful on Darwin than on Linux,
resulting in connections failing with ECONNRESET. Bump it up to the
maximum supported value to make this less likely. 128 pending
connections ought to be enough for anybody.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: I5fe0205924188cf18ca1fc1204f923ab5523eeb2
(cherry picked from commit bf243a6128)
2018-03-28 23:36:34 -07:00
Josh Gao
cc9414eda4 adb: delete vestigial SHELL_EXIT_NOTIFY_FD.
There exists no path through which a value other than -1 can be written
to the SHELL_EXIT_NOTIFY_FD.

Bug: http://b/74616284
Test: adb_test
Test: adbd_test
Test: python test_device.py
Change-Id: I0630c302ba06bc76917f0445aea75d2dbe1dc865
(cherry picked from commit dcc055af64)
2018-03-28 23:36:32 -07:00
Josh Gao
7c87b0739a adb: don't immediately close a socket when write fails.
When we fail to write to a local socket peer, we might still have data
queued up to send to the other side. Defer closing the socket until
we've failed to both read and write.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: Ifc4b8fe95369b4872e475c2ae4ee611dd2d8b9d7
(cherry picked from commit 184f480547)
2018-03-28 23:36:28 -07:00
Josh Gao
3b0146cc37 adb: make fdevent_run_on_main_thread's fd nonblocking.
If we get a ton of fdevent_run_on_main_thread calls while running one
of the handlers, the socket might become full, which will result in a
deadlock in fdevent_run_on_main_thread when a write to the fd blocks
with the mutex taken. Resolve this by making the fd nonblocking, which
is safe because we always write after appending to the list, and read
before emptying the list, which guarantees that if the byte we write is
consumed, the std::function we appended will be run.

Bug: http://b/74616284
Test: adb_test
Test: python test_device.py
Change-Id: I29319bda2ad7b5a5cdcd91d1d0ddf39f7ab7d115
(cherry picked from commit 1222abc75b)
2018-03-28 23:36:24 -07:00
Josh Gao
9edb94fb6b adb: skip IPv6 test if IPv6 isn't available.
Bug: http://b/69813298
Test: none
Change-Id: I0793e793bd52c5f1c639faedf09a513df263db78
(cherry picked from commit 4abb5074be)
2018-03-28 23:36:20 -07:00
Josh Gao
fd6ffb8ad5 adb: add adb shell exit 42 stress test.
Add a test to hammer on `adb shell exit $n` for flakiness.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: I6a842960f5b55ff739044698f5c9683992fc42f1
(cherry picked from commit c970aefada)
2018-03-28 23:36:17 -07:00
Josh Gao
e523e4e54b adb: improve socket tests.
Make it so that the socket tests don't leak until your machine blows up
by switching an infinite loop into an assertion failure.

Bug: http://b/74616284
Test: adb_test
Change-Id: If618c26b224b660548454f542cab79bebe46f80e
(cherry picked from commit ecb96ac04d)
2018-03-28 23:36:14 -07:00
Josh Gao
28589bbe18 adb: implement std::make_unique, start using it.
Add an implementation of std::make_unique for Windows, where we're
currently stuck with C++11, and switch some uses of new over to it.

Bug: http://b/74616284
Test: treehugger
Change-Id: I99b85f07754adda7c525243480c3e0bce9a25ce7
(cherry picked from commit 31b5be69f4)
2018-03-28 23:36:12 -07:00
Josh Gao
1430d39be6 adb: add test for flushing socket data after a write failure.
Add a currently failing test that's a reduced case of the 'concurrent
adb shell' flakiness reported in b/74616284.

Bug: http://b/74616284
Test: changed #if 0 to #if 1, test fails
Change-Id: Id170a185f7c5d2ff44f772f7849a73227f9df441
(cherry picked from commit df3bae9f06)
2018-03-28 23:36:09 -07:00
Jaekyun Seok
1f90ccefb6 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
2018-03-29 14:54:51 +09:00
Bowgo Tsai
d3ebdd003b [automerger skipped] Merge "Adding odm.img for fastboot flashall" into pi-dev
am: 6c4ed57065  -s ours

Change-Id: I72ae9fe578da0416d8834249bf9e869ab0813221
2018-03-29 04:12:23 +00:00
TreeHugger Robot
6c4ed57065 Merge "Adding odm.img for fastboot flashall" into pi-dev 2018-03-29 04:07:32 +00:00
Christopher Ferris
fd6b7284ee Fix null pointer dereference in RegsArm.
Fix RegsArm::GetPcAdjustment to check for an invalid elf before trying
to read memory.
Modify the tests for this so it crashes without this change.

Also modify the GetPcAdjustment for all different architectures so
that unless the relative pc is too small, it will return the minimum
amount that should be adjusted. This is to handle cases where we still
want to adjust the pc but it's in an invalid elf. Mostly this is for
handling cases when the pc is in jit gdb debug code so that we use the
right unwind information.

Bug: 77233204

Test: Passes unit tests for libbacktrace/libunwindstack.
Change-Id: Id73609adaf3b80a583584441de228156fec3afa7
(cherry picked from commit 6dbc28ece3)
2018-03-28 20:52:52 -07:00
Christopher Ferris
1c12571fb6 Merge "Fix null pointer dereference in RegsArm." am: 85d9e67361
am: 80e8231a0b

Change-Id: Ie7a3d60c5d8d4e2b9e4e5141f176d1e3e2e0457a
2018-03-29 03:35:18 +00:00
Christopher Ferris
80e8231a0b Merge "Fix null pointer dereference in RegsArm."
am: 85d9e67361

Change-Id: Ic560cfe4af12ad43ba6a03bacb54e25ebd60e31f
2018-03-29 03:31:40 +00:00
Christopher Ferris
85d9e67361 Merge "Fix null pointer dereference in RegsArm." 2018-03-29 03:22:57 +00:00
Elliott Hughes
1781459f96 Merge "OWNERS for system/core/mkbootimg." am: 77a61d3e6e
am: 4531d73c0a

Change-Id: I49354165f563628a41596df392c32ec5714efd11
2018-03-29 01:56:44 +00:00
Elliott Hughes
4531d73c0a Merge "OWNERS for system/core/mkbootimg."
am: 77a61d3e6e

Change-Id: I8950d17b8fef16ada60e279fb549cd50c71b13e5
2018-03-29 01:37:56 +00:00
Treehugger Robot
77a61d3e6e Merge "OWNERS for system/core/mkbootimg." 2018-03-29 00:46:36 +00:00
Hridya Valsaraju
7cc1d44b94 Merge changes from topic "recovery_dtbo" am: 3ac694632c
am: c9dffd158c

Change-Id: I67b8109939874babfb594071e3b268d0b7142e7b
2018-03-29 00:35:24 +00:00
Hridya Valsaraju
82be5dc7c6 Add a recovery DTBO section to boot image am: 147b355bb3
am: 86f4bafa5e

Change-Id: I8c0a7b66977c002987546d338046d2d32c57017d
2018-03-29 00:35:03 +00:00
Elliott Hughes
9087594a79 Merge "Add "require partition-exists=" support." am: 539f3ddff5
am: fea8b41aa1

Change-Id: I1a69d7c96f4b417a33d5e2d015595715401e7b14
2018-03-29 00:30:06 +00:00
Josh Gao
d8ff614f69 Merge changes Iea2a3055,I6582cfc6 am: 45562bfb63
am: 54b603ee56

Change-Id: I7fd99aa08ac1911eba06255a77e693d76b3d06ee
2018-03-29 00:29:35 +00:00
Hridya Valsaraju
c9dffd158c Merge changes from topic "recovery_dtbo"
am: 3ac694632c

Change-Id: I684c39d4381f93e5ae3df7af21a6a60c2899b15d
2018-03-29 00:29:29 +00:00
Hridya Valsaraju
86f4bafa5e Add a recovery DTBO section to boot image
am: 147b355bb3

Change-Id: I01cba4d0bdb21a533c5c76f9e71993c6f2f0f7cc
2018-03-29 00:29:01 +00:00
Elliott Hughes
fea8b41aa1 Merge "Add "require partition-exists=" support."
am: 539f3ddff5

Change-Id: If07bf31027fab8c4b341c9bc6de907cff94e2c7f
2018-03-29 00:27:36 +00:00
Josh Gao
54b603ee56 Merge changes Iea2a3055,I6582cfc6
am: 45562bfb63

Change-Id: Ic1e986c5554bcb191b025afec41fc051f9714574
2018-03-29 00:27:09 +00:00
Christopher Ferris
6dbc28ece3 Fix null pointer dereference in RegsArm.
Fix RegsArm::GetPcAdjustment to check for an invalid elf before trying
to read memory.
Modify the tests for this so it crashes without this change.

Also modify the GetPcAdjustment for all different architectures so
that unless the relative pc is too small, it will return the minimum
amount that should be adjusted. This is to handle cases where we still
want to adjust the pc but it's in an invalid elf. Mostly this is for
handling cases when the pc is in jit gdb debug code so that we use the
right unwind information.

Bug: 77233204

Test: Passes unit tests for libbacktrace/libunwindstack.
Change-Id: Id73609adaf3b80a583584441de228156fec3afa7
2018-03-28 17:21:01 -07:00
Bowgo Tsai
de2472d63e Adding odm.img for fastboot flashall
Bug: 64195575
Test: fastboot flashall
Change-Id: Ie6c20a1004867e7c9cfa1894abab9252316a9154
Merged-In: Ie6c20a1004867e7c9cfa1894abab9252316a9154
(cherry picked from commit 017217ec57)
2018-03-29 08:18:37 +08:00
Treehugger Robot
3ac694632c Merge changes from topic "recovery_dtbo"
* changes:
  Add a script to unpack boot image
  Add a recovery DTBO section to boot image
2018-03-29 00:02:57 +00:00
Elliott Hughes
539f3ddff5 Merge "Add "require partition-exists=" support." 2018-03-28 23:25:24 +00:00
Jaekyun Seok
55629d1300 [automerger skipped] Allow vendor-init-actionable for ro.debuggable
am: fce960cdf4  -s ours

Change-Id: If72d9fcb40bc79137e9290dd1bb0a27fa14b0ba4
2018-03-28 22:54:36 +00:00
Josh Gao
2de2ade387 adbd: increase oom_score_adj for adb shell
Previously, processes started via `adb shell` have an oom_score_adj of
-1000, making them invisible to the oom killer. This makes running a
process that consumes all memory (e.g. by leaking in a loop) lead to
the entire rest of the system (including adbd, because of bad
heuristics in the kernel) being oom killed before getting to it.

Bug: http://b/63143027
Test: `adb shell cat /proc/self/oom_score_adj` with adb root
Change-Id: I59111134e36dc271adf4c1dd4bd4400d4fe6aee0
2018-03-28 15:01:23 -07:00
Treehugger Robot
45562bfb63 Merge changes Iea2a3055,I6582cfc6
* changes:
  adb: start building windows test again.
  adb: fix windows test build.
2018-03-28 21:59:33 +00:00
Elliott Hughes
d08c9102d6 OWNERS for system/core/mkbootimg.
Bug: N/A
Test: N/A
Change-Id: I9007898e29727892a166f4445c9b112987a97d7d
2018-03-28 14:48:59 -07:00
Bowgo Tsai
85fc6a91c0 Merge "Adding odm.img for fastboot flashall" am: cdc553d042
am: b526c2f785

Change-Id: I77d339294f116cbdd1279442b59e6ca8b295e175
2018-03-28 21:29:48 +00:00
Jaekyun Seok
da4b0a27fb Merge "Allow vendor-init-actionable for ro.debuggable" am: 5e7de48f03
am: 000e274f9a

Change-Id: I266c01a444a76b2de3378399a5b6c0fc154b901f
2018-03-28 21:27:23 +00:00
Hridya Valsaraju
02c08cc347 Add a script to unpack boot image
The script prints out the boot image header
contents and extracts the kernel, ramdisk,
second bootloader and recovery DTBO images.

Bug: 74763691
Test: unpack_bootimg --boot_img $OUT/recovery.img

Change-Id: Iadbca81c157d9e4607f808a14468ab5542347507
2018-03-28 21:25:41 +00:00
Bowgo Tsai
b526c2f785 Merge "Adding odm.img for fastboot flashall"
am: cdc553d042

Change-Id: Ieec9dd04d8dbc3fcf348a118529f168f710426cf
2018-03-28 20:58:12 +00:00
Jaekyun Seok
000e274f9a Merge "Allow vendor-init-actionable for ro.debuggable"
am: 5e7de48f03

Change-Id: Ib5b96ecd02860cc66f84defd1f0dcf8830d9e11d
2018-03-28 20:54:51 +00:00
Josh Gao
541a8656c4 adb: restore adb/adb.exe in the list of artifacts.
Test: m dist
Change-Id: Iba44a03e79af9242bfe36efb736496f8db720ebf
2018-03-28 12:57:48 -07:00
Hridya Valsaraju
147b355bb3 Add a recovery DTBO section to boot image
For non-A/B devices, the recovery partition should
be self-sufficient and not depend on any other
partition. Since recovery may need access to devices
added to the DT by overlays(for eg.display), we need to
make sure that the the recovery image also contains
the information from the DTBO image.

The following fields are added to the boot image
header for this purpose:
-boot header version
-header size
-recovery dtbo size
-recovery dtbo address

Bug: 74763691
Test: unpack_bootimage --boot_img $OUT/recovery.img
      diff out/extracted_dtbo $TOP/device/google/wahoo-kernel/dtbo.img

Change-Id: I1969859038b84fac1e4a71f79f2f546b9cacffc8
2018-03-28 12:53:21 -07:00
Elliott Hughes
5620d224b6 Add "require partition-exists=" support.
The Pixel 2 system images release was a bit of a disaster because anyone
using an old version of fastboot would blindly flash too few partitions,
potentially bricking their device. This change lets us add a line to
the android-info.txt file for a device with a new partition.

Also error out sooner in such cases by checking the requirements
immediately, rather than optimistically unpacking everything first.

Switch Action over to C++ to fix memory issues.

Bug: http://b/77158188 (partition checking)
Bug: http://b/74444116 (error out sooner)
Test: manual testing with a modified android-info.txt
Change-Id: I58b426cad410107e368f35f5725216d07281dd97
2018-03-28 12:43:53 -07:00
Treehugger Robot
cdc553d042 Merge "Adding odm.img for fastboot flashall" 2018-03-28 19:42:30 +00:00
Jaekyun Seok
fce960cdf4 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
Merged-In: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
(cherry picked from commit 4f214c5179)
2018-03-29 04:21:22 +09:00
Treehugger Robot
5e7de48f03 Merge "Allow vendor-init-actionable for ro.debuggable" 2018-03-28 19:15:16 +00:00
Tom Cherry
87f114d3f3 Merge "Revert "fs_config: Move hostapd to /vendor/bin/hw"" into pi-dev
am: 36a716dc1f

Change-Id: Id8dad48e5fe42e8671bf2ceb1fcdbc28cb087ffc
2018-03-28 18:45:07 +00:00