Commit Graph

37792 Commits

Author SHA1 Message Date
Yi Kong 370d2e02e0 Merge "Use correct format specifier" 2018-01-03 19:49:08 +00:00
Yi Kong 21c515ad1c Use correct format specifier
Discovered by the upcoming compiler update.

Test: m checkbuild
Change-Id: I8dd4bb711bfa4f4b71a3345a2ee38f689cee5257
2017-12-27 13:42:49 -08:00
Treehugger Robot 93d344d98c Merge "zip_archive: Fix a few more badly written tests." 2017-12-27 11:35:20 +00:00
Narayan Kamath c36b80928b zip_archive: Fix a few more badly written tests.
Fix failures in DataDescriptor related tests due to to a bad call to
SetZipString (undefined behaviour). Also fix a typo in the test for
invalid descriptors, we were asserting things on the wrong array.

Test: zip_archive_test
Change-Id: I8c9a632443fdf1d5c115670d6e9317e1f4bf6ef4
2017-12-27 09:42:00 +00:00
Treehugger Robot 2da01a2a71 Merge "debuggerd: restore the location of abort message." 2017-12-23 00:17:34 +00:00
Treehugger Robot 1f3b605c41 Merge "debuggerd: wait for dump completion on crashes." 2017-12-23 00:11:34 +00:00
Josh Gao 34c2556d11 debuggerd: restore the location of abort message.
The abort message was accidentally relocated to be printed below the
registers, backtrace, and stack, which isn't very helpful. Move it back
to its rightful place.

Test: treehugger
Change-Id: I8aa5b63e58081f27ccdb42481fed8d9eb3a892a4
2017-12-22 14:20:12 -08:00
Josh Gao 7302097e77 debuggerd: wait for dump completion on crashes.
When a process crashes, both ActivityManager and init will try to kill
its process group when they notice. The recent change to minimize the
amount of time a process is paused results in crash dumps being killed
before they finish as a result of this. Since anything that needs to be
low-latency is probably not going to be too happy if it crashes, just
wait for completion whenever we're processing a real crash.

Bug: http://b/70343110
Test: debuggerd_test
Change-Id: I894bb06efd264b1ba005df06f7326a72f4b767bb
2017-12-22 14:20:12 -08:00
Narayan Kamath 18f25d399e Merge "Get rid of unneeded allocations in Extract...() APIs" 2017-12-22 10:41:41 +00:00
Narayan Kamath 492de535c4 Merge "zip_archive: Fix tests broken by 1f93d71022cca7bb6bb9eec49." 2017-12-22 10:41:17 +00:00
Shawn Willden 8edf81d50f Merge "Add swillden and dkrahn to OWNERS" 2017-12-21 20:47:23 +00:00
Shawn Willden 10ed6fcc85 Add swillden and dkrahn to OWNERS
Test: N/A
Change-Id: I0d3fd54af475ee9184eb44de689b821c450b874f
2017-12-21 12:45:24 -08:00
Narayan Kamath f37bb8e45b zip_archive: Fix tests broken by 1f93d71022.
Moving to std::hash changed iteration order but these tests should
not have relied on hash_map iteration order anyway.

Test: zip_archive_test

Change-Id: I712bf2307c8770f03ea6f074bfc506a40cdcb066
2017-12-21 12:55:59 +00:00
Ivan Lozano 9ddf491492 Merge "Fix sanitizer errors in bootstat.cpp." 2017-12-21 06:42:55 +00:00
Treehugger Robot 3b7998aaa1 Merge "Convert autosuspend_wakeup_count.c to cpp" 2017-12-21 03:24:16 +00:00
Logan Chien b00ed37a66 Merge "Separate VNDK libs into another linker namespace" 2017-12-21 01:32:04 +00:00
Steve Paik db88774631 Convert autosuspend_wakeup_count.c to cpp
Change this file to cpp before cleaning it up.

Bug: 70669809
Test:  Suspend works
Change-Id: Ice927dbb205447a94f33b417e32f7c2cd79613eb
2017-12-20 17:02:31 -08:00
Andrew Chant d8dc605d6c Merge "usblib: usb_device_get_string decoding fixes." 2017-12-21 00:09:25 +00:00
Christopher Ferris 7c20a6cd7c Merge "Add tool to save information from a process." 2017-12-20 23:20:39 +00:00
Ivan Lozano 44d3cacfce Fix sanitizer errors in bootstat.cpp.
Integer overflow sanitized builds are throwing an error on the while
loop decrement in the rfind function. This refactors the loop to prevent
decrementing the value on the final iteration.

Test: Compiled and device boots without runtime error.
Bug: 30969751
Change-Id: Ice4532cce933062b3c14adf2d9749cfdea4ad84c
Merged-In: Ice4532cce933062b3c14adf2d9749cfdea4ad84c
2017-12-20 14:59:19 -08:00
Tomasz Wasilczyk d535a9cab9 Merge "Use LOG_TAG instead of binary name as a tag." 2017-12-20 21:28:29 +00:00
Christopher Ferris 3dfd2aea7a Add tool to save information from a process.
Also, modify the ProcessVmRead function to allow arbitrarily large
reads and add a test for it.

Test: Run tool and verify the output can be used to do an offline
Test: unwind.
Test: Ran unit tests.
Change-Id: I0974ddca4f5cf72b4c9fa29b597a0a669e223828
2017-12-20 12:57:01 -08:00
Elliott Hughes dbbba76f88 Merge "Add std::string StartsWith*/EndsWith* overloads." 2017-12-20 20:21:55 +00:00
Tomasz Wasilczyk c251600102 Use LOG_TAG instead of binary name as a tag.
If LOG_TAG was not defined, falling back to a default
behaviour (using binary name).

Bug: 35361699
Test: manual
Change-Id: I209a6ebaf0df882f98642f6d1831766cb296c951
2017-12-20 10:59:46 -08:00
Yurii Zubrytskyi 834326ce7a Get rid of unneeded allocations in Extract...() APIs
Both Extract...() functions don't need dynamic allocation
for the writers, as those are strictly scoped. This CL
changes heap allocation to stack allocation.

Test: zip_archive_test

Change-Id: Id727e4b9848235cd063cc67ecbe052d21ca21326
2017-12-20 18:36:03 +00:00
Elliott Hughes 579e682628 Add std::string StartsWith*/EndsWith* overloads.
We should have done this from the beginning. Thanks to Windows, we're not
going to be able to switch libbase over to std::string_view any time soon.

Bug: N/A
Test: ran tests
Change-Id: Iff2f56986e39de53f3ac484415378af17dacf26b
2017-12-20 09:42:22 -08:00
Treehugger Robot df9fbc7d75 Merge "base: extract {ASSERT,EXPECT}_MATCH helpers from debuggerd_test." 2017-12-20 03:24:39 +00:00
Tom Cherry e6b83cfe5a Merge "Only apply match if there is something to apply" 2017-12-20 03:20:53 +00:00
Treehugger Robot 1b4ab8bc39 Merge "debuggerd: add pause time benchmark." 2017-12-20 02:43:31 +00:00
Treehugger Robot 3388af49e6 Merge "/vendor/lib/hw is removed from search paths for vendor default ns" 2017-12-20 02:19:14 +00:00
Josh Gao 30171a8b47 base: extract {ASSERT,EXPECT}_MATCH helpers from debuggerd_test.
Add some helper macros that perform regex string matching to
<android-base/test_utils.h>.

Test: libbase_test32/64 on host
Change-Id: I1b0f03dc73f8b4fdfb8ac6c75d59ef421e0e9640
2017-12-19 17:16:12 -08:00
Tom Cherry f5ed661f72 Only apply match if there is something to apply
It is possible for a match to only contain a context and not a schema,
or vice versa and in this case, the previously matched values should
continue to be used.  The serializer already handles this case by
setting the index of the match to ~0u if there is not one, so this
change simply has the parser skip these values.

Bug: 70858511
Test: unit tests, including new ones
Change-Id: Ibc65bd8d637e39f3b1ce7bcc2b88189b75173f88
2017-12-19 16:47:21 -08:00
Josh Gao a42314e436 debuggerd: add pause time benchmark.
Add a benchmark to measure how long we pause a process when dumping.

Bug: http://b/62112103
Test: manually ran it
Change-Id: Iceec2f722915b0ae26144c86dcbeb35793f963da
2017-12-19 16:36:04 -08:00
Andrew Chant 8ea8101b04 usblib: usb_device_get_string decoding fixes.
usb_device_get_string converts incoming ucs-2 text
to ascii by truncating the upper byte of each
character.  This is error prone.

This patch introduces usb_device_get_string_ucs2
to access raw USB string descriptors, as well as
changes usb_device_get_string to replace any non
ascii character with '?'.

Bug: 70163357
Change-Id: If8f98fee4be6ea75dc0f7ce7beba7fd7b6aabf88
Merged-In: If8f98fee4be6ea75dc0f7ce7beba7fd7b6aabf88
Test: Connected & disconnected a NuForceDAC.
2017-12-19 22:20:51 +00:00
Treehugger Robot 51c2088f3b Merge "Usage suggestions." 2017-12-19 20:32:29 +00:00
Yabin Cui e1d9e7c343 Merge "libBacktraceOffline: improve unwinding callchains." 2017-12-19 18:26:00 +00:00
James Hawkins e3114fdec9 Merge "bootstat: Add tons of new boot reasons." 2017-12-19 17:19:48 +00:00
Treehugger Robot ad5ed892a7 Merge "Support partners to expose their own system libs to Android apps" 2017-12-19 16:21:29 +00:00
Jiyong Park d1006fe659 Support partners to expose their own system libs to Android apps
Partners (entities other than AOSP) can expose their own system
libraries which are in /system/lib[64] to Android apps. This can be done
by adding the name of the libs into the files
/system/etc/public.libraries-<companyname>.txt.

There can be multiple of the txt files on a device, which is for the
case that multiple partners contributing to the same system image
have their own set of public libraries.

The public libraries MUST be named as lib<name>.<companyname>.so. This
is to prevent accidental exposure of AOSP-defined system private libs.

Note 1:
<companyname> doesn't need to be the same as the value of the sysprop
ro.product.manufacturer or anything that can be part of a file path.

Note 2:
This feature is not for exposing SoC-specific libs to Android apps. That
is already done by /vendor/etc/public.libraries.txt and is only for
libs in /vendor/lib[64].

Bug: 68280171
Test: mm -j under /system/core/libnativeloader/test
cts-tradefed run commandAndExit cts-dev -m CtsJniTestCases -t
android.jni.cts.JniStaticTest#test_linker_namespaces

Change-Id: I7d32ec27c7858e35b96c7c98223cc110acb35b81
2017-12-19 23:35:09 +09:00
Jiyong Park 483cd2e2fe /vendor/lib/hw is removed from search paths for vendor default ns
Shared libraries in the directory should be dlopened with full file
paths. That was a workaround for some legacy prebuilt binaries and they
are all now fixed. Thus removing.

Bug: 70551668
Test: walleye, aosp_walleye, taimen, aosp_taimen boot to the UI

Change-Id: Ifb123b09c13f873cbefa7784e76dfe5f35575a8d
2017-12-19 21:43:25 +09:00
Treehugger Robot 20bc9eb60b Merge "Add suite component to test modules" 2017-12-19 08:15:29 +00:00
Logan Chien 225b71d8c5 Separate VNDK libs into another linker namespace
This commit extracts /system/lib[64]/vndk and /system/lib[64]/vndk-sp
into another namespace in the vendor section.  This commit is necessary
because LLNDK libraries (e.g. libc or libnativewindow) may otherwise
link to the shared libraries in /system/lib[64]/vndk-sp, which may be
older than the one LLNDK libraries built with.

Test: aosp_walleye boots
Bug: 70816018
Change-Id: I6fceb0da92c978ad940af91f5efe84e673c9247e
2017-12-19 15:29:48 +08:00
Yabin Cui 9879137720 libBacktraceOffline: improve unwinding callchains.
1. Extend MAX_BACKTRACE_FRAMES to 256, as we can have callchains
   with length near 256 when recording Android applications.

2. .eh_frame and .ARM.exidx doesn't know how to unwind from instructions
   setting up or destroying stack frames. It can lead to wrong callchains,
   which may contain pcs outside executable mapping areas. Stop unwinding
   once this is detected.

3. Some CIE entries in .eh_frame/.debug_frame suggest unwinder reading
   personality routine from memory. However, that is not available in
   offline unwinding, and leads to ACCESS_MEM_FAILED error. Work around
   this by returning all zero data when failed to read data for some
   addresses.

4. Some libraries have empty .eh_frame_hdr but valid .eh_frame.
   Work around this by building eh_frame_hdr manually.

5. Prefer to use .debug_frame than .eh_frame. Because the former
   can unwind instructions setting up and destroying stack frames.

Bug: http://b/69383534
Test: run backtrace_test.
Test: run simpleperf on some apps.

Change-Id: I62dddda3865dd567c6be150ce5527dc2d3516256
2017-12-18 18:20:44 -08:00
Treehugger Robot 6d8aff5fdc Merge "Remove CompileTimeIfElse." 2017-12-19 01:44:19 +00:00
Steven Moreland b8f152d3e2 Usage suggestions.
Providing alternative suggestions for using C++ stdlib types
instead of libutils types:
- higher interoperability
- fewer "legacy" quirks
- ability to use stl algorithms
- high optimization levels

Test: none
Change-Id: If81aa9982ca0ad229fa13c8142387906981b054d
2017-12-19 01:16:00 +00:00
Treehugger Robot d848876ff7 Merge "Create wrapper function for set_wakeup_callback" 2017-12-19 00:06:15 +00:00
Steven Moreland 8edb49060a Remove CompileTimeIfElse.
- not used anywhere
- equivalent to std::conditional

Test: none
Bug: none
Change-Id: Iffc00acb899d5159359d60c09443c7d2d7fdf2a0
2017-12-18 15:52:50 -08:00
Treehugger Robot 8b18000b39 Merge "unwindstack: add some perfunctory MemoryOffline tests." 2017-12-18 22:21:45 +00:00
Tom Cherry 432cca5c32 Merge "Reland "Have property_service create a serialized property_contexts file"" 2017-12-18 22:02:35 +00:00
James Hawkins e2c2724aee bootstat: Add tons of new boot reasons.
Bug: none
Test: none
Change-Id: I57e89a20f23d3b3cff2fa6667e25f1c37cb2870c
2017-12-18 13:40:27 -08:00