fix(apple-crash-report): Make code more defensive#110617
Merged
tobias-wilfert merged 6 commits intomasterfrom Mar 16, 2026
Merged
fix(apple-crash-report): Make code more defensive#110617tobias-wilfert merged 6 commits intomasterfrom
tobias-wilfert merged 6 commits intomasterfrom
Conversation
jjbayer
reviewed
Mar 13, 2026
| hex(image_addr), | ||
| hex(image_addr + debug_image["image_size"] - 1), | ||
| # Default to 1 so the end address isn't before the start when image_size is missing or None | ||
| hex(image_addr + (debug_image.get("image_size") or 1) - 1), |
Member
There was a problem hiding this comment.
I have no idea where this string is used, but is it still correct when we fall back to 1?
Member
Author
There was a problem hiding this comment.
This is used in a niche area of the product (issue with a replay of me triggering it).
Member
Author
|
As discussed offline changed it now to also use the |
jjbayer
approved these changes
Mar 16, 2026
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Double angle brackets in debug_id unknown fallback output
- Changed debug_id fallback from NATIVE_UNKNOWN_STRING to 'unknown' string since format string already provides angle bracket wrapping, preventing double brackets.
Or push these changes by commenting:
@cursor push 48583836ae
Preview (48583836ae)
diff --git a/src/sentry/lang/native/applecrashreport.py b/src/sentry/lang/native/applecrashreport.py
--- a/src/sentry/lang/native/applecrashreport.py
+++ b/src/sentry/lang/native/applecrashreport.py
@@ -306,6 +306,6 @@
hex(image_addr + image_size - 1) if image_size else NATIVE_UNKNOWN_STRING,
image_name(debug_image.get("code_file") or NATIVE_UNKNOWN_STRING),
get_path(self.context, "device", "arch") or NATIVE_UNKNOWN_STRING,
- (debug_image.get("debug_id") or "").replace("-", "").lower() or NATIVE_UNKNOWN_STRING,
+ (debug_image.get("debug_id") or "").replace("-", "").lower() or "unknown",
debug_image.get("code_file") or NATIVE_UNKNOWN_STRING,
)
diff --git a/tests/sentry/lang/native/test_applecrashreport.py b/tests/sentry/lang/native/test_applecrashreport.py
--- a/tests/sentry/lang/native/test_applecrashreport.py
+++ b/tests/sentry/lang/native/test_applecrashreport.py
@@ -551,7 +551,7 @@
)
assert (
binary_image
- == "0xd69a000 - 0xd712fff SentrySwift x86 <<unknown>> /Users/haza/Library/Developer/CoreSimulator/Devices/DDB32F4C-97CF-4E2B-BD10-EB940553F223/data/Containers/Bundle/Application/8F8140DF-B25B-4088-B5FB-57F474A49CD6/SwiftExample.app/Frameworks/SentrySwift.framework/SentrySwift"
+ == "0xd69a000 - 0xd712fff SentrySwift x86 <unknown> /Users/haza/Library/Developer/CoreSimulator/Devices/DDB32F4C-97CF-4E2B-BD10-EB940553F223/data/Containers/Bundle/Application/8F8140DF-B25B-4088-B5FB-57F474A49CD6/SwiftExample.app/Frameworks/SentrySwift.framework/SentrySwift"
)This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


We have the following 2 errors in Sentry, this updates the code to fix them, by making it more defensive so it does not crash.
ref: https://linear.app/getsentry/issue/INGEST-813/fix-applecrashreport-logic-in-sentry