[SentryFramesTracker removeListener:] crash
Platform
iOS
Environment
TestFlight
Installed
Swift Package Manager
Version
8.57.0 and 8.56.0
Xcode Version
26.0.1
Did it work on previous versions?
Not sure, only enabled frozen frames tracking recently
Steps to Reproduce
It happens randomly. I cannot easily reproduce this. And I think its related to enableUIViewControllerTracing setting being set to true
Expected Result
It should not cause crash
Actual Result
For some users app crashes sometimes.
Are you willing to submit a PR?
No response
Thanks for reporting this, @SebastianKumor-Oura. I found a potential root cause
We use a lock for removing all objects of the listeners here https://github.com/getsentry/sentry-cocoa/blob/45e9fb14f5094d84db2d37539834b97ed4d6e687/Sources/Swift/Core/Integrations/FramesTracking/SentryFramesTracker.swift#L117-L119
Here we don't use locks but instead add and remove listeners on the main thread
https://github.com/getsentry/sentry-cocoa/blob/45e9fb14f5094d84db2d37539834b97ed4d6e687/Sources/Swift/Core/Integrations/FramesTracking/SentryFramesTracker.swift#L162-L172
@philipphofmann thanks for a quick response. Do you have any plans to address this issue ?
@SebastianKumor-Oura, sorry no we don't have an ETA, but we're are going to fix the root cause at some point.
I am still seeing this in 9.x btw....
Thanks for the info @GianmarcoSalerno.