Data race in [SentrySwizzleInfo originalCalled]
/[SentrySwizzleInfo setOriginalCalled:]
#4432
Labels
[SentrySwizzleInfo originalCalled]
/[SentrySwizzleInfo setOriginalCalled:]
#4432
Platform
iOS
Environment
Develop
Installed
CocoaPods
Version
8.36.0
Xcode Version
16.0
Did it work on previous versions?
No response
Steps to Reproduce
This happens with Sentry for React Native (v5.24.3). If I understand correctly, this package depends on
HybridSDK
(v8.36.0), which is part of this code base. Thus, the bug is related to the native Sentry SDK, not the react native package.Steps to reproduce:
fetch
(JS) -> native iOS http implementation.Expected Result
No breakpoints being hit
Actual Result
tl;dr: As the log shows below, the property
originalCalled
ofSentrySwizzleInfo
is read and written to concurrently.While the write has synchronisation,
SentrySwizzle.m:28-32
the read does not:
SentrySwizzle.h:162-167
As this property only exists for debug builds, it is nonetheless unfortunate when profiling the app in debug. As can be seen in the log below, two threads read and write to the mentioned property when network requests are sent and received via React Native, and while this happens in a React Native app, it really only illustrates that the property is indeed not thread safe for any other use case as well.
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: