Commit Graph

39227 Commits

Author SHA1 Message Date
Treehugger Robot 93e4501611 Merge "adb: Retry io in case of interrupt" 2018-05-17 01:17:11 +00:00
Jerry Zhang 7531a6a167 Merge "adb: Move io_setup to usb_handle init"
am: adf07c5428

Change-Id: Id43a483266801e102796db9d6c0356b4cc918a27
2018-05-16 16:32:32 -07:00
Treehugger Robot adf07c5428 Merge "adb: Move io_setup to usb_handle init" 2018-05-16 23:25:15 +00:00
David Anderson c3f977c70e Merge "adb: warn on remount if undoing deduplication is impossible"
am: e619ebc151

Change-Id: I0556493141b2fc806b941f7cc94ee0ae0f49e86f
2018-05-16 16:09:56 -07:00
Treehugger Robot e619ebc151 Merge "adb: warn on remount if undoing deduplication is impossible" 2018-05-16 22:57:58 +00:00
Luis Hector Chavez 3255974169 adb: Add a test for emulator connection
This should prevent regressions in the future.

Bug: 78991667
Test: python system/core/adb/test_adb.py
Change-Id: I4d6da40da82c6d79797cec82ffaf071d4b56ddc7
2018-05-16 15:20:48 -07:00
Luis Hector Chavez fbee0a9133 adb: Improve test_adb a bit more
This change:

* uses unittest.main(), which allows for a subset of the tests to be
  selected.
* drops the requirement to have a device already connected since all the
  tests that need a device now spin their own mock device.
* Splits the monolithic test class into more granular classes.
* Makes this file be pylint-compliant.

Bug: None
Test: python system/core/adb/test_adb.py
Test: pylint system/core/adb/test_adb.py
Change-Id: I91c7ced520c3c69f855d639e0dbf7e57bb690e97
2018-05-16 15:20:48 -07:00
Luis Hector Chavez 454bc7c0be adb: Add a way to reconnect TCP transports
This change adds a reconnect handler that tracks all TCP transports that
were connected at some point, but became disconnected. It does so by
attempting to reconnect every 10s for up to a minute.

Bug: 74411879
Test: system/core/adb/test_adb.py
Test: adb connect chromebook:22  # This runs with sslh
Test: CtsBootStatsTestCases
Test: emulator -show-kernel ; adb -s emulator-5554 shell

Change-Id: I7b9f6d181b71ccf5c26ff96c45d36aaf6409b992
2018-05-16 15:20:48 -07:00
Jerry Zhang d8c1ae910f adb: Move io_setup to usb_handle init
Remove some redundancy by moving io_setup
into aio_block_init. The io_contexts will
now live till the end of the program, similar
to the rest of usb_handle

Test: adb works
Bug: 78793464
Change-Id: I910a39d4395645f1ff231f265c285a72893a0ac6
2018-05-16 21:47:11 +00:00
Jerry Zhang 5ba6802e9a adb: Retry io in case of interrupt
io_submit sleeps waiting for the gadget
to be enabled. Currently if that sleep
is interrupted it will shut down adb,
causing it to have to start back up again.

Rather than return EINTR if interrupted,
io_submit actually completes and the EINTR
is found later when looking through events.
Since an io that is interrupted will be
small anyway, add a loop to retry small ios.

Also upgrade aio logs in accordance with
their importance.

Fixes: 75981904
Test: adb works, logs show successful interrupt handling
Change-Id: I35973fce130ee849ce59fef80d15b65afb816ba4
(cherry picked from commit 6e9a327504)
2018-05-16 21:44:46 +00:00
David Anderson 570426aadd adb: warn on remount if undoing deduplication is impossible
A deduplicated filesystem might not have enough free space to undo its
block sharing. In this case "adb remount" should give a more precise
error message.

Bug: 64109868
Test: adb remount on deduplicated filesystem with no free space
Change-Id: I2beb67aa3dfc807cb8493b9c622e7b14174dc9c6
2018-05-16 14:18:59 -07:00
Josh Gao d2b15dd674 debuggerd: fix CrasherTest.seccomp_crash_oom.
Switch from _exit to raising SIGABRT when we recurse in the fallback
handler, so that waiters see an abort instead of a regular exit.

Bug: http://b/79717060
Test: debuggerd_test32
Test: debuggerd_test64
Change-Id: Iddee1cb1b759690adf07bbb8cd0fda2faac87571
2018-05-16 00:16:09 -07:00
Josh Gao 2744084981 adb: fix uninitialized variable in AsyncServiceRef.
Bug: none
Test: treehugger
Change-Id: I8ba0a70a772f88bfd701730a48d4eb32c6677b9e
2018-05-15 23:43:50 -07:00
George Burgess IV 487de27345 Simplify code
The static analyzer is concerned about the strcpys below this, since it
apparently doesn't try to model snprintf's potential behaviors. (In
particular, it was concerned that suffixLen might be >=
sizeof(suffixBuf)). While that's clearly suboptimal, this code can also
be simplified to make it more obvious what's happening and to appease
the analyzer.

No functionality change is intended.

Bug: None
Test: Ran the analyzer. It's no longer angry about strcpy overflows.

Change-Id: I4aa812144c90f6d3e833bbcb23c0694476a0e53e
2018-05-16 03:06:59 +00:00
Inseob Kim 67cb05654c Support product-specific libraries
Product-specific libraries in /product/lib can be exposed to Android
apps by adding the list of the libs into
/product/etc/public.libraries-<companyname>.txt. The libs MUST be named
as lib<name>.<companyname>.so.

Bug: 73095206
Test: with taimen
mma -j and runtest.sh. The libs are all loaded in system, but not in
vendor. After reinstalling app using adb -r and reopening app, only
libraries listed in .txt are loaded

Change-Id: I7c386813c72a7b225a7f244b6c5fec4ac0660fd3
2018-05-16 01:36:25 +00:00
Yabin Cui 74f41ee7e7 Merge "libprocinfo: fix mac build."
am: 3464bc4b43

Change-Id: Ic2919028f90b3fa8239ae4ed5fe5cd0eada7d4d1
2018-05-15 13:26:31 -07:00
David Anderson 4bf937157d Merge "init/fs_mgr: prototype first-stage dm-linear support"
am: 3e946da535

Change-Id: I79fd25d997b451807f9f8ed6ba4145c24defc631
2018-05-15 13:25:36 -07:00
Yabin Cui 3464bc4b43 Merge "libprocinfo: fix mac build." 2018-05-15 19:58:06 +00:00
Yabin Cui edac5e3b25 libprocinfo: fix mac build.
Bug: none
Test: build.
Change-Id: Ic25d873d9d74edc8320b75d077536055f176c0dd
2018-05-15 12:51:57 -07:00
David Anderson 3e946da535 Merge "init/fs_mgr: prototype first-stage dm-linear support" 2018-05-15 18:57:08 +00:00
Yabin Cui 8db422f20f Merge "libprocinfo: add functions reading process map file."
am: 0f837fe8ca

Change-Id: I8e6fee39688af42dc87221270f8c5a0d8afa9b49
2018-05-15 11:11:36 -07:00
Yabin Cui 0f837fe8ca Merge "libprocinfo: add functions reading process map file." 2018-05-15 18:01:56 +00:00
Josh Gao c4c55853f0 Merge "adb: fix double close in jdwp_service."
am: da6ab73420

Change-Id: Ifcf07cefa0279b8f4c8ac4d55db46b6701b86595
2018-05-14 19:05:11 -07:00
Treehugger Robot da6ab73420 Merge "adb: fix double close in jdwp_service." 2018-05-15 01:52:29 +00:00
Colin Cross 35c36f32de Merge "Make memunreachable_test more robust against false negative leaks"
am: 32fcdf8de2

Change-Id: I6363c1f2ed8243292afc567b86e77f50d769522d
2018-05-14 18:18:30 -07:00
Treehugger Robot 32fcdf8de2 Merge "Make memunreachable_test more robust against false negative leaks" 2018-05-15 01:03:01 +00:00
Jiyong Park 612210c75b Mark as recovery_available: true
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. toybox) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.

Bug: 67916654
Bug: 64960723
Test: m -j
Change-Id: Ie59155c08890e96ce1893fa3687afcf763d7aea3
2018-05-15 09:47:04 +09:00
Josh Gao b7a9956cbc adb: fix double close in jdwp_service.
Bug: http://b/78793027
Test: treehugger
Change-Id: Ie66d12e70bdaf09148e3d672e3c7c3da9e8ab2fe
2018-05-14 17:13:47 -07:00
Colin Cross ca71f170b7 Make memunreachable_test more robust against false negative leaks
For some reason, the memunreachable tests are rock solid on the
devices covered by APCT, but catch a ton of false-negatives on
hikey960, which show up as failures that look like:
system/core/libmemunreachable/tests/MemUnreachable_test.cpp:200: Failure
Expected equality of these values:
  1U
    Which is: 1
  info.leaks.size()
    Which is: 0

These happen when a stray copy of a pointer is lying around that
points to the memory it is expected to leak.  The stray pointers
can be on the stack or in the jemalloc thread cache of freed
allocations, which is always considered active memory.

Add some extra cleanups to get rid of old pointers.
1.  Clear the tcache when destructing UnreachableMemoryInfo
2.  Clear the stack and tcache before and after each test
3.  Make MemunreachbleTest.twice match MemunreachableTest.stack

Also fix MemunreachableTest.notdumpable, which was only passing
when run as root, which was bypassing what the test was trying
to cover.  Make the test pass when run as non-root, and skip
when the test is running as root.

Bug: 79701104
Test: memunreachable_test
Test: memunreachable_test as root
Change-Id: Ia6c6df11e76405d08118afcc19c1fe80a6684c56
2018-05-14 15:24:28 -07:00
David Anderson e36d4d53d0 Merge "adb: better error messages on deduplicated filesystems."
am: 313aa7172f

Change-Id: I0b783dd17db01849cadb929c0234f4bf0eecb61d
2018-05-14 14:14:37 -07:00
Chih-hung Hsieh de8b9c5eeb Merge "Expect optional (offset ...) in frame dump."
am: 4578d132c7

Change-Id: I0e49ba91d508f0b63ee2bb1019dba4461df25537
2018-05-14 14:13:23 -07:00
Treehugger Robot 313aa7172f Merge "adb: better error messages on deduplicated filesystems." 2018-05-14 21:10:34 +00:00
Yabin Cui 3841accba8 libprocinfo: add functions reading process map file.
Add test and benchmark.
Also switch libbacktrace, libunwindstack, libmemunreachable
to use libprocinfo for map file reading.
The benchmark shows using libprocinfo speeds up map file reading
in libbacktrace and libunwindstack 18% - 36% on walleye.

Bug: http://b/79118393
Test: run procinfo_test.
Test: run libunwindstack_test.
Test: run libbacktrace_test.
Test: run memunreachable_test.

Change-Id: Icf281c352f4103fc8d4ba6732c5c07b943330ca1
2018-05-14 14:00:18 -07:00
Chih-hung Hsieh 4578d132c7 Merge "Expect optional (offset ...) in frame dump." 2018-05-14 20:51:42 +00:00
David Anderson 62e5b20b50 init/fs_mgr: prototype first-stage dm-linear support
This adds an API to fs_mgr for reading dm-linear tables out of device trees
and issuing device-mapper ioctls. The device tree code will be
implemented separately. The dm-linear structures in fs_mgr are organized
assuming we may want to pull them from sources other than DT (for
example, text files, binary blobs, or something hardcoded for testing).

File systems which are mounted from these logical partitions have
specific fstab requirements. The block device must be a partition name,
and if Verified Boot is used, that name must match the vbmeta partition name.
Second, the entry must have the "logical" fs_mgr flag. Example fstab
entry:

    vendor  /vendor  ext4  ro  wait,logical

Example fstab entry in device tree:

    vendor {
        compatible = "android,fstab";
        dev = "vendor";
        type = "ext4";
        mnt_flags = "ro";
        fs_mgr_flags = "wait,slotselect,avb,logical";
    };

Bug: 78914864
Test: N/A
Change-Id: I4d8878ea8858f26310119616cadc3ee0dd08566c
2018-05-14 12:43:42 -07:00
Chih-Hung Hsieh 3249b3a8dd Expect optional (offset ...) in frame dump.
* New lld could create files that map to non-zero
  offset at run time.

Test: debuggerd_test
Bug: 79590156
Change-Id: I12db0ebef489ba8a1e648a29d214f8d3c3703996
2018-05-14 11:07:54 -07:00
Mark Salyzyn 421a05dda4 Merge "init: keychord inotify add IN_ONLYDIR"
am: c8dd6b74e6

Change-Id: I876090858fd38c16456a93d5da196b8cf57975b1
2018-05-14 09:20:15 -07:00
Mark Salyzyn c8dd6b74e6 Merge "init: keychord inotify add IN_ONLYDIR" 2018-05-14 16:08:14 +00:00
Mark Salyzyn f187715954 init: keychord inotify add IN_ONLYDIR
some minor cleanup.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: If809075445cfd5b6de0d4debc42cdc9559ddc7c4
2018-05-14 07:18:51 -07:00
David Anderson a962ec0c73 adb: better error messages on deduplicated filesystems.
If BOARD_EXT4_SHARE_DUP_BLOCKS is true, "adb remount" will error saying
the filesystem is read-only. Instead, it will now list affected
partitions and explain why they can't be remounted.

Bug: 64109868
Test: adb remount with deduplicated system image
Change-Id: Ida737a6be8e9fe9ea26300897d82b1a149e72f6d
2018-05-11 13:20:31 -07:00
Sen Jiang b4403da532 Merge "Match LZMA SDK 18.05 API."
am: 3607fe672a

Change-Id: Ic9131a5bf07b30fc8f2986ecf3c7fa88823971f9
2018-05-11 12:07:48 -07:00
Sen Jiang 3607fe672a Merge "Match LZMA SDK 18.05 API." 2018-05-11 18:58:58 +00:00
Mark Salyzyn 205cf8aefb Merge "init: Add inotify for /dev/input/"
am: 7ea8047185

Change-Id: Ib1d5308f1964f8a7ea1bab260dae7e1e8dc11317
2018-05-10 12:55:56 -07:00
Mark Salyzyn 7ea8047185 Merge "init: Add inotify for /dev/input/" 2018-05-10 19:44:44 +00:00
Mark Salyzyn 44692de855 init: Add inotify for /dev/input/
Since event sources can come and go asynchronously because of delayed
driver instantiation due to initialization or firmware upload, USB
attched devices, kernel module loads, or test automation sources like
monkey, add in inotify on /dev/input/ to support these possibilities.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: Ie598bb6f5bf94b2034ab33cf3be7fa15d3467141
2018-05-10 08:45:24 -07:00
Tom Cherry 841e457494 Merge "Remove unused using statement / host stub"
am: 86dade8f6f

Change-Id: I85a7c6dd4485fc0e6885e4c2b93f2908474cbda0
2018-05-09 17:23:38 -07:00
Treehugger Robot 86dade8f6f Merge "Remove unused using statement / host stub" 2018-05-10 00:07:50 +00:00
Tom Cherry 2fa178a01e Remove unused using statement / host stub
GetIntProperty() isn't used after
Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93, so it can be removed.

Test: build
Change-Id: I5736f553db1a615d51b8fe3cbf9b4aee89451076
2018-05-09 15:25:39 -07:00
Josh Gao ec0dd9b71f Merge "adb: add authorizing, connecting states to transport."
am: c97cea0d20

Change-Id: Ie42bbe9205660c59d144563bb7b71377df9fbed1
2018-05-09 13:48:59 -07:00
Josh Gao c97cea0d20 Merge "adb: add authorizing, connecting states to transport." 2018-05-09 20:43:31 +00:00