objc_retain EXC_BAD_ACCESS (KERN_INVALID_ADDRESS) - iOS 16 Crash

Hello, I have been facing a crash happening from iOS 16 onwards. Crash counts have been consistent since iOS 16.0, and I have not been able to figure out the cause. It's most likely a memory leak, and it seems to be due to a bug on Apple's end since there are others facing the same issue from this post: https://developer.apple.com/forums/thread/722734

I have used Instruments but can't draw any conclusions from there. Does anyone have any idea on how we can reduce the crash occurrences from our code? Here is the stack trace:

Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x3a7c objc_retain + 16 1 libobjc.A.dylib 0x3a7c objc_retain_x0 + 16 2 UIKitCore 0xbe7940 -[UIKeyboardTaskQueue promoteDeferredTaskIfIdle] + 76 3 UIKitCore 0xbe78cc -[UIKeyboardTaskQueue performDeferredTaskIfIdle] + 32 4 UIKitCore 0x3cd8d8 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 376 5 Foundation 0x3b7ac __NSThreadPerformPerform + 264 6 CoreFoundation 0xd3128 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 7 CoreFoundation 0xdf7b4 __CFRunLoopDoSource0 + 176 8 CoreFoundation 0x645e8 __CFRunLoopDoSources0 + 244 9 CoreFoundation 0x7a0d4 __CFRunLoopRun + 828 10 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612 11 GraphicsServices 0x135c GSEventRunModal + 164 12 UIKitCore 0x39d6e8 -[UIApplication _run] + 888 13 UIKitCore 0x39d34c UIApplicationMain + 340 14 0x21738 main + 43 (main.m:43) 15 ??? 0x1c2d4adec (Missing)

objc_retain EXC_BAD_ACCESS (KERN_INVALID_ADDRESS) - iOS 16 Crash
 
 
Q