-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Hang during initialization when SentrySDK.addBreadcrumb() is called from different thread #3899
Comments
I tried to reproduce this by adding breadcrumbs on a dispatch queue directly before starting the SDK but was unable to reproduce the issue:
It looks like the locks of both threads end up in a deadlock. So both sentry-cocoa/Sources/Sentry/SentrySDK.m Lines 73 to 88 in d6ff82c
That could be the culprit, but I would like to get a repro if possible so that we can fix it properly. @juraj-blahunka, how often does this happen? Every time or only from time to time? When do you call this code snipped?
|
@philipphofmann thank you for looking into it! I've been trying to reproduce with a similar code in DEBUG but also failed. I was only able to reproduce when the debugger isn't attached (in TestFlight builds) and I get it to hang in ~70% of cases after force killing the app. Everything happens from one method (simplified):
|
@juraj-blahunka, we will address the issues pointed out in #3899 (comment) because we should address them anyways. Maybe they fix your problem if not we need to investigate further. |
@philipphofmann Great news, happy to test! |
This is related to #3956. |
Fix a deadlock when two threads access SentrySDK.options and SentrySDK.currentHub, which used the same object in synchronized. This problem is fixed now by using two independent locks for SentrySDK.options and SentrySDK.currentHub. Fixes getsentryGH-3956, Fixes getsentryGH-3899
Platform
iOS
Environment
TestFlight
Installed
Carthage
Version
8.24.0
Did it work on previous versions?
8.21.0
Steps to Reproduce
The issue was only reproducible in TestFlight / AppStore builds, not in DEBUG.
It was reproduced with 8.24.0 and 8.23.0. Didn't try 8.22.0. Not reproducible with 8.21.0.
The SDK is initialized through the usual Swift call:
The breadcrumb is logged from a different thread (synchronous dispatch queue)
Other notes
Expected Result
The app launches without a hang.
Actual Result
The app hangs and gets killed by the watchdog after 20 seconds.
In the ips file, both threads hang with
-[SentryCrashWrapper systemInfo]
at the top of the trace. Here are the excerpts:Main thread:
Thread 2:
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: