Commit graph

30671 commits

Author SHA1 Message Date
Christopher Ferris
a32945f71a Merge "Change RegsTmpl to RegsImpl." am: 2065a741cd
am: d34b599ec8

Change-Id: Ic0c1ad6466a548be140a122e7eb28884100fbb75
2017-06-02 15:11:44 +00:00
Christopher Ferris
d34b599ec8 Merge "Change RegsTmpl to RegsImpl."
am: 2065a741cd

Change-Id: Ib4050f99b4f452ed26aa41be0ca137656f610a7f
2017-06-02 15:09:14 +00:00
Christopher Ferris
2065a741cd Merge "Change RegsTmpl to RegsImpl." 2017-06-02 15:05:29 +00:00
Christopher Ferris
7b8e467192 Change RegsTmpl to RegsImpl.
Also clang-format modified Regs.cpp slightly.

Bug: 23762183

Test: Built and ran unit tests.
Change-Id: I1c7c1b01974ee3f35059c42b8e2aef24d46c81a7
2017-06-01 17:56:46 -07:00
Josh Gao
986ba5bbbb Merge "adb: reunregress waiting for device on start-server." am: 72076d1aa7
am: 08a70ac6e5

Change-Id: Ie379f49929c8b11544328694fd1a438e63da453d
2017-06-02 00:27:49 +00:00
Josh Gao
08a70ac6e5 Merge "adb: reunregress waiting for device on start-server."
am: 72076d1aa7

Change-Id: Ie00b2258e92e93b45e4c859cbec11a374b4f7557
2017-06-02 00:26:14 +00:00
Christopher Ferris
1fc59234bf Merge "Add DwarfSection classes." am: 6a80c3e1a8
am: 5659a2b6fe

Change-Id: Ic1de0d9f88febb87c2485d964a85071b676ebde3
2017-06-02 00:25:54 +00:00
Christopher Ferris
5659a2b6fe Merge "Add DwarfSection classes."
am: 6a80c3e1a8

Change-Id: I353f0d1fb1c3203134e8590a1ef7267407240bed
2017-06-02 00:22:25 +00:00
Treehugger Robot
72076d1aa7 Merge "adb: reunregress waiting for device on start-server." 2017-06-02 00:20:31 +00:00
Christopher Ferris
6a80c3e1a8 Merge "Add DwarfSection classes." 2017-06-02 00:15:13 +00:00
Josh Gao
e8f700611e Merge changes Iddb0cb1e,Ic15e0b08,If1c9adb6 am: 2b17afc68d
am: f1477d7f43

Change-Id: Ic37df35542dcb27b88401bb4efa59cb2113dbbd7
2017-06-01 21:56:28 +00:00
Josh Gao
f1477d7f43 Merge changes Iddb0cb1e,Ic15e0b08,If1c9adb6
am: 2b17afc68d

Change-Id: I893f4c95143638598fbc4ef48e6717d1616e3688
2017-06-01 21:53:29 +00:00
Treehugger Robot
2b17afc68d Merge changes Iddb0cb1e,Ic15e0b08,If1c9adb6
* changes:
  debuggerd_client: increase pipe buffer size to max.
  crash_dump: don't notify ActivityManager if it crashed.
  crash_dump: clear the signal mask.
2017-06-01 21:47:19 +00:00
Christopher Ferris
53a3c9b4ab Add DwarfSection classes.
Bug: 23762183

Test: Ran new unit tests.
Change-Id: Icca2a73c50d467718ba4ac41e1c8f541488620dd
2017-06-01 13:12:31 -07:00
Josh Gao
5675f3c321 debuggerd_client: increase pipe buffer size to max.
If a process tries to dump itself (e.g. system_server during ANRs),
crash_dump will block trying to write to its pipe if it's not
sufficiently large. Increase the pipe size to the max, and add a test
to make sure that it's always at least 1MB (the default value).

Bug: http://b/38427757
Test: debuggerd_test
Change-Id: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
2017-06-01 12:42:44 -07:00
Josh Gao
b0e51e388b crash_dump: don't notify ActivityManager if it crashed.
Bug: http://b/38427757
Test: killall -ABRT system_server, plus added logging
Change-Id: Ic15e0b0870b1ec08a2f165ad0e5356afed02eece
2017-06-01 12:42:33 -07:00
Christopher Ferris
9676de623d Merge "Fix bug found by fuzzer." am: 1d6a3acc9e
am: 9bf73d3723

Change-Id: I05a362c658240ea91fe84d4b2b56e8e07c3c9c06
2017-06-01 19:12:18 +00:00
Christopher Ferris
9bf73d3723 Merge "Fix bug found by fuzzer."
am: 1d6a3acc9e

Change-Id: I020589751d4b2835ac098dad8cc3b07c5ba8448d
2017-06-01 19:09:20 +00:00
Christopher Ferris
1d6a3acc9e Merge "Fix bug found by fuzzer." 2017-06-01 19:03:48 +00:00
Josh Gao
e740250b9d crash_dump: clear the signal mask.
crash_dump inherits its signal mask from the thread that forked it,
which always has all of its signals blocked, now that sigchain respects
sa_mask.

Manually clear the signal mask, and reduce the timeout to a
still-generous 2 seconds.

Bug: http://b/38427757
Test: manually inserted sleep in crash_dump
Change-Id: If1c9adb68777b71fb19d9b0f47d6998733ed8f52
2017-06-01 11:55:25 -07:00
Jinguang Dong
40d4ad9cdf Merge "fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes" am: 28c11dcff4
am: 6a75b73c36

Change-Id: I3ecfb77fd639684d0a448b2eafa22570bf5796da
2017-06-01 17:37:33 +00:00
Jinguang Dong
6a75b73c36 Merge "fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes"
am: 28c11dcff4

Change-Id: I8b67777e1136a50b4233dce1450c7df867ccd744
2017-06-01 17:32:39 +00:00
Treehugger Robot
28c11dcff4 Merge "fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes" 2017-06-01 17:21:30 +00:00
Jinguang Dong
f7d1014795 fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes
Because the zram_size type is unsigned int.so if ZRAM size great
than 2^31 -1, zram_fp will receive a negtive integer, while the
ZRAM driver only accept natural number.We need to use printf
formatting %u instand of %d.

Test: 1. Config the zramdisk size 2348810240 and build a ramdisk
      2. Reflash device and check below command:
         $adb shell dumpsys meminfo
         $ adb shell cat /sys/block/zram0/disksize
         ZRAM info display will be abnormal
      3. Config the zramdisk size 2348810240 and apply with this
         patch.
      4. Retest to step 2 and the ZRAM info will be ok.

Change-Id: I473de33fbd0b66cf13eac3172684e9fef11b6ef0
2017-06-01 19:42:22 +08:00
Robert Benea
b30ad069ec Merge "cgroups used by init must be mounted before any services start" am: 63c15c1b11
am: cc6da8ec5b

Change-Id: I682be7a95fccf23b645d96df67414033dc83a93e
2017-06-01 08:10:03 +00:00
Robert Benea
cc6da8ec5b Merge "cgroups used by init must be mounted before any services start"
am: 63c15c1b11

Change-Id: I2d9298d6de7fbe3b1ad827f498822545e696d4cc
2017-06-01 08:07:31 +00:00
Treehugger Robot
63c15c1b11 Merge "cgroups used by init must be mounted before any services start" 2017-06-01 07:59:19 +00:00
Jin Qian
d195ab0b23 Merge "fastboot: use filename instead of fd to generate filesystem image" am: 010f7714b7
am: 104470da0f

Change-Id: I3e1e72bffe47188f49ae3cf4f0cfa44fcd9b0ef4
2017-06-01 06:13:54 +00:00
Jin Qian
104470da0f Merge "fastboot: use filename instead of fd to generate filesystem image"
am: 010f7714b7

Change-Id: I5b68c8228bd5fc018f858a200f0413e7c00a8791
2017-06-01 06:11:53 +00:00
Treehugger Robot
010f7714b7 Merge "fastboot: use filename instead of fd to generate filesystem image" 2017-06-01 06:05:41 +00:00
Christopher Ferris
15d2e42ceb Fix bug found by fuzzer.
Also, add the demangle fuzzer code.

Test: Ran fuzzer, ran new unit tests.
Change-Id: If3e15e10af88b81602a8a0f0bfe071a015f6000b
2017-05-31 17:54:19 -07:00
Robert Benea
c638569c2e cgroups used by init must be mounted before any services start
init uses /acct and optionally /dev/memcg for tracking services and
therefore these must be started before any services start.

Test: check that cgroups are mounted appropriately.

Change-Id: Ice095287963181fe687dbe6b7d291076e674d1cc
2017-05-31 16:12:23 -07:00
Mark Salyzyn
301770b2c7 Merge "logcat: logcatd: make logcatd killable" am: f2c1ef53ff
am: 69f28a69e3

Change-Id: I4a75c92ea0c23f2c00be5cf0ebaed768f354ae4f
2017-05-31 22:30:24 +00:00
Mark Salyzyn
69f28a69e3 Merge "logcat: logcatd: make logcatd killable"
am: f2c1ef53ff

Change-Id: Ibca636745a95a5f55bddfdd1a0c8067b9078655a
2017-05-31 22:28:22 +00:00
Treehugger Robot
f2c1ef53ff Merge "logcat: logcatd: make logcatd killable" 2017-05-31 22:24:06 +00:00
Jin Qian
4a335829da fastboot: use filename instead of fd to generate filesystem image
mke2fs tool takes a filename and has its own open function to handle
output file. Change fastboot in preparation to switch from make_ext4
to mke2fs.

Test: fastboot format:ext4 userdata
Bug: 35219933
Change-Id: I7a31cb215f443a4a7cb0bfc23ec28c121a6101e6
2017-05-31 21:23:12 +00:00
Josh Gao
0b13c89f7a adb: reunregress waiting for device on start-server.
Move the invocation of adb_notify_device_scan_complete to
the end of device_connected, where we decrement connecting_devices.
Also, create a dedicated thread for handling hotplug events, instead of
reusing the main thread for this, since the main thread blocks until
device scan is complete.

Test: `adb kill-server; adb devices`
Change-Id: Ia73b1a57538174282a48ef73ab0a3e58152d6f83
2017-05-31 12:13:59 -07:00
Mark Salyzyn
30ea96e14e logcat: logcatd: make logcatd killable
Near last resort kill logcatd, set /proc/self/oom_score_adj to -600.

Can kill to keep system_server, telephony and bluetooth.

Test: manual, start logpersist, runs
Bug: 62147352
Change-Id: I3723761bf1d2b79ce6a9557d2e78f91cc5497e96
2017-05-31 11:27:22 -07:00
George Burgess IV
21ea871839 Merge "logging: make LOG(FATAL) always run with the static analyzer." am: b46fd68653
am: 2e9af0942c

Change-Id: I1f268e34a9c85bb7e57911a9881c39c60afd87e0
2017-05-31 17:05:57 +00:00
George Burgess IV
2e9af0942c Merge "logging: make LOG(FATAL) always run with the static analyzer."
am: b46fd68653

Change-Id: I761248df16cd0c7185bbd0934501151a18bdbdf5
2017-05-31 16:55:55 +00:00
Treehugger Robot
b46fd68653 Merge "logging: make LOG(FATAL) always run with the static analyzer." 2017-05-31 16:41:15 +00:00
George Burgess IV
6466ced8f6 logging: make LOG(FATAL) always run with the static analyzer.
::android::base::GetMinimumLogSeverity() is defined externally, so the
static analyzer was allowed to assume that we continue executing after a
LOG(FATAL).

I manually audited all of the code I have access to, and the only
"change the minimum log severity" statements I can see keep FATAL
enabled (...and continuing after a FATAL is highly sketchy to me
anyway).

(I'm sure I tested this at some point in making the previous patch. I
probably broke it in a refactor before sending it out for review; my
bad. :) )

Bug: None
Test: m without the static-analyzer builds; m with it yields fewer
false positives.

Change-Id: I216cd2034e1daa8d6f6c5e776f64b4cce88bb938
2017-05-31 14:41:22 +00:00
Narayan Kamath
6ca71ad137 Merge "tombstoned: allow intercepts for java traces." am: 1e63347425
am: 907a666e22

Change-Id: Id0bb9f7d27991a137182cf4217e6fd1e075d2867
2017-05-31 12:16:45 +00:00
Narayan Kamath
907a666e22 Merge "tombstoned: allow intercepts for java traces."
am: 1e63347425

Change-Id: I326308ed1fa4bdbb3380a19403fecb93386ec811
2017-05-31 12:07:04 +00:00
Narayan Kamath
1e63347425 Merge "tombstoned: allow intercepts for java traces." 2017-05-31 11:55:50 +00:00
Narayan Kamath
a73df601b7 tombstoned: allow intercepts for java traces.
All intercept requests and crash dump requests must now specify a
dump_type, which can be one of kDebuggerdNativeBacktrace,
kDebuggerdTombstone or kDebuggerdJavaBacktrace. Each process can have
only one outstanding intercept registered at a time.

There's only one non-trivial change in this changeset; and that is
to crash_dump. We now pass the type of dump via a command line
argument instead of inferring it from the (resent) signal, this allows
us to connect to tombstoned before we wait for the signal as the
protocol requires.

Test: debuggerd_test

Change-Id: I189b215acfecd08ac52ab29117e3465da00e3a37
2017-05-31 10:35:32 +01:00
Josh Gao
a08c949c7a Merge "adb: fix deadlock." am: 68599f5759
am: d5a2cdb72c

Change-Id: I671768311d2c2969bc5797efc43c84175b417ae7
2017-05-31 02:16:48 +00:00
Josh Gao
d5a2cdb72c Merge "adb: fix deadlock."
am: 68599f5759

Change-Id: I9c57920319ef8b76b313c6fa736a282fe54e857b
2017-05-31 02:12:20 +00:00
Treehugger Robot
68599f5759 Merge "adb: fix deadlock." 2017-05-31 02:03:42 +00:00
Josh Gao
d1a3e8f1ab adb: fix deadlock.
libusb hotplug callbacks are called with the libusb lock taken, and we
call into libusb with our local mutex, so we need to enforce an ordering
between the two. Instead of calling device_connected or
device_disconnected directly, enqueue them onto the main thread.

Bug: http://b/62200735
Test: manually hotplugged a device
Change-Id: Ic5d55db83b47f4bb60f124ce94ddfe06f5f1a0c6
2017-05-30 17:09:42 -07:00