Commit Graph

24194 Commits

Author SHA1 Message Date
TreeHugger Robot 73c59ad77c Merge "DO NOT MERGE: adb: reenable (and fix) Windows build." into mnc-dev 2016-08-11 20:09:30 +00:00
Josh Gao 804de7a29e DO NOT MERGE: adb: reenable (and fix) Windows build.
This branch is still getting used to build some SDK targets.

Bug: http://b/30767018
Change-Id: I85b03a80d69ceef5e5333505f0832129387ed2da
2016-08-11 11:29:43 -07:00
Josh Gao 98c4d5c4fe Merge "Define TARGET_IS_64_BIT when building libdebuggerd_client for android64." am: 07f14c9cdd
am: 40efc4c664

Change-Id: If6889e54994c39280a39cc700f46470b6b760dda
2016-08-10 22:25:57 +00:00
Josh Gao 40efc4c664 Merge "Define TARGET_IS_64_BIT when building libdebuggerd_client for android64."
am: 07f14c9cdd

Change-Id: Ieac230f7a5cd0107420f0f5dfc84d1d9a19e70e0
2016-08-10 22:23:06 +00:00
Josh Gao 07f14c9cdd Merge "Define TARGET_IS_64_BIT when building libdebuggerd_client for android64." 2016-08-10 22:17:01 +00:00
Hans Boehm f997434b06 Merge "Improve RefBase documentation, especially for clients." am: 0f39fe22ae
am: df6c464e9a

Change-Id: I8fa12835ff648d78c68265facb5b63ca7b1eab6a
2016-08-10 16:26:59 +00:00
Hans Boehm df6c464e9a Merge "Improve RefBase documentation, especially for clients."
am: 0f39fe22ae

Change-Id: I804989b192142dc9d69ca36f0122079822625e7e
2016-08-10 16:24:01 +00:00
Hans Boehm 0f39fe22ae Merge "Improve RefBase documentation, especially for clients." 2016-08-10 16:16:22 +00:00
Narayan Kamath d5d7abe3d1 zip_archive: Improve error message on fallocate failure.
Noticed on b/30765660.

Change-Id: I1a98f83fef02a7368bdc2e1f8f24a0771eebe468
2016-08-10 12:24:05 +01:00
Josh Gao a200a4d592 debuggerd: fix missed use of ptrace(PTRACE_ATTACH). am: 8b6b654a5f am: fe59793375 am: 073f731836 am: 647ec18a9d -s ours
am: 364188b9d8

Change-Id: Idaf75a1369acba424c5280bcf29bedebed48f5bf
2016-08-09 23:55:08 +00:00
Josh Gao 364188b9d8 debuggerd: fix missed use of ptrace(PTRACE_ATTACH). am: 8b6b654a5f am: fe59793375 am: 073f731836
am: 647ec18a9d  -s ours

Change-Id: I01df2746300f5349660988f797bf17d3a3e3994f
2016-08-09 23:52:35 +00:00
Josh Gao 647ec18a9d debuggerd: fix missed use of ptrace(PTRACE_ATTACH). am: 8b6b654a5f am: fe59793375
am: 073f731836

Change-Id: If0a221d5fcfe25c7e731de4039318a24cd5cb782
2016-08-09 23:28:30 +00:00
Josh Gao 073f731836 debuggerd: fix missed use of ptrace(PTRACE_ATTACH). am: 8b6b654a5f
am: fe59793375

Change-Id: I22b74c49b17eeb17c46891e4404a2ca8c562bea7
2016-08-09 23:25:31 +00:00
Josh Gao fe59793375 debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
am: 8b6b654a5f

Change-Id: Iebf1eb6f47a917c84c3e5f1bd16d9ed5f3a487ae
2016-08-09 23:23:00 +00:00
Josh Gao 8b6b654a5f debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
Bug: http://b/29555636
Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07
2016-08-09 15:52:26 -07:00
Hans Boehm 9ba7192c1f Improve RefBase documentation, especially for clients.
Add basic interface documentation to RefBase.h.

Much, but not all, of this is cut-and-pasted from an email message
from Mathias Agopian. The rest is reconstructed from the code.

Delete some, now redundant, text from Refbase.cpp, and add a bit
more about the implementation strategy.

Some minor fixes to internal comments.

Bug: 30292291
Change-Id: I56518ae5553bc6de0cc2331778e7fcf2e6c4fd87
2016-08-09 15:12:19 -07:00
Robert Sesek 9eb02c973f Define TARGET_IS_64_BIT when building libdebuggerd_client for android64.
This is needed to connect to the right debuggerd server for the crashing
process. Without this change, the following errors are observed, because a
32-bit process is trying to connect to the 64-bit debuggerd (as opposed to
debuggerd32):

  Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 14153 (static_crasher)
  debuggerd: handling request: pid=14153 uid=0 gid=0 tid=14153
  debuggerd: Not allowed to redirect action 0 to 32 bit debuggerd

Bug: 24414818
Change-Id: I2f275fbc804b0abc6e876a743e51dd8494817103
2016-08-09 14:04:05 -04:00
Mark Salyzyn 73ded18d31 Merge "logd: klogd crash" am: e23e0914ff
am: 5118d8f633

Change-Id: Ibcf55215052496a9d8132e3e6826ecd6e24fea52
2016-08-09 14:47:27 +00:00
Mark Salyzyn 5118d8f633 Merge "logd: klogd crash"
am: e23e0914ff

Change-Id: I8c99431fe8687365e5af615ce7c231ac7029558a
2016-08-09 14:44:29 +00:00
Mark Salyzyn e23e0914ff Merge "logd: klogd crash" 2016-08-09 14:36:12 +00:00
Elliott Hughes 236a9903fe Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom." am: 2f21b7cecd
am: f2f4e784a4

Change-Id: I6ca3c3471189b2c15f25ac44ee7985f2e121e441
2016-08-08 21:20:24 +00:00
Elliott Hughes f2f4e784a4 Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom."
am: 2f21b7cecd

Change-Id: I9fa6d99a61053dae4ad60c0b73ddac755b29cf61
2016-08-08 21:17:54 +00:00
Treehugger Robot 2f21b7cecd Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom." 2016-08-08 21:10:17 +00:00
Mark Salyzyn 5f6dbd96e5 Merge changes I628d590a,I1c13b94e,Iecf61bb2,I5b1c929d,I895749ca, ... am: 1d3e13dcfc
am: cdaa5e2d64

Change-Id: Id8c84115981f1469e7ce9dccfae78d4b87c829b4
2016-08-08 19:55:18 +00:00
Mark Salyzyn cdaa5e2d64 Merge changes I628d590a,I1c13b94e,Iecf61bb2,I5b1c929d,I895749ca, ...
am: 1d3e13dcfc

Change-Id: I0d5bd2a52bd74b658f9fc3183599968948e2948c
2016-08-08 19:52:49 +00:00
Elliott Hughes aea1683c12 std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom.
This is the only decltype(fn)* outside aapt2 in the whole tree.

Change-Id: I2e19d2031b56fdb808c62c2c07ca6080c9ec6fe3
2016-08-08 12:52:37 -07:00
Treehugger Robot 1d3e13dcfc Merge changes I628d590a,I1c13b94e,Iecf61bb2,I5b1c929d,I895749ca, ...
* changes:
  logcat: -d, -t or -L, along with -f, do not background
  logcat: lastLogTime only two most recent files
  logcatd: Add --id=${ro.build.id}
  logcatd: fix up logpersist.cat to filter out signature file
  logcat: add --id=<id> for -f option
  logcat: switch to android::base::StringPrintf
2016-08-08 19:49:19 +00:00
Josh Gao a1da027a3c Merge "libcrypto_utils: convert to Soong." am: c1a9a21ffe
am: 87ef590bc1

Change-Id: I3cdf2f27f953f40a5d5b9257cf588b093d22233d
2016-08-08 18:36:19 +00:00
Josh Gao 87ef590bc1 Merge "libcrypto_utils: convert to Soong."
am: c1a9a21ffe

Change-Id: I9cf76646d4537750c4d4080234d3384fb307e610
2016-08-08 18:33:49 +00:00
Mark Salyzyn dbfe0a1abe Merge "logcatd: logpersist.start more descriptive warning" am: dad158f3a1
am: 2c1322f751

Change-Id: I9af477d21332276bb14e535f4a64d708fc7a0e8e
2016-08-08 18:33:42 +00:00
Mark Salyzyn 2c1322f751 Merge "logcatd: logpersist.start more descriptive warning"
am: dad158f3a1

Change-Id: I6a7e1ef337dd7c8ae4b6b49b70dffa07968d0253
2016-08-08 18:30:49 +00:00
Josh Gao c1a9a21ffe Merge "libcrypto_utils: convert to Soong." 2016-08-08 18:29:10 +00:00
Treehugger Robot dad158f3a1 Merge "logcatd: logpersist.start more descriptive warning" 2016-08-08 18:26:35 +00:00
Greg Kaiser 29e672f9cb Merge "SharedBuffer: Fix bug in return value of release()" am: c064db48f1
am: f068856284

Change-Id: Id210794f288b4cd75438fb7490947a4997d48f31
2016-08-08 18:17:41 +00:00
Greg Kaiser f068856284 Merge "SharedBuffer: Fix bug in return value of release()"
am: c064db48f1

Change-Id: I401318575ced17a94d19b47b2821ed4c310d9a03
2016-08-08 18:15:44 +00:00
Greg Kaiser c064db48f1 Merge "SharedBuffer: Fix bug in return value of release()" 2016-08-08 18:11:26 +00:00
Mark Salyzyn ad5e411608 logcat: -d, -t or -L, along with -f, do not background
Specifically logcatd with exec logcat -L needs to be foreground
process cgroup as it is spawned and can block init progress. Makes
sense generally to only set background cgroup when we are taking
continuous content, and we are pushing that content to a set of
logrotate files.

Rename setupOutput to setupOutputAndSchedulingPolicy to more
clearly indicate its purpose.

Bug: 30630936
Bug: 30612424
Bug: 28788401
Change-Id: I628d590a42a53a6b448ecd0af53d6d1edf7bbb0e
2016-08-08 10:20:22 -07:00
Mark Salyzyn 31961061d5 logcat: lastLogTime only two most recent files
Scaling issues if -f logrotation is specified and there are a lot of
log files to process in lastLogTime, focus on only the last two log
files. This will cover the situation where we have recently rotated
the logs and the last file is missing or empty.

This also alters monotonic processing as well as it used to focus on
only the last file; the danger being doubled now if the pair covers
more than one reboot when filling in missing content with logcat -L.
Problem was always there with one log file, but now we handle if
rotation happened recently. A fair tradeoff for KISS.

Bug: 30630936
Bug: 30612424
Bug: 28788401
Change-Id: I1c13b94e88f5edc08ecef52d407e296874ca5807
2016-08-08 10:20:22 -07:00
Mark Salyzyn 9b35df6517 logcatd: Add --id=${ro.build.id}
If a new build lands, this will automatically clear out old
logs in /data/misc/logd/ that may no longer be relevant.

Bug: 30591615
Change-Id: Iecf61bb2a4928ce4b2e8cc6a3b122b7ae598d268
2016-08-08 10:20:22 -07:00
Mark Salyzyn 2e5b71873c logcatd: fix up logpersist.cat to filter out signature file
Simple filter for no suffix, or a numerical suffix. toybox
grep did not handle a more robust regex, so we opted for
kiss in order to remove the .id suffix from consideration.

Bug: 30591615
Change-Id: I5b1c929d3e69c1ae39af95ae44a69f7b55e969ed
2016-08-08 10:20:22 -07:00
Mark Salyzyn 02687e75b0 logcat: add --id=<id> for -f option
Clear file rotate content if id signature changes. This allows
logcatd to detect change of property ro.build.id to reset the
recorded data. The id is stored in the the -f filespec as
<filespec>.id.

If the id file is missing or unreadable, do not clear. Allow an
API where chmod 0 to the id file blocks this feature. Does not
work for root.

Add logcat.logrotate_id gTest.

Bug: 30591615
Change-Id: I895749ca7c6d4af57ec57f058a29d8e3af2f8b27
2016-08-08 10:19:48 -07:00
Mark Salyzyn 5b1a538fc8 logcat: switch to android::base::StringPrintf
asprintf should be replaced with StringPrintf, solves
a memory leak issue because of exiting scope.

Bug: 30591615
Change-Id: I88644cc27946ba4f25d4539420199c6f40df1bfa
2016-08-08 10:03:14 -07:00
Mark Salyzyn 452eaf7d5b logcatd: logpersist.start more descriptive warning
"killing Settings" is meaningless without context, we are killing the
Settings application to pull in new values, so make this clearer!

Change-Id: Ice0b950040bd05dcd49b7315def4dac3dd93eb27
2016-08-08 10:03:05 -07:00
Mark Salyzyn a146a779e2 logd: klogd crash
dmesg parser could wrap taglen limit resulting in out of bound
accesses. Can lead to crash or data corruption.

Fixed an issue with two-word tag parsing. Switched to case
insensitive tag content matching. Added a few extra limit
checks that could also wrap, simplified the parsing, then added
means to stop using hard coded constants.

Bug: 30688716
Bug: 30050636
Bug: 30614675
Bug: 25620123
Change-Id: Iae4f664f63ef7b842d82eaa1638b6d7a0d28fd18
2016-08-08 09:58:28 -07:00
Greg Kaiser c9b23cbb54 SharedBuffer: Fix bug in return value of release()
Since the equality operator '==' has higher precedence than the
assignment operator '=', we were assigning 'prev' to the result of
our comparison and not the result of mRefs.fetch_sub().

This means that 'prev' would only receive the values 0 or 1.  In
the cases where fetch_sub() returned 0 or 1, we were happening to
get the correct value.  But if fetch_sub() was greator than 1,
we would return to the user 0, instead of the previous reference
count.

We fix this by properly adding parentheses.  We also adjust the
whitespace a little to hopefully make the groupings of the logic
easier to see.

Change-Id: Ib129798a7076854b9ca4f6385c42edbf4fb75e57
2016-08-08 06:55:10 -07:00
Josh Gao 47763c3a09 libcrypto_utils: convert to Soong.
Bug: http://b/30708454
Change-Id: Iaad64272ced766f87e67f2877e990afccc558065
2016-08-05 18:07:36 -07:00
Greg Hackmann d13fbda554 Merge changes from topic 'minui_sync_wait' am: 9cd828b858
am: 70f9a1018c

Change-Id: Iaa16443a00f5c88831f1efd6a104f8d80a27cd1b
2016-08-05 23:51:30 +00:00
Greg Hackmann 70f9a1018c Merge changes from topic 'minui_sync_wait'
am: 9cd828b858

Change-Id: Ib4d2c4dc6d6f2d78a99fccf57fc055f8934a8312
2016-08-05 23:47:59 +00:00
Treehugger Robot 9cd828b858 Merge changes from topic 'minui_sync_wait'
* changes:
  libsync: add static library for recovery
  libsync: remove unused liblog dependency
2016-08-05 23:25:43 +00:00
Greg Hackmann d86dd3b838 libsync: add static library for recovery
Change-Id: If43188c3b4b16c698c077338ea0ef1dfd16b9c56
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-08-05 15:03:58 -07:00