Skip to content

Commit

Permalink
Merge pull request #325 from getsentry/txiao/fix/mark-sentry-frames-a…
Browse files Browse the repository at this point in the history
…s-system-for-cocoa

fix(cocoa): Mark sentry frames as system
  • Loading branch information
Zylphrex authored Sep 29, 2023
2 parents 71132de + c7b98b0 commit 13f1584
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Close remaining open events in Android profiles. ([#316](https://github.com/getsentry/vroom/pull/316))
- Enforce minimum frame duration for frame drop issue. ([#319](https://github.com/getsentry/vroom/pull/319))
- Mark sentry frames as system frames when it's dynamically linked. ([#325](https://github.com/getsentry/vroom/pull/325))

**Internal**

Expand Down
10 changes: 10 additions & 0 deletions internal/frame/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
var (
windowsPathRegex = regexp.MustCompile(`(?i)^([a-z]:\\|\\\\)`)
packageExtensionRegex = regexp.MustCompile(`\.(dylib|so|a|dll|exe)$`)
cocoaSystemPackage = map[string]struct{}{
"Sentry": {},
}
)

type (
Expand Down Expand Up @@ -160,6 +163,13 @@ func (f Frame) IsCocoaApplicationFrame() bool {
// as a system frame as it does not contain any user code
return false
}

// Some packages are known to be system packages.
// If we detect them, mark them as a system frame immediately.
if _, exists := cocoaSystemPackage[f.ModuleOrPackage()]; exists {
return false
}

return packageutil.IsCocoaApplicationPackage(f.Package)
}

Expand Down
8 changes: 8 additions & 0 deletions internal/frame/frame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ func TestIsCocoaApplicationFrame(t *testing.T) {
},
isApplication: true,
},
{
name: "symbolicate_internal",
frame: Frame{
Function: "symbolicate_internal",
Package: "/private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/App.app/Frameworks/Sentry.framework/Sentry",
},
isApplication: false,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 13f1584

Please sign in to comment.