CoreFoundation/ UIKit crash in iOS 15 app

Since update to iOS 15, our app is crashing in the first controller, right after splash screen(log attached).

To be mentioned that if app goes to background right after being active, it will only crash after i switch it back in foreground.

At crash it gets me right to int main() without any relevant info to help me debug, except (maybe) this line in the console "[Unknown process name] CGBitmapContextCreateWithCallbacks: failed to create CGAutomaticBitmapContextInfo."

I've tried using all exceptions breakpoint but didn't help debugging further. It seems to be an issue in storyboard and not a specific line of code.

At start, the app has a tabBarController which integrates some controllers. The first goes like viewDidLoad, viewWillAppear, viewWillLayoutSubviews, viewDidLayoutSubviews and then dies before reaching viewDidAppear.

Would appreciate some help

Exception Type:  EXC_BREAKPOINT (SIGTRAP)

This typically means that something in your process has trapped, that is, detected an error and deliberately crashed.

Thread 0 name:
Thread 0 Crashed:
0   CoreFoundation … CFRetain.cold.1 + 16 (CFRuntime.c:986)
1   CoreFoundation … CFRetain + 144 (CFRuntime.c:986)
2   UIKitCore      … __58-[_UIImageContent renditionWithSize:scale:applyingEffect:]_block_invoke.96 + 32 (_UIImageContent.m:354)

This indicates that the trap is coming from CFRetain. Frame 1 is UIImage doing some CF object, probably a CGImage. Frame 1 is the CFRetain and frame 0 is a chunk of code that the compiler has extracted from CFRetain because it’s ‘cold’ (that is, unlikely to be executed very often). That last bit is not surprising, because trapping code is by definition cold (it can only be called once, then the process dies).

AFAIK the only reason CFRetain will crash like this is if you pass it NULL.

As to why UIImage is passing NULL to CFRetain, that’s kinda outside my bailiwick. However, it does seems likely that the CGBitmapContextCreateWithCallbacks: failed to create CGAutomaticBitmapContextInfo message you mentioned is relevant. If you set a symbolic breakpoint on CGPostError, the code that logs that message, you should be able to get the backtrace of that failure. What does that look like?

Share and Enjoy

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

After isolating the UI almost like a standard user, I found out that the TabBarController was the problem. No matter what background picture i'd set, either from storyboard or from the controller class, the app would crash once it would instantiate the tabbar controller. As the tabbar had a background image already, there we go with the 5/5 crash after update. Very strange Thanks for the help @eksimo

CoreFoundation/ UIKit crash in iOS 15 app
 
 
Q