-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sdk-crashes): Improve Cocoa crash detection #52119
Conversation
This PR adds a test case with frames from a real-world crash caused by our MetricKit integration. All data was anonymized. While adding the test case, a couple of problems surfaced that this PR addresses: 1. Correctly detect crashes from Swift files starting with SentryMX. 2. Correctly detect crashes from class extensions such as NSDate(SentryExtras). 3. Ignore in_app when detecting an SDK crash, as customers can change the in_app rules. Furthermore, if they use static linking for including Sentry Cocoa, Cocoa SDK frames can be marked as in_app. Instead, the algorithm only checks if frames are SDK frames or from system libraries.
@@ -44,3 +54,14 @@ def is_sdk_frame(self, frame: Mapping[str, Any]) -> bool: | |||
return True | |||
|
|||
return False | |||
|
|||
def is_system_library_frame(self, frame: Mapping[str, Any]) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this function from event_stripper to there.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52119 +/- ##
=======================================
Coverage 79.31% 79.31%
=======================================
Files 4901 4901
Lines 205111 205123 +12
Branches 35063 35065 +2
=======================================
+ Hits 162689 162702 +13
- Misses 37460 37462 +2
+ Partials 4962 4959 -3
|
This PR seems huge, with almost 300 additions, but around 150 are test case stacktrace frame data.
This PR adds a test case with frames from a real-world crash caused by our MetricKit integration. All data was anonymized. While adding the test case, a couple of problems surfaced that this PR addresses: