Skip to content
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

fix: Data race in SentrySwizzleInfo.originalCalled #4434

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Conversation

brustolin
Copy link
Contributor

📜 Description

We have a Swizzling test that was also enabled for debug, which will cause thread sanitizer to complain about data race (which probably won't happen).

💡 Motivation and Context

Close #4432

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • 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.
  • 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.

🔮 Next steps

Copy link

github-actions bot commented Oct 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentrySwizzle.m

1 similar comment
Copy link

github-actions bot commented Oct 14, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentrySwizzle.m

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.317%. Comparing base (5a6e387) to head (a637179).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4434       +/-   ##
=============================================
- Coverage   91.319%   91.317%   -0.003%     
=============================================
  Files          610       610               
  Lines        49755     49755               
  Branches     17928     17929        +1     
=============================================
- Hits         45436     45435        -1     
- Misses        4227      4228        +1     
  Partials        92        92               
Files with missing lines Coverage Δ
Sources/Sentry/SentrySwizzle.m 94.285% <100.000%> (ø)
...ources/Sentry/include/HybridPublic/SentrySwizzle.h 100.000% <ø> (ø)

... and 3 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 5a6e387...a637179. Read the comment docs.

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1220.28 ms 1236.33 ms 16.05 ms
Size 21.58 KiB 706.06 KiB 684.48 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7cd187e 1239.02 ms 1261.42 ms 22.40 ms
9fa5d27 1230.65 ms 1255.08 ms 24.43 ms
f1ed6f8 1210.94 ms 1230.78 ms 19.84 ms
5b888cb 1218.28 ms 1244.65 ms 26.37 ms
8aec30e 1235.73 ms 1255.87 ms 20.14 ms
326b7eb 1223.41 ms 1235.66 ms 12.25 ms
1c0e955 1275.71 ms 1305.69 ms 29.98 ms
5e769dd 1216.24 ms 1245.74 ms 29.50 ms
282cc99 1232.59 ms 1245.88 ms 13.29 ms
8f397a7 1196.55 ms 1226.82 ms 30.27 ms

App size

Revision Plain With Sentry Diff
7cd187e 20.76 KiB 401.65 KiB 380.89 KiB
9fa5d27 20.76 KiB 393.37 KiB 372.61 KiB
f1ed6f8 21.58 KiB 683.51 KiB 661.93 KiB
5b888cb 21.58 KiB 654.67 KiB 633.09 KiB
8aec30e 21.58 KiB 616.75 KiB 595.17 KiB
326b7eb 20.76 KiB 432.31 KiB 411.55 KiB
1c0e955 21.58 KiB 424.28 KiB 402.70 KiB
5e769dd 21.58 KiB 572.21 KiB 550.62 KiB
282cc99 22.85 KiB 414.09 KiB 391.24 KiB
8f397a7 20.76 KiB 420.55 KiB 399.79 KiB

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@brustolin brustolin merged commit f273312 into main Oct 14, 2024
65 checks passed
@brustolin brustolin deleted the fix/swizzling-debug branch October 14, 2024 13:47
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.

Data race in [SentrySwizzleInfo originalCalled]/[SentrySwizzleInfo setOriginalCalled:]
2 participants