-
-
Notifications
You must be signed in to change notification settings - Fork 372
fix: Crash in SentryOutOfMemoryScopeObserver #2557
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
Conversation
Writing data to disk when the file handle is broken caused crashes. This is fixed now by capturing an exception. Fixes GH-2548
Samples/TrendingMovies/TrendingMovies/ImageProcessing/ColorArt.swift
Outdated
Show resolved
Hide resolved
armcknight
left a comment
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.
Mostly looks fine, but I do wonder about how the breadcrumb counter is maintained. The other comments are not blockers, just suggestions.
| self.breadcrumbCounter = 0; | ||
| @try { | ||
| [self.fileHandle seekToEndOfFile]; | ||
| [self.fileHandle writeData:data]; |
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.
We should use the newer one with an inout error in addition to wrapping in try, since this one’s deprecated and the error parameter might catch additional info or be used instead of an exception, which would help performance.
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.
Yes, but this one only works on iOS 13.0 and above, see https://developer.apple.com/documentation/foundation/nsfilehandle/3172533-writedata
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 would create a follow-up issue for using the new APIs, is that fine for you?
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.
Sure, that’s fine!
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c929040 | 1254.84 ms | 1278.42 ms | 23.58 ms |
| c2a9b60 | 1222.10 ms | 1240.62 ms | 18.52 ms |
| 8607e67 | 1255.80 ms | 1259.50 ms | 3.70 ms |
| 1453a8a | 1224.98 ms | 1250.31 ms | 25.33 ms |
| 9754750 | 1234.71 ms | 1265.21 ms | 30.49 ms |
| 9ad4a5f | 1251.53 ms | 1276.46 ms | 24.93 ms |
| 864c39a | 1191.14 ms | 1233.38 ms | 42.24 ms |
| 4a66f00 | 1224.73 ms | 1241.14 ms | 16.41 ms |
| e958899 | 1230.40 ms | 1248.31 ms | 17.91 ms |
| 944bebe | 1252.12 ms | 1264.88 ms | 12.76 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c929040 | 20.51 KiB | 333.10 KiB | 312.59 KiB |
| c2a9b60 | 20.50 KiB | 333.54 KiB | 313.04 KiB |
| 8607e67 | 20.50 KiB | 338.99 KiB | 318.49 KiB |
| 1453a8a | 20.50 KiB | 361.89 KiB | 341.39 KiB |
| 9754750 | 20.75 KiB | 374.16 KiB | 353.41 KiB |
| 9ad4a5f | 20.50 KiB | 342.23 KiB | 321.73 KiB |
| 864c39a | 20.51 KiB | 335.57 KiB | 315.06 KiB |
| 4a66f00 | 20.51 KiB | 331.79 KiB | 311.28 KiB |
| e958899 | 20.51 KiB | 331.92 KiB | 311.41 KiB |
| 944bebe | 20.75 KiB | 374.39 KiB | 353.64 KiB |
📜 Description
Writing data to disk when the file handle is broken causes crashes. This is fixed now by capturing an exception.
💡 Motivation and Context
Fixes GH-2548
💚 How did you test it?
Unit tests.
📝 Checklist
🔮 Next steps