Commit graph

22149 commits

Author SHA1 Message Date
Badhri Jagan Sridharan
031afc0dba Merge "Remove redundant action triggers on persist.sys.usb.config" into nyc-mr1-dev 2016-08-10 22:16:28 +00:00
Josh Gao
faa7e41a7f debuggerd: fix missed use of ptrace(PTRACE_ATTACH). am: 8b6b654a5f am: fe59793375 am: 073f731836 am: 647ec18a9d -s ours
am: 364188b9d8

Change-Id: I41987b2c560d7c49bb5bc04862a4c40c6831c339
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
Mark Salyzyn
fbbf99256a logd: klogd crash
(cherry pick from commit a146a779e2)

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-09 07:52:09 -07:00
Felipe Leme
9a882a3ef3 Ignore bugreportz output when it's not supported.
On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
2016-08-04 13:12:39 -07:00
TreeHugger Robot
aed7048ce0 Merge changes from topic 'bug_30451114' into nyc-mr1-dev
* changes:
  Deprecated 'adb bugreport' with flat files.
  Minor improvements on bugreport generation.
2016-08-04 14:44:35 +00:00
Josh Gao
29e7e3edb1 adb: fix stat on Windows.
stat on Windows fails with ENOENT when passed a path with a trailing
slash or backslash, regardless of whether the target is actually a
directory. Emulate the correct POSIX behavior by stripping trailing
path separators and then checking if the target is a directory if
successful.

Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I1d398d19a9bce1ecb3fdc4aabc31aa98c82c3f93
Test: Relevant adb_tests pass on Linux and Windows 10.
(cherry picked from commit f551ea0f63)
2016-08-03 15:14:59 -07:00
Josh Gao
89b9767776 adb: extract Windows bits out of directory_exists test.
Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I8f20b3cd5aef6a77c2b4f194b914b4295397d73f
(cherry picked from commit 3bdc76025b)
2016-08-03 15:14:59 -07:00
Ruchi Kandoi
90a3f81c9e logd: logcat -L takes longer causing vold to timeout.
Temporary fix to prevent device from getting stuck at boot.

Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Bug: 28788401
Bug: 30041146
Bug: 30612424
Bug: 30630936
Change-Id: Ie4246fc3c9eb7a3af2cb909546811c85997515da
2016-08-03 20:27:02 +00:00
Felipe Leme
307951e124 Deprecated 'adb bugreport' with flat files.
Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
2016-08-01 15:28:12 -07:00
Badhri Jagan Sridharan
05e04a134e Remove redundant action triggers on persist.sys.usb.config
persist.sys.usb.config stores the usb functions which need to be enabled
when the phone boots up. When the phone is actually booted, setting this
would also activate the following action trigger on sys.usb.config

From init.usb.rc:
Used to set USB configuration at boot and to switch the configuration
when changing the default configuration
on property:persist.sys.usb.config=*
    setprop sys.usb.config ${persist.sys.usb.config}

sys.usb.config is anyways set to the actual functions by UsbDeviceManager
once it is set to none. Therefore add "on boot" condition to the above
action trigger so that persist.sys.usb.config does not race with
sys.usb.config.

BUG: 30440213
Change-Id: I3333d0b8334fb627469c7faad250bf3151bb1ebf
2016-08-01 21:56:23 +00:00
Felipe Leme
80a65d03c9 Minor improvements on bugreport generation.
- Skipped artificial 100/100 message, since pulling will take care of
  the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
  be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
2016-08-01 13:31:57 -07:00
James Hawkins
f85554e12f bootstat: Fix a potential unhandled exception for malformed input.
In rare cases the hardware storage on the device may be hosed and return
garbage.  Use ParseInt which handles bad input instead of stoi.

BUG: 29334139
Change-Id: I91aedc169df110bea8097775f73dda11def22311
(cherry picked from commit 4dded613b3)
2016-07-29 08:24:28 -07:00
TreeHugger Robot
a6cb3062ff Merge "Improved keychord logging." into nyc-mr1-dev 2016-07-29 01:07:09 +00:00
Felipe Leme
c64c982e72 Improved keychord logging.
Often a bugreport is accidentally triggered by the combo keys, but there
is nothing in the bugreport to confirm that action because init's
klog level is KLOG_NOTICE_LEVEL.

This change change keychord's INFO messages to NOTICE, and also logs the
case where a service was not launched because ADB was disabled.

BUG: 30440213
BUG: 30345559

Change-Id: I6ccadef1621cb41dcd15e7c1660366f0e147dc7a
2016-07-28 14:11:32 -07:00
Felipe Leme
f7c38b4c03 Removed extra 'pulling file' message.
Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
2016-07-28 12:13:57 -07:00
Felipe Leme
cd42d658b2 Show bugreport progress.
adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
2016-07-26 16:15:16 -07:00
Felipe Leme
07ac8554b4 Refactored functions that copy sdout and stderr to strings to use a callback.
BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
2016-07-26 16:14:46 -07:00
Felipe Leme
78e0963e4b Split bugreport() into its own file and added unit tests.
bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
2016-07-26 16:14:20 -07:00
Mark Salyzyn
d211558788 Merge "logd: klogd: deal with htc modified printk" into nyc-mr1-dev 2016-07-21 18:09:10 +00:00
Fyodor Kupolov
1faf57bf0b Merge "Fix permissions for /data/preloads" into nyc-mr1-dev 2016-07-21 16:54:13 +00:00
Thierry Strudel
56efe020b7 Merge changes from topic 'enable_persist_kernel_log' into nyc-mr1-dev
* changes:
  logcatd: trampoline persist.logd.logpersistd to logd.logpersistd
  logcatd: add stop and clear actions
  logcatd: Do not su for setprop
  logcat: allow comma-separate list of buffers
  logcat: clear when specifying file output
  logcat: Adjust help to make it more meaningful
2016-07-21 04:07:25 +00:00
Fyodor Kupolov
13639b46d0 Fix permissions for /data/preloads
Default permission bits are 771. It causes permission denied errors when
MediaProvider tries to scan /data/preloads. We have to allow read for others.

Bug: 29940807
Change-Id: I45645cf1154501ccb64bef08b9ad7bf7709dfd8e
2016-07-20 17:25:12 -07:00
Josh Gao
087ea18caa DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours am: e467cced5c am: 174579d6ef am: a3a674ea10 am: ff716c73ea -s ours
am: 77374d698d

Change-Id: I9cdd6842033e57837a6466e8669aaa75f22af53e
2016-07-19 20:55:47 +00:00
Josh Gao
43250c10e8 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours am: 851f840835 am: be484f3f7b am: 1e1eae1992 am: 71908ef2f8 -s ours
am: be2e5ea5a9

Change-Id: I9916a033d3fa29d340ef75e5a7c866415e4ce517
2016-07-19 20:55:47 +00:00
Josh Gao
77374d698d DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours am: e467cced5c am: 174579d6ef am: a3a674ea10
am: ff716c73ea  -s ours

Change-Id: I50b3147d6d31c1b8fec7ae4601f72ab9ce71327b
2016-07-19 20:53:21 +00:00
Josh Gao
be2e5ea5a9 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours am: 851f840835 am: be484f3f7b am: 1e1eae1992
am: 71908ef2f8  -s ours

Change-Id: I0dda3544e9c6c44b61cd088e1423d42af35ad0e0
2016-07-19 20:53:20 +00:00
Josh Gao
ff716c73ea DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours am: e467cced5c am: 174579d6ef
am: a3a674ea10

Change-Id: I95414ed03014463d684b64c06b74a2a8616faaa2
2016-07-19 20:50:16 +00:00
Josh Gao
71908ef2f8 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours am: 851f840835 am: be484f3f7b
am: 1e1eae1992

Change-Id: I2bd7a6994c5d426402ee9d3e2adcc16f603b7c62
2016-07-19 20:50:16 +00:00
Josh Gao
a3a674ea10 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours am: e467cced5c
am: 174579d6ef

Change-Id: Ie3efaa41bacc640286a3aa6cfe353b16c707f15f
2016-07-19 20:47:10 +00:00
Josh Gao
7500016d8f Merge \\\\\"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\\\\\" into mnc-dev am: 73922b82ee am: 8a9e4369f6 am: ba143fd959 am: b1471215a8 -s ours
am: e11ffee38c

Change-Id: Id1459e5c49d640dfbc826e32e1081480353d31f7
2016-07-19 20:44:26 +00:00
Josh Gao
174579d6ef DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb am: cb4d905c96 -s ours
am: e467cced5c

Change-Id: Id5534fddb6ca8c237fbcfd310a6843f03c12a3d3
2016-07-19 20:44:11 +00:00
Josh Gao
1e1eae1992 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours am: 851f840835
am: be484f3f7b

Change-Id: I1c9a4f7cdec227e78910678f05e6232a60f05bb1
2016-07-19 20:43:26 +00:00
Josh Gao
e467cced5c DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644 am: 5920345eeb
am: cb4d905c96  -s ours

Change-Id: Ia99e7055a24da12133e48e03b466fe09ebcb811f
2016-07-19 20:42:28 +00:00
Josh Gao
e11ffee38c Merge \\\\"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\\\\" into mnc-dev am: 73922b82ee am: 8a9e4369f6 am: ba143fd959
am: b1471215a8  -s ours

Change-Id: I6932c59185c0e31e6db27431609a47049caa6dc8
2016-07-19 20:42:12 +00:00
Josh Gao
be484f3f7b DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e am: 6cb199bf4a -s ours
am: 851f840835

Change-Id: I4edf38e6bbee8745241329816647d730addc23ea
2016-07-19 20:40:05 +00:00
Josh Gao
cb4d905c96 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours am: b9b6ec3644
am: 5920345eeb

Change-Id: I06ba81a4abd04402ef250efebd333b878496cdab
2016-07-19 20:38:46 +00:00
Josh Gao
b1471215a8 Merge \\\"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\\\" into mnc-dev am: 73922b82ee am: 8a9e4369f6
am: ba143fd959

Change-Id: I7968a0d6d374c140c0b40a866d597dc6ca9ade25
2016-07-19 20:38:43 +00:00
Josh Gao
851f840835 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367 am: 9048b3bb8e
am: 6cb199bf4a  -s ours

Change-Id: I26ed6fa730d66419319a5832b7f011cd15601e03
2016-07-19 20:36:38 +00:00
Josh Gao
ba143fd959 Merge \\"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\\" into mnc-dev am: 73922b82ee
am: 8a9e4369f6

Change-Id: I7aa9984853f5114aea36d51ea2903b729b60d5e8
2016-07-19 20:35:39 +00:00
Josh Gao
5920345eeb DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 0528829b73 -s ours
am: b9b6ec3644

Change-Id: Iaf40759e124c4a01a9a3d21021939729a73c48e9
2016-07-19 20:35:39 +00:00
Josh Gao
1a0d789268 Merge \"debuggerd: verify that traced threads belong to the right process.\" into nyc-dev
am: d3d04f4d72

Change-Id: Ibe7073dfbb8f35acaf494fca82ac6a855a34c704
2016-07-19 20:34:17 +00:00
Josh Gao
8a9e4369f6 Merge \"DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.\" into mnc-dev
am: 73922b82ee

Change-Id: I36abe7ac6a52b561cfed8dfa689216b166f4df43
2016-07-19 20:34:12 +00:00
Josh Gao
6cb199bf4a DO NOT MERGE: debuggerd: verify that traced threads belong to the right process. am: 36dd144367
am: 9048b3bb8e

Change-Id: I2223884e41d15dabf94df861e28f9392b82678af
2016-07-19 20:33:40 +00:00
Josh Gao
b9b6ec3644 DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
am: 0528829b73  -s ours

Change-Id: I1644cca9d9631f291a3e80b6813e9cc33a8d5833
2016-07-19 20:32:42 +00:00
Josh Gao
9048b3bb8e DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
am: 36dd144367

Change-Id: I29864f223541596e9ffccb44c0c257399b0d9cb0
2016-07-19 20:30:19 +00:00