sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

[SentryFramesTracker removeListener:] crash

Open SebastianKumor-Oura opened this issue 1 month ago • 4 comments

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

Image Image

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

SebastianKumor-Oura avatar Oct 29 '25 13:10 SebastianKumor-Oura

COCOA-869

linear[bot] avatar Oct 29 '25 13:10 linear[bot]

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 avatar Oct 30 '25 10:10 philipphofmann

@philipphofmann thanks for a quick response. Do you have any plans to address this issue ?

SebastianKumor-Oura avatar Nov 20 '25 14:11 SebastianKumor-Oura

@SebastianKumor-Oura, sorry no we don't have an ETA, but we're are going to fix the root cause at some point.

philipphofmann avatar Nov 24 '25 12:11 philipphofmann

I am still seeing this in 9.x btw....

GianmarcoSalerno avatar Dec 17 '25 19:12 GianmarcoSalerno

Thanks for the info @GianmarcoSalerno.

philipphofmann avatar Dec 18 '25 15:12 philipphofmann