Commit graph

38345 commits

Author SHA1 Message Date
Logan Chien
602af1c488 Merge "Allow VNDK-SP extensions to use vendor lib" 2018-03-30 07:14:51 +00:00
Treehugger Robot
a5bf7bad2c Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode" 2018-03-29 21:12:46 +00:00
Treehugger Robot
61896fc0ee Merge "Enabled SYS_MODULE capability for wifi@1.0-service" 2018-03-29 20:57:42 +00:00
Josh Gao
31ed2a5c04 Merge "adbd: spawn login shell when run without a command." 2018-03-29 20:19:27 +00:00
Josh Gao
db9671090d Merge "adbd: increase oom_score_adj for adb shell" 2018-03-29 20:19:03 +00:00
Josh Gao
8043633922 Merge "adb: restore adb/adb.exe in the list of artifacts." 2018-03-29 20:18:58 +00:00
Ajit Kumar
b0fc2d743b Enabled SYS_MODULE capability for wifi@1.0-service
Add sys_module capability to enabled insmod operation.

Merged-In: I6436c3297e5318bd00ae3582549a11cb82ccbafd
Change-Id: I6436c3297e5318bd00ae3582549a11cb82ccbafd
(cherry picked from commit c2a059fbf0)
2018-03-29 19:34:06 +00:00
Christopher Ferris
95a524460a Merge "Cache DWARF location rules for a given pc." 2018-03-29 14:47:35 +00:00
David Srbecky
3386ebade2 Cache DWARF location rules for a given pc.
Decoding the DWARF opcodes is expensive so make sure we cache it.

This speeds unwinding in simpleperf by over a factor of 3x.

Add unit tests for this new behavior.

Bug: 77258731

Test: libbacktrace/libunwindstack unit tests on host and target.
Test: Ran debuggerd -b on various processes on target.
Change-Id: Ia516c0fa5d3e5f76746190bb4b6fdf49fd1c9388
2018-03-29 14:47:13 +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
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
Christopher Ferris
85d9e67361 Merge "Fix null pointer dereference in RegsArm." 2018-03-29 03:22:57 +00:00
Treehugger Robot
77a61d3e6e Merge "OWNERS for system/core/mkbootimg." 2018-03-29 00:46:36 +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
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
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
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
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
Treehugger Robot
5e7de48f03 Merge "Allow vendor-init-actionable for ro.debuggable" 2018-03-28 19:15:16 +00:00
Bowgo Tsai
017217ec57 Adding odm.img for fastboot flashall
Bug: 64195575
Test: fastboot flashall
Change-Id: Ie6c20a1004867e7c9cfa1894abab9252316a9154
2018-03-29 01:31:51 +08:00
Jaekyun Seok
4f214c5179 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
2018-03-28 12:21:03 +09:00
Treehugger Robot
c41ff1b366 Merge "Adding product.img for fastboot flashall" 2018-03-27 01:37:42 +00:00
Tom Cherry
324e27d284 Merge "Verify the SELabels used in property_contexts" 2018-03-26 23:28:30 +00:00
Treehugger Robot
3b279aa5c7 Merge "Allow android::base::ScopeGuard in STL containers" 2018-03-26 23:05:25 +00:00
Luis Hector Chavez
b77035b89a Allow android::base::ScopeGuard in STL containers
This change lets android::base::ScopeGuard be useful in STL containers
(e.g. std::vector<android::base::ScopeGuard<std::function<void()>>>). It
also provides perfect forwarding for android::base::make_scope_guard.

Bug: 34764308
Test: libbase_test

Change-Id: I7d1e5494b0f0695763cff0700efdb9ec18ae85c8
2018-03-26 13:30:09 -07:00
Martijn Coenen
80dce0127c Merge "Add new trace tag for AIDL." 2018-03-26 19:00:57 +00:00
Treehugger Robot
f78ff013d0 Merge "adb: Open FunctionFS files with more restrictive access modes" 2018-03-26 18:48:25 +00:00
Tom Cherry
882faa6448 Verify the SELabels used in property_contexts
Verify that the SELabels used in property_contexts correspond to a
real type in the SEPolicy and that this type has the property_type attribute.

Bug: 74078792
Test: Build property_contexts on bullhead successfully
Test: See failure when using a faulty SELabel in property_contexts
Change-Id: If1618c2c3dae4c0cd3efa5f88056478a6db6bd0b
2018-03-26 09:22:55 -07:00
Martijn Coenen
24426e96a5 Add new trace tag for AIDL.
So we can auto-generate tracing code for AIDL interfaces.

Bug: 74416314
Test: inspect atrace output
Change-Id: I91b14b3b16d8d7a29f531101b14ddf10dbc61a5a
Merged-In: I91b14b3b16d8d7a29f531101b14ddf10dbc61a5a
2018-03-26 09:59:21 +02:00
Bowgo Tsai
0afc6b07f1 Adding product.img for fastboot flashall
Bug: 64195575
Test: fastboot flashall
Change-Id: Ifd119650dd3316508870df0dfc770099e95ae1d1
2018-03-26 15:47:59 +08:00
Christopher Ferris
43cb7ea4ed Merge "Method to avoid skipping frames for local unwinds." 2018-03-24 19:20:16 +00:00
Josh Gao
f8a97c1f14 adb: start building windows test again.
Test: mma
Change-Id: Iea2a3055cc3642905a1bbdd18550a9fc12702da8
2018-03-23 15:37:20 -07:00
Mark Salyzyn
387319307a Merge "storaged: owner adjustment" 2018-03-23 22:01:55 +00:00
Mark Salyzyn
133c9111a3 storaged: owner adjustment
Added salyzyn@ for final owner review on adjustments to storaged.

Test: none
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Change-Id: Iac73403ea416a4820f72689f5860aa88931def06
2018-03-23 14:37:53 -07:00
Josh Gao
2e1e789e2a 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.

Test: mma with Android.bp 's/cc_test_host/cc_binary_host' hacks
Change-Id: I6582cfc61b96052537d50d8ba90533dbb66e3e1d
2018-03-23 13:03:28 -07:00
Christopher Ferris
458f4e725d Method to avoid skipping frames for local unwinds.
In cases where there might be a crash in the unwind library itself,
we need a method to avoid skipping these frames or we won't be able
to see the actual crash.

Added unit test for this behavior.

Bug: 74121887

Test: Ran unit tests on host and target.
Change-Id: I45825020c174016af39dd8ffdc67acb72a24ad4d
2018-03-23 13:01:44 -07:00
Yabin Cui
7102f7c98d Merge "Support a map that represents gdb jit elf data." 2018-03-23 17:27:58 +00:00
Treehugger Robot
3b353ed41c Merge "bootstat: refine "Kernel panic - not syncing"" 2018-03-22 23:17:40 +00:00
Mark Salyzyn
3f48fa9cb2 bootstat: refine "Kernel panic - not syncing"
Provide some easy kernel panic subreasons mined from last kmesg,
generates a canonical boot reason (system boot reason) that
may aid triage.

Notably report kernel_panic,hung if [khungtaskd] triggers on
a livelock condition, forms a signals on the dashboards.

Helper function getSubreason modified to optionally enable checking
for a single quote resulting in a refactoring to ease maintenance of
the termination detection in the face of single bit errors heuristics.

Test: boot_reason_test.sh
Bug: 63736262
Bug: 33808187
Change-Id: I7fdd1e57e7a26095738175074306f0d2d59b1d69
2018-03-22 13:57:31 -07:00
Treehugger Robot
d888e343b7 Merge changes I5fe02059,Iea8bf298,I0630c302,Ifc4b8fe9,I29319bda
* changes:
  adb: bump the local socket backlog to the maximum.
  adb: fix unicode file path test.
  adb: delete vestigial SHELL_EXIT_NOTIFY_FD.
  adb: don't immediately close a socket when write fails.
  adb: make fdevent_run_on_main_thread's fd nonblocking.
2018-03-22 03:48:38 +00:00
Josh Gao
8f7ff94762 adbd: spawn login shell when run without a command.
Match openssh's behavior with regards to login shells.

Bug: http://b/76116378
Test: `adb shell -T set -o` vs `ssh localhost -T set -o`
Test: `adb shell -tt set -o` vs `ssh localhost -tt set -o`
Test: `echo set -o | adb shell -T` vs `echo set -o | ssh localhost -T`
Test: `echo set -o | adb shell -tt` vs `echo set -o | ssh localhost -tt`
Change-Id: I6ed69b43e2ac79c947c242948b5617ece08a713e
2018-03-21 18:23:09 -07:00
Yabin Cui
d5b22c5f04 Support a map that represents gdb jit elf data.
Changes:
- Add a new flag to the libbacktrace and libunwindstack map data.
- Modify the unwinder to handle this map to use the raw pc when stepping.
- Add new unit tests for this case.

Bug: http://b/73127105
Test: Run simpleperf to unwind through jit symfiles.
Test: Run new unit tests.
Test: Run 137-cfi test on host.
Change-Id: I10bc0410680accc6d35fe51e9f1098911f667e01
2018-03-21 17:23:54 -07:00
Josh Gao
bf243a6128 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
2018-03-21 15:13:07 -07:00
Josh Gao
2c621ae741 adb: fix unicode file path test.
This test is failing due to:

     UnicodeWarning: Unicode equal comparison failed to convert both
     arguments to Unicode - interpreting them as being unequal'

Both arguments are already unicode, so stop encoding one side.

Test: python -m unittest test_device.FileOperationsTest.test_unicode_paths
Change-Id: Iea8bf29845ab3008ccf4c7dbd6969196e57ea25d
2018-03-21 15:13:07 -07:00