Fix a crash caused by private class _PFResultASCIIString in iOS 14 #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
When using FBRetainCycleDetector on iOS 14, I got frequent crash. The stack is:
It typically happened when the candidate is a
PHAsset
object. When FBObjectiveCGraphElement->_object becomes a _PFResultASCIIString, crash happened.in iOS 14, PHAsset has instance variables whose classes are _PFResultASCIIString. Below is one PHAsset's retained objects:
_PFResultASCIIString may be a new private class from iOS 14. It is a subclass of NSString, but it has some strange behaviors. As malloc_zone_from_ptr(pfResultASCIIString) returns null. It seems _PFResultASCIIString is not a malloced object.
I suppose, if an object is not malloced/realloced, checking by FBRetainCycleDetector is meaningless. So I added a condition to filter objects that are not malloced.