History log of /system/core/debuggerd/debuggerd_test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a1c9e943c0687a2fd1195033824d22600abbd51e 01-Jun-2017 Josh Gao <jmgao@google.com> 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
Merged-In: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
Change-Id: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
(cherry picked from commit 5675f3c321b7c6a9bbb2a7aacf18a01126f2f2cb)
/system/core/debuggerd/debuggerd_test.cpp
92abfb41f3c96272268c065029275b39297d82a7 05-May-2017 Josh Gao <jmgao@google.com> debuggerd_handler: use syscall(__NR_get[pt]id) instead of get[pt]id.

bionic's cached values for getpid/gettid can be invalid if the crashing
process manually invoked clone to create a thread or process, which
will lead the crash_dump refusing to do anything, because it sees the
actual values.

Use the getpid/gettid syscalls directly to ensure correct values on
this end.

Bug: http://b/37769298
Test: debuggerd_test
Change-Id: I0b1e652beb1a66e564a48b88ed7fa971d61c6ff9
(cherry picked from commit 2e7b8e2d1aff139895127a93c020bddb98a0f26e)
/system/core/debuggerd/debuggerd_test.cpp
5fd02a8dbc44964018a7375ab1195e3c0c89919a 28-Apr-2017 Josh Gao <jmgao@google.com> debuggerd_handler: don't assume that abort message implies fatal.

Applications can set abort messages via android_set_abort_message
without actually aborting. This leads to following non-fatal dumps
printing their output to logcat in the same format as a regular crash.

Bug: http://b/37754992
Test: debuggerd_test
Change-Id: I9c5e942984dfda36448860202b0ff1c2950bdd07
(cherry picked from commit e06f2a4886a237abbc203942c970e2fc528003da)
/system/core/debuggerd/debuggerd_test.cpp
c723138ed2834b97a27fdec394fd7196f840d0ff 04-Apr-2017 Josh Gao <jmgao@google.com> debuggerd_test: remove useless pipe.

Bug: http://b/36897117
Test: none
Change-Id: Ib8369088153fe44de2af9037299bdfce7b709b98
(cherry picked from commit 951cf7007147168164e8cd60ff093627f387aad7)
/system/core/debuggerd/debuggerd_test.cpp
845a2f9b4aa5b7f4742e1649bb74a2857d6492d4 03-Apr-2017 Josh Gao <jmgao@google.com> debuggerd_test: add test for process/thread names.

Make sure that we can get the process/thread names for nondumpable
processes with capabilities.

Bug: http://b/36237221
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Change-Id: Iedd4eae18065c2e64abeebff15e3b9b09a630550
(cherry picked from commit a5199a9e43f865a08df12b3c89371ee3c85d6cc6)
/system/core/debuggerd/debuggerd_test.cpp
dd6187677114cc9f308342db159076a8b64b53f2 31-Mar-2017 Josh Gao <jmgao@google.com> tombstoned: add tests for b/36685795.

Add some tests for edge cases which may have triggered b/36685795.

Bug: http://b/36685795
Test: debuggerd_test
Change-Id: I20670684c8dae422af157be21e44ba5d6d3214d3
(cherry picked from commit 352a84574dd0f3be0c30d15c0c577c226ec28c2f)
/system/core/debuggerd/debuggerd_test.cpp
df8cb05498a510f5bff5b2eb7bd704e77bf5664e 31-Mar-2017 Josh Gao <jmgao@google.com> tombstoned: fix a race between intercept and crash_dump.

Previously, there was no way to detect when tombstoned processed an
intercept request packet, making it possible for a intercept request
followed by a crash_dump being processed in the wrong order.

Add a response to intercept registration, to eliminate this race.

Test: debuggerd_test
Change-Id: If38c6d14081ebc86ff1ed0edd7afaeafc40a8381
(cherry picked from commit 460b336d6a05a8527633ab5c4509988ebb18ed30)
/system/core/debuggerd/debuggerd_test.cpp
502cfd22ba0e7bb4f8276438125a959547226f0a 17-Feb-2017 Josh Gao <jmgao@google.com> debuggerd_test: add capability test.

Also, remove the dependency on crasher.

Bug: http://b/35100921
Bug: http://b/35241370
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Test: /data/nativetest64/debuggerd_test/debuggerd_test64
Change-Id: I318f6de764d435251417953bf175ba321b59981f
/system/core/debuggerd/debuggerd_test.cpp
c3c8c029ecc46aa5d9fe6a5ee7c77c8adc5b23b5 14-Feb-2017 Josh Gao <jmgao@google.com> debuggerd_handler: don't use waitpid(..., __WCLONE).

waitpid(..., __WCLONE) fails with ECHILD when passed an explicit PID to
wait for. __WALL and __WCLONE don't seem to be necessary when waiting
for a specific pid, so just pass 0 in the flags instead.

Bug: http://b/35327712
Test: /data/nativetest/debuggerd_test/debuggerd_test32 --gtest_filter="*zombie*"
Change-Id: I3dd7a1bdf7ff35fdfbf631429c089ef4e3172855
/system/core/debuggerd/debuggerd_test.cpp
7a0ee64f9df226012d19cd50ed93117d03cbb01d 07-Feb-2017 Josh Gao <jmgao@google.com> debuggerd_test: improve error when crasher fails to exec.

Bug: http://b/35100742
Test: rm /system/bin/crasher && /data/nativetest/debugerd_test/debuggerd_test32
Change-Id: I02faec3b7f7ef62bb8a2ac2af730506e3d28e03e
/system/core/debuggerd/debuggerd_test.cpp
a7d7eb6d2ae98e1147af678cf7e78ce4ff83e529 07-Feb-2017 Josh Gao <jmgao@google.com> debuggerd_test: fix crasher path.

https://android-review.googlesource.com/#/c/331200 moved crasher to
using soong, which changed its location from /system/xbin/crasher to
/system/bin/crasher.

Bug: http://b/35100742
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Test: /data/nativetest64/debuggerd_test/debuggerd_test64
Change-Id: I16a2050b257277023773cc0c960b5ab36e0c7cd4
/system/core/debuggerd/debuggerd_test.cpp
fca7ca35850438230428a0018d7b933f7c8a847c 23-Jan-2017 Josh Gao <jmgao@google.com> debuggerd_handler: properly crash when PR_GET_DUMPABLE is 0.

Actually exit when receiving a signal via kill(2) or raise(2) and
PR_GET_DUMPABLE is 0.

Bug: none
Test: /data/nativetest/debuggerd_test/debuggerd_test32
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=pthread_DeathTest.pthread_mutex_lock_null_64
Change-Id: I833a2a34238129237bd9f953959ebda51d8d04d7
/system/core/debuggerd/debuggerd_test.cpp
7c6e3133f57b6c908e211c0013fcb68d5a44d919 23-Jan-2017 Josh Gao <jmgao@google.com> crash_dump: set a watchdog timer.

PTRACE_DETACH is only necessary if the process is in group-stop state,
the tracer exiting is sufficient to detach and resume tracees.

Using this, set a 5 second timer with alarm(2) that just kills us, to
avoid leaving processes stopped.

Bug: http://b/34472671
Test: debuggerd_test
Test: crasher + manually inserting a 10 second sleep into crash_dump
Change-Id: Iacaa796f79037aa1585f3f2159abe45ef0069311
/system/core/debuggerd/debuggerd_test.cpp
cbe70cb0a8cb0171f3802273050e851a47b090ed 19-Oct-2016 Josh Gao <jmgao@google.com> debuggerd: advance our amazing bet.

Remove debuggerd in favor of a helper process that gets execed by
crashing processes.

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
/system/core/debuggerd/debuggerd_test.cpp