My app crashed about 200 times per month on iOS 15, and I failed to solve it.The crash reports shows like following:
Exception Type: EXC_BREAKPOINT (SIGTRAP)Exception Codes: KERN_INVALID_ADDRESS at 0x00000001f12d313cThread 0 Crashed:0 libsystem_platform.dylib 0x00000001f12d313c _os_unfair_lock_corruption_abort + 881 libsystem_platform.dylib 0x00000001f12cda20 _os_unfair_lock_lock_slow + 3202 QuartzCore 0x000000018441c7c4 CA::Display::DisplayTimingsControl::granularity+ 100292 (unsigned int) + 403 QuartzCore 0x000000018456b99c CA::Display::DisplayLink::timer_status_callback+ 1472924 (_CADisplayTimer*, CADisplayTimerAction, unsigned long long, unsigned long long, void*) + 6924 QuartzCore 0x000000018441b678 display_timer_callback+ 95864 (__CFMachPort*, void*, long, void*) + 2725 CoreFoundation 0x00000001806bf390 __CFMachPortPerform + 1766 CoreFoundation 0x0000000180702724 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 607 CoreFoundation 0x0000000180705f30 __CFRunLoopDoSource1 + 5968 CoreFoundation 0x00000001806bfe0c __CFRunLoopRun + 23809 CoreFoundation 0x00000001806d33b8 CFRunLoopRunSpecific + 60010 GraphicsServices 0x000000019c06338c GSEventRunModal + 16411 UIKitCore 0x00000001830736a8 0x182b5a000 + 534698412 UIKitCore 0x0000000182df27f4 UIApplicationMain + 209213 IBUWireless 0x0000000104700584 main + 17796 (main.m:44)14 (null) 0x00000001083d9a24 0x0 + 4433222180
I guess it's because a CADisPlayLink has been dealloced wrongly, but I can't figure out which one.
The source code of apple's lock is https://github.com/apple/darwin-libplatform/blob/main/src/os/lock.c
Is Apple's CADisplayLayer Opensourced? How can I fix this crash?