Use the native stack dumping functions that allows time outs. If
debuggerd locks up, before a bugreport would hang forever. Now
it will timeout properly and still get all of the other information.
Bug: 18766581
Change-Id: I85053b8dcfe6224e2b64b4d8f7f2ef448b3cda34
The previous version printed out the nanoseconds elapsed, not seconds.
Bug: 18766581
(cherry picked from commit 67c5a8af9e)
Change-Id: Icbaaee83a92767694fd98e3c790f36f4d24681b0
Previously, the vibration was not performed until after stacks
were gathered which takes a long time. Moved the vibration
to happen earlier so we provide better user feedback for the
three-button salute when collecting a bug report.
Deleted some dead code for playing begin/end sounds.
Improved the timing measurement code to help track down why
bug reports are so slow. (They take over a minute now which
can cause us to lose valuable diagnostic information.)
Bug: 17474152
Change-Id: Iac73f7993d7dc85196aad96f459b22fd4a710f94
The clock() function returns the processor time used by the process. This
is not a good timeout mechanism since the code is suspended most of the
time waiting for the forked process to finish. Replace with the time()
function.
Bug: 17154069
Change-Id: Ib383329f9db269445d71a100553b08e71fddda3f
Leave default signal handler (terminate) for parent process,
add SIG_IGN as signal handler for children and let them
go down when the parent gets SIGPIPE.
Bug: 17109154
Change-Id: Id33db3e97a32f289eb2a9a1a0ca8acbe3dcd285d
dumpstate was not dumping any stack traces for vm processes because
it was failing the string compare for /system/bin/app_process.
64-bit devices use app_process32 and app_process64 instead of
app_process, and zygote64 alongside zygote. Change the string
matching to be prefix matching.
(cherry picked from commit 8eb25d552b)
Change-Id: I6b1568161fae278f0e6107990e5b750cf0ca902b
Increased the maximum time dumpstate will wait for SIGQUIT process
to finish dumping its thread stacks to the logfile to 5 seconds.
Bug: 14057177
Change-Id: I0b43004512855d202f2fe0ea7b0e934e77a3a070
libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.
Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.
Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Set the security context on the directory used
to dump Dalvik and native stack traces.
Change-Id: Iba13783f10e850485ce1a8d4aa5792d55085eb22
Signed-off-by: Robert Craig <rpcraig@tycho.ncsc.mil>
Add flag that sends BUGREPORT_FINISHED broadcast when dumpstate
is finished, including the resulting filesystem paths. Also reduces
directory creation to 0770.
Bug: 7005318
Change-Id: Id4c6b699a56f8acd859b7ab73368500e1a8f3c67
Use prctl(PR_SET_PDEATHSIG, SIGKILL) in each forked child to ensure
it dies when dumpstate dies.
This is important for two cases:
- dumpstate runs a timer for each child process. On expiration, it
sends SIGTERM to kill the process. Sometimes SIGTERM isn't enough
to kill a hung process, so the child lives on.
- When dumpstate is killed by the user before completing, outstanding
children continue to run and generate output.
Change-Id: I96e0dc918c26d56c9fee53611980ba2edd238712
for_each_pid only finds processes and not their threads. Add
for_each_tid and call it for show_wchan so we can see where all
threads are blocked in the kernel.
Change-Id: Iffb59f7c2933cecf51cdd358a36e19932c2f24c7
The umask changed for init. We have to force /data/anr to be world
readble and /data/anr/traces.txt to be world writable so dalvik
processes can write to it.
Hopefully this is a short term change while we investigate tightening
up these permissions.
Bug: 6300296
Change-Id: Iacb4c9f1bc69d2ac679697f9cf9a52694f888489