iOS 16.0 _cache_getImp crash due to bad access

After the user upgrades to iOS16, our app receives a few crash reports attempted to dereference garbage pointer on iOS16.

These issues only happen on iOS16. Here we provide some typical cases. It may be a system bug!

Case A

0	libobjc.A.dylib	_cache_getImp
1	libobjc.A.dylib	_class_respondsToSelector_inst
2	Foundation	__NSDescriptionWithStringProxyFunc
3	CoreFoundation	___CFStringAppendFormatCore
4	CoreFoundation	__CFStringCreateWithFormatAndArgumentsReturningMetadata
5	CoreFoundation	__CFStringCreateWithFormatAndArgumentsAux2
6	Foundation	+[NSString stringWithFormat:]

Case B

0	libobjc.A.dylib	_cache_getImp
1	libobjc.A.dylib	_object_getMethodImplementation
2	CoreFoundation	__NSIsNSString
3	CoreFoundation	-[NSTaggedPointerString isEqual:]
4	CoreFoundation	-[__NSDictionaryM objectForKey:]

Replies

Something like this will only happen if an object is dereferenced during access. So some root cause analysis based on what is actually calling these APIs from user/developer code is a good place to start.

What MobileTen said plus…

Problems like this are often caused by memory managements bugs. I recommend that you apply the standard memory debugging tools.

Also, can you post a full crash report? See Posting a Crash Report for advice on how to do that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • We are having the same problem too. Only on iOS16.

    Lots of totally different stacks all crash in _cache_getImp because of bad access.

Add a Comment

We are having the same problem too. Only on iOS16. Has this problem been resolved? is it related to the Hook of NSString?