mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
mac: Update test and comments with feedback from Apple bug
Apple has responded to their bug 29079442 with a resolution stating that these are not corpse ports but task ports that have changed after execve(), as part of the large task port and execve() strategy rewrite from 10.12.1. The comments being replaced were written before we had 10.12.1 source code. Now that we can see what’s going on, revise the comments, and re-enable the task port check for the non-execve() test variants. https://openradar.appspot.com/29079442 https://googleprojectzero.blogspot.com/2016/10/taskt-considered-harmful.html Bug: crashpad:137 Test: crashpad_snapshot_test MachOImageAnnotationsReader.CrashDyld Change-Id: I463637816085f4165b92b85a5b98bfeddcdf4094 Reviewed-on: https://chromium-review.googlesource.com/451120 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
6a5695967f
commit
8e82f6fde0
@ -117,14 +117,14 @@ class TestMachOImageAnnotationsReader final
|
|||||||
bool* destroy_complex_request) override {
|
bool* destroy_complex_request) override {
|
||||||
*destroy_complex_request = true;
|
*destroy_complex_request = true;
|
||||||
|
|
||||||
// In 10.12, dyld fatal errors as tested by test_type_ = kCrashDyld are via
|
if (test_type_ != kCrashDyld) {
|
||||||
// abort_with_payload(). In 10.12.1, the task port delivered in an exception
|
// In 10.12.1 and later, the task port will not match ChildTask() in the
|
||||||
// message for this termination type is a corpse, even when the exception is
|
// kCrashDyld case, because kCrashDyld uses execl(), which results in a
|
||||||
// EXC_CRASH and not EXC_CORPSE_NOTIFY. The corpse task port (here, |task|)
|
// new task port being assigned.
|
||||||
// is distinct from the process’ original task port (ChildTask()). This is
|
EXPECT_EQ(ChildTask(), task);
|
||||||
// filed as https://openradar.appspot.com/29079442.
|
}
|
||||||
//
|
|
||||||
// Instead of comparing task ports, compare PIDs.
|
// The process ID should always compare favorably.
|
||||||
pid_t task_pid;
|
pid_t task_pid;
|
||||||
kern_return_t kr = pid_for_task(task, &task_pid);
|
kern_return_t kr = pid_for_task(task, &task_pid);
|
||||||
EXPECT_EQ(KERN_SUCCESS, kr) << MachErrorMessage(kr, "pid_for_task");
|
EXPECT_EQ(KERN_SUCCESS, kr) << MachErrorMessage(kr, "pid_for_task");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user