Skip to content

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Jun 4, 2025

📜 Description

GH-5225 introduced a bug so that nonfatal events have missing debug_meta, leading to redacted stacktraces. Fatal events such as crashes aren't impacted by this bug. The root cause was that the initializers of specific classes were getting initialized in the SentryDependencyContainer, which also accessed the shared instance of the SentryDependencyContainer, causing a chicken-egg problem. This is fixed now by removing the usage of SentryDependencyContainer of the dependencies initialized in SentryDependencyContainer.init. Furthermore, the SentryDependencyContainer now uses SENTRY_GRACEFUL_FATAL to exit the application in debug and log a warning in production.

Doc PRs for the troubleshooting guide: getsentry/sentry-docs#13921

fixes #5334

💡 Motivation and Context

Surfaced by a customer

💚 How did you test it?

Manually with a TestFlight build.

Capture Message now again has a proper stacktrace with a symbolicated event.

Screenshot 2025-06-04 at 16 33 10

And also debug_meta
Screenshot 2025-06-04 at 16 33 26

✅ Capture message event: https://sentry-sdks.sentry.io/issues/6656660577/events/5c8be3a04b5543ad947b9dec11c3c730/?project=5428557

✅ And custom exception: https://sentry-sdks.sentry.io/issues/2862440042/events/4782ca3b17764e14a18a80e7a036e42f/?project=5428557

✅ Crash event: https://sentry-sdks.sentry.io/issues/6044162827/events/f8d75320310141bb8be1dd8d1ee193fb/?project=5428557

✅ Fatal error: https://sentry-sdks.sentry.io/issues/6536640165/events/1ff359d033204a4cb668e1cff4da7ea7/?project=5428557

We are going to add an integration test after the hotfix.

📝 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.

Copy link

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 82.53968% with 11 lines in your changes missing coverage. Please review.

Project coverage is 85.974%. Comparing base (dcf4a8e) to head (89806ac).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Sentry/SentryDependencyContainer.m 72.413% 8 Missing ⚠️
Sources/Sentry/SentrySDK.m 0.000% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5352       +/-   ##
=============================================
- Coverage   85.981%   85.974%   -0.007%     
=============================================
  Files          394       394               
  Lines        34190     34217       +27     
  Branches     14773     14790       +17     
=============================================
+ Hits         29397     29418       +21     
- Misses        4752      4759        +7     
+ Partials        41        40        -1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryExtraContextProvider.m 84.615% <100.000%> (-0.570%) ⬇️
Sources/Sentry/SentryUIApplication.m 50.819% <100.000%> (+0.819%) ⬆️
Sources/Sentry/SentrySDK.m 88.095% <0.000%> (-0.705%) ⬇️
Sources/Sentry/SentryDependencyContainer.m 87.804% <72.413%> (-2.956%) ⬇️

... and 7 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 dcf4a8e...89806ac. 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 4, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1217.44 ms 1245.41 ms 27.97 ms
Size 23.76 KiB 837.82 KiB 814.06 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
995c3cb 1215.41 ms 1231.15 ms 15.74 ms
c0c1496 1201.19 ms 1228.36 ms 27.17 ms
8aba9c4 1236.94 ms 1248.29 ms 11.35 ms
2911760 1217.84 ms 1232.48 ms 14.64 ms
25d925a 1232.89 ms 1248.41 ms 15.52 ms
bd8b1bf 1228.94 ms 1251.19 ms 22.25 ms
dd0557f 1251.82 ms 1256.76 ms 4.94 ms
2af280d 1232.31 ms 1249.98 ms 17.67 ms
f1e2aa7 1239.31 ms 1259.08 ms 19.78 ms
3cba0e8 1250.86 ms 1258.39 ms 7.53 ms

App size

Revision Plain With Sentry Diff
995c3cb 22.85 KiB 412.66 KiB 389.81 KiB
c0c1496 22.85 KiB 407.45 KiB 384.60 KiB
8aba9c4 21.58 KiB 544.72 KiB 523.14 KiB
2911760 21.58 KiB 697.69 KiB 676.11 KiB
25d925a 21.58 KiB 418.82 KiB 397.24 KiB
bd8b1bf 22.32 KiB 761.25 KiB 738.93 KiB
dd0557f 22.85 KiB 411.75 KiB 388.91 KiB
2af280d 20.76 KiB 435.22 KiB 414.46 KiB
f1e2aa7 22.31 KiB 768.52 KiB 746.21 KiB
3cba0e8 22.84 KiB 403.19 KiB 380.34 KiB

Previous results on branch: fix/missing-debug-meta

Startup times

Revision Plain With Sentry Diff
d041063 1208.54 ms 1237.23 ms 28.69 ms
601b8af 1245.09 ms 1258.78 ms 13.70 ms

App size

Revision Plain With Sentry Diff
d041063 23.76 KiB 837.64 KiB 813.88 KiB
601b8af 23.76 KiB 837.68 KiB 813.92 KiB

GH-5225 introduced a bug so that nonfatal events have missing
debug_meta, leading to redacted stacktraces. Fatal events such as
crashes aren't impacted by this bug. The root cause was that the
initializers of specific classes were getting initialized in the
SentryDependencyContainer, which also accessed the shared instance of
the SentryDependencyContainer, causing a chicken-egg problem. This is
fixed now by removing the usage of SentryDependencyContainer of the
dependencies initialized in SentryDependencyContainer.init. Furthermore,
the SentryDependencyContainer now uses SENTRY_GRACEFUL_FATAL to exit the
application in debug and log a warning in production.
@philipphofmann philipphofmann force-pushed the fix/missing-debug-meta branch from 36d15b4 to b56ec31 Compare June 4, 2025 14:14
@philipphofmann philipphofmann marked this pull request as ready for review June 4, 2025 14:34
Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM, couple of inputs but other than that good to go

@philipphofmann
Copy link
Member Author

The UI test testChildControllerLoadCount keeps failing, but it also fails on the latest commits on the main branch. I'm going to investigate why that is after merging this PR.

@philipphofmann philipphofmann merged commit be06c5e into main Jun 4, 2025
82 of 92 checks passed
@philipphofmann philipphofmann deleted the fix/missing-debug-meta branch June 4, 2025 16:53
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.

Stack trace and symbols missing in captured errors
2 participants