ios: Fix crash in ObjcExceptionPreprocessor. [crashpad/crashpad : main]

已查看 0 次
跳至第一个未读帖子

Justin Cohen (Gerrit)

未读,
2023年3月10日 16:01:322023/3/10
收件人 Robert Sesek、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Robert Sesek.

Patch set 5:Commit-Queue +1

View Change

1 comment:

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 5
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-Attention: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Fri, 10 Mar 2023 21:01:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Ben Hamilton (Gerrit)

未读,
2023年3月10日 16:23:412023/3/10
收件人 Justin Cohen、Robert Sesek、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Justin Cohen, Robert Sesek.

View Change

4 comments:

  • File client/ios_handler/exception_processor.mm:

    • Patch Set #5, Line 141: if ([exception respondsToSelector:@selector(name)]) {

      You don't need the respondsToSelector: tests now that you've verified at runtime that `exception` is an `NSException*`.

    • Patch Set #5, Line 228: NSArray<NSNumber*>* address_array = [exception callStackReturnAddresses];

      You can only do this if the -isKindOfClass: test passes.

    • Patch Set #5, Line 273: std::atomic<NSException*> last_exception_ = nil;

      Should we make this a `void *` so we know the only safe operation is pointer comparison?

    • Patch Set #5, Line 341:

        if ([exception respondsToSelector:@selector(name)] &&
      [exception respondsToSelector:@selector(reason)]) {
      NSString* value = [NSString

      `if ([exception isKindOfClass:[NSException class]) {` ?

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 5
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-CC: Ben Hamilton <benha...@google.com>
Gerrit-Attention: Justin Cohen <justi...@chromium.org>
Gerrit-Attention: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Fri, 10 Mar 2023 21:23:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Justin Cohen (Gerrit)

未读,
2023年3月11日 09:41:592023/3/11
收件人 Ben Hamilton、Robert Sesek、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Ben Hamilton, Robert Sesek.

View Change

4 comments:

    • You don't need the respondsToSelector: tests now that you've verified at runtime that `exception` is […]

      Done

    • Patch Set #5, Line 228: NSArray<NSNumber*>* address_array = [exception callStackReturnAddresses];

      You can only do this if the -isKindOfClass: test passes.

    • Done

    • Patch Set #5, Line 273: std::atomic<NSException*> last_exception_ = nil;

      Should we make this a `void *` so we know the only safe operation is pointer comparison?

    • Good idea.

    • Patch Set #5, Line 341:

        if ([exception respondsToSelector:@selector(name)] &&
      [exception respondsToSelector:@selector(reason)]) {
      NSString* value = [NSString

      `if ([exception isKindOfClass:[NSException class]) {` ?

    • Done

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 7
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-CC: Ben Hamilton <benha...@google.com>
Gerrit-Attention: Ben Hamilton <benha...@google.com>
Gerrit-Attention: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Sat, 11 Mar 2023 14:41:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ben Hamilton <benha...@google.com>
Gerrit-MessageType: comment

Ben Hamilton (Gerrit)

未读,
2023年3月13日 11:50:472023/3/13
收件人 Justin Cohen、Robert Sesek、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Justin Cohen, Robert Sesek.

Patch set 7:Code-Review +1

View Change

1 comment:

    •   if ([exception isKindOfClass:[NSException class]]) {

    •     NSString* value = [NSString
      stringWithFormat:@"%@ reason %@", [exception name], [exception reason]];
      key->Set(base::SysNSStringToUTF8(value));
      }

      Worth adding an `else` block that just appends `[exception description]`?

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 7
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Ben Hamilton <benha...@google.com>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-Attention: Justin Cohen <justi...@chromium.org>
Gerrit-Attention: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Mon, 13 Mar 2023 15:50:44 +0000

Justin Cohen (Gerrit)

未读,
2023年3月13日 13:26:402023/3/13
收件人 Ben Hamilton、Robert Sesek、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Robert Sesek.

View Change

1 comment:

    • Patch Set #7, Line 349:

        if ([exception isKindOfClass:[NSException class]]) {
      NSString* value = [NSString
      stringWithFormat:@"%@ reason %@", [exception name], [exception reason]];
      key->Set(base::SysNSStringToUTF8(value));
      }

      Worth adding an `else` block that just appends `[exception description]`?

    • Done

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 8
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Ben Hamilton <benha...@google.com>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-Attention: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Mon, 13 Mar 2023 17:26:36 +0000

Robert Sesek (Gerrit)

未读,
2023年3月14日 18:27:232023/3/14
收件人 Justin Cohen、Robert Sesek、Ben Hamilton、Crashpad LUCI CQ、crashp...@chromium.org

Attention is currently required from: Justin Cohen.

Patch set 11:Code-Review +1

View Change

1 comment:

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 11
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Ben Hamilton <benha...@google.com>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-Attention: Justin Cohen <justi...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Mar 2023 22:27:19 +0000

Justin Cohen (Gerrit)

未读,
2023年3月14日 20:23:442023/3/14
收件人 Robert Sesek、Ben Hamilton、Crashpad LUCI CQ、crashp...@chromium.org

Patch set 12:Commit-Queue +2

View Change

1 comment:

    • Done

To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 12
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Ben Hamilton <benha...@google.com>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Mar 2023 00:23:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Robert Sesek <rse...@chromium.org>
Gerrit-MessageType: comment

Crashpad LUCI CQ (Gerrit)

未读,
2023年3月14日 20:49:412023/3/14
收件人 Justin Cohen、Robert Sesek、Ben Hamilton、crashp...@chromium.org

Crashpad LUCI CQ submitted this change.

View Change



11 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: client/ios_handler/exception_processor.mm
Insertions: 1, Deletions: 1.

@@ -1,5 +1,5 @@
// Copyright 2020 The Crashpad Authors
-/as /
+//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
```

Approvals: Justin Cohen: Commit Robert Sesek: Looks good to me Ben Hamilton: Looks good to me
ios: Fix crash in ObjcExceptionPreprocessor.

ObjcExceptionPreprocessor is a 'reasonable effort' attempt to catch an
NSException minidump at time the exception is thrown as opposed to when the application terminates due to the exception. If multiple
exceptions are thrown at the same time, Crashpad should correctly
report the final uncaught exception, but the minidump may not
represent the full `caught-at-thrown` minidump.

- Don't assume ObjcExceptionPreprocessor throws an NSException.
- Don't retain/release the exception. Instead of calling isEqual,
just use a simple pointer comparison.
- Make last_exception atomic.

Bug: crashpad: 445, 446
Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4317110
Reviewed-by: Ben Hamilton <benha...@google.com>
Commit-Queue: Justin Cohen <justi...@chromium.org>
Reviewed-by: Robert Sesek <rse...@chromium.org>
---
M client/ios_handler/exception_processor.mm
M test/ios/crash_type_xctest.mm
M test/ios/host/cptest_application_delegate.mm
M test/ios/host/cptest_shared_object.h
4 files changed, 85 insertions(+), 16 deletions(-)


To view, visit change 4317110. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Gerrit-Change-Number: 4317110
Gerrit-PatchSet: 13
Gerrit-Owner: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Ben Hamilton <benha...@google.com>
Gerrit-Reviewer: Crashpad LUCI CQ <crashpa...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Justin Cohen <justi...@chromium.org>
Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
Gerrit-MessageType: merged
回复全部
回复作者
转发
0 个新帖子