You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SIGABRT: Fatal error: Attempted to read an unowned reference but object %p was already deallocated > Fatal error: Attempted to read an unowned reference but object 0x280dcf960 was already deallocated
File "ReaderCardService.swift", line 35, in ReaderCardService.fetch
File "ReaderTopicService+FollowedInterests.swift", line 30, in ReaderTopicService.fetchFollowedInterestsLocally
File "<compiler-generated>", in ReaderTopicService.fetchFollowedInterestsLocally
File "<compiler-generated>", in thunk for closure
File "main.swift", line 7, in main
...
(18 additional frame(s) were not displayed)
Investigation Notes
I wasn't able to understand the connection between ReaderTopicService+FollowedInterests with ReaderCardService. The fetchFollowedInterestsLocally method does not make any references to ReaderCardService.
However, ReaderCardService.fetch gets called on ReaderCardsStreamViewController's viewWillAppear.
In the Reader navigation refresh project (internal ref: pcdRpT-506-p2), we no longer keep multiple stream view controllers. With the new design, we always create a new ReaderStreamViewController when switching to a different stream.
Since ReaderCardService is retained in the ReaderCardsStreamViewController, it is possible that the view controller gets deallocated after the fetch method completes, which could technically crash due to the usage of unowned:
followedInterestsService.fetchFollowedInterestsLocally{[unowned self] topics in
Next Steps
The easiest way is to update unowned to weak in ReaderCardService.fetch. It's expected for self to be deallocated since we moved away from a "tabbed" structure where we no longer retain multiple instances of ReaderStreamViewController.
Another way is to apply a fix that simulates the previous behavior of retaining multiple ReaderStreamViewController instances, and this number corresponds to the number of streams available in the Reader navigation menu. But this poses a higher risk in terms of stability (i.e., there could be additional issues) and user experience (e.g., no results experience, sync/refresh issues).
The text was updated successfully, but these errors were encountered:
dvdchr
changed the title
SIGABRT: Fatal error: Attempted to read an unowned reference but object %p was already deallocated > Fatal...
SIGABRT: Fatal error: Attempted to read an unowned reference
Feb 20, 2024
dvdchr
changed the title
SIGABRT: Fatal error: Attempted to read an unowned reference
Fatal error: Attempted to read an unowned reference
Feb 20, 2024
dvdchr
changed the title
Fatal error: Attempted to read an unowned reference
Fatal error: Attempted to read an unowned reference in ReaderCardService.fetch
Feb 27, 2024
Sentry Issue: JETPACK-IOS-Y5
Investigation Notes
I wasn't able to understand the connection between
ReaderTopicService+FollowedInterests
withReaderCardService
. ThefetchFollowedInterestsLocally
method does not make any references toReaderCardService
.However,
ReaderCardService.fetch
gets called onReaderCardsStreamViewController
'sviewWillAppear
.In the Reader navigation refresh project (internal ref: pcdRpT-506-p2), we no longer keep multiple stream view controllers. With the new design, we always create a new
ReaderStreamViewController
when switching to a different stream.WordPress-iOS/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabView.swift
Lines 41 to 55 in 339ea0d
WordPress-iOS/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabView.swift
Lines 103 to 107 in 339ea0d
(The
makeChildContentViewController
eventually calls into a closure property, which gets populated from WPTabBarController+ReaderTabNavigation.makeReaderTabViewModel.)Since
ReaderCardService
is retained in theReaderCardsStreamViewController
, it is possible that the view controller gets deallocated after thefetch
method completes, which could technically crash due to the usage ofunowned
:WordPress-iOS/WordPress/Classes/Services/ReaderCardService.swift
Line 28 in 339ea0d
Next Steps
The easiest way is to update
unowned
toweak
inReaderCardService.fetch
. It's expected forself
to be deallocated since we moved away from a "tabbed" structure where we no longer retain multiple instances ofReaderStreamViewController
.Another way is to apply a fix that simulates the previous behavior of retaining multiple
ReaderStreamViewController
instances, and this number corresponds to the number of streams available in the Reader navigation menu. But this poses a higher risk in terms of stability (i.e., there could be additional issues) and user experience (e.g., no results experience, sync/refresh issues).The text was updated successfully, but these errors were encountered: