crash_dump: switch to PTRACE_SEIZE.
ptrace(PTRACE_ATTACH) does not immediately put the traced process in a stopped state. If we manage to call PTRACE_CONT on it before it finishes, we'll fail. Switch to using PTRACE_SEIZE and PTRACE_INTERRUPT to guarantee that the target stops immediately. This also has the advantage of never putting the process in group-stop state, which means if we exit prematurely (e.g. if we crash during stack unwinding), the target process will be resumed without any intervention needed. Bug: http://b/34472671 Test: while true; do debuggerd -b `pidof audioserver`; done Change-Id: I7549f67489646cf300b8c9aa8c735e5e897806ef
Loading
Please register or sign in to comment