Skip to content

Fix: Manually add Dyld image to images cache + locate addresses in dyld #5418

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

Merged
merged 19 commits into from
Jun 20, 2025

Conversation

itaybre
Copy link
Contributor

@itaybre itaybre commented Jun 16, 2025

📜 Description

Manually add Dyld image to images cache + locate addresses in dyld

With these changes they now show up, instead of appearing as unknown
Now:
image
Note: there is still an unkown address sometimes, which not even Apple's crash reports find:

20  UIKitCore                     	       0x185c597d4 -[UIApplication _run] + 796
21  UIKitCore                     	       0x185c5dba0 UIApplicationMain + 124
22  iOS-Swift                     	       0x10025b9c4 main + 64 (AppDelegate.swift:5)
23  ???                           	       0x1004993d4 ???
24  dyld                          	       0x10060eb98 start + 6076

Before:
image

💡 Motivation and Context

Since iOS 15 and macOS 12, there are prelinked libraries when running apps, which do not show up when calling _dyld_image_count, thus we do not show there in our reports.

Fixes: #1620

💚 How did you test it?

Unit testing + Our test sample app

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Sorry, something went wrong.

Copy link

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 9 lines in your changes missing coverage. Please review.

Project coverage is 86.105%. Comparing base (61dc57e) to head (00747b2).
Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
...ryCrash/Recording/Tools/SentryCrashDynamicLinker.c 93.103% 5 Missing and 1 partial ⚠️
...entryCrash/Recording/SentryCrashBinaryImageCache.c 87.500% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5418       +/-   ##
=============================================
+ Coverage   86.063%   86.105%   +0.042%     
=============================================
  Files          399       400        +1     
  Lines        34621     34698       +77     
  Branches     14980     15019       +39     
=============================================
+ Hits         29796     29877       +81     
+ Misses        4780      4773        -7     
- Partials        45        48        +3     
Files with missing lines Coverage Δ
...ryCrash/Recording/Tools/SentryCrashDynamicLinker.h 100.000% <100.000%> (ø)
...entryCrash/Recording/SentryCrashBinaryImageCache.c 96.992% <87.500%> (-2.107%) ⬇️
...ryCrash/Recording/Tools/SentryCrashDynamicLinker.c 90.595% <93.103%> (+5.868%) ⬆️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61dc57e...00747b2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Jun 16, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.69 ms 1253.00 ms 28.31 ms
Size 23.75 KiB 848.00 KiB 824.25 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3f6c30b 1252.98 ms 1266.22 ms 13.24 ms
087a3b3 1231.73 ms 1251.13 ms 19.39 ms
f8833c4 1229.69 ms 1236.45 ms 6.76 ms
6e342ac 1202.98 ms 1228.74 ms 25.76 ms
becc941 1221.90 ms 1240.37 ms 18.47 ms
dc0db9e 1246.06 ms 1260.46 ms 14.40 ms
2f8b3a8 1233.76 ms 1260.24 ms 26.48 ms
c7e720a 1221.46 ms 1247.84 ms 26.38 ms
b2f82fa 1236.94 ms 1262.86 ms 25.92 ms
4f31f66 1213.96 ms 1236.76 ms 22.80 ms

App size

Revision Plain With Sentry Diff
3f6c30b 22.85 KiB 408.88 KiB 386.03 KiB
087a3b3 21.58 KiB 707.42 KiB 685.84 KiB
f8833c4 21.58 KiB 422.66 KiB 401.08 KiB
6e342ac 20.76 KiB 436.66 KiB 415.90 KiB
becc941 21.58 KiB 419.82 KiB 398.24 KiB
dc0db9e 20.76 KiB 419.62 KiB 398.86 KiB
2f8b3a8 20.76 KiB 434.72 KiB 413.96 KiB
c7e720a 22.30 KiB 851.31 KiB 829.00 KiB
b2f82fa 20.76 KiB 419.62 KiB 398.86 KiB
4f31f66 21.58 KiB 682.39 KiB 660.81 KiB

Previous results on branch: itaybre/dyld_image

Startup times

Revision Plain With Sentry Diff
0fe31b7 1220.00 ms 1243.10 ms 23.10 ms
04feed7 1221.96 ms 1244.73 ms 22.77 ms
ae51a85 1213.08 ms 1236.35 ms 23.27 ms
4d30b04 1226.94 ms 1245.63 ms 18.69 ms

App size

Revision Plain With Sentry Diff
0fe31b7 23.75 KiB 847.50 KiB 823.75 KiB
04feed7 23.75 KiB 847.97 KiB 824.22 KiB
ae51a85 23.75 KiB 847.84 KiB 824.09 KiB
4d30b04 23.75 KiB 848.00 KiB 824.25 KiB

@itaybre itaybre marked this pull request as ready for review June 17, 2025 15:53
Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. We should probably address the codecov annotations here if at all possible, to address some of the non-happy-path possibilities, to make sure things don't break down if we return a NULL or 0 somewhere that doesn't handle it correctly.

@itaybre itaybre merged commit 7ec2c27 into main Jun 20, 2025
169 of 177 checks passed
@itaybre itaybre deleted the itaybre/dyld_image branch June 20, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shows unknown "Called from" stack frame in crash report
3 participants