我的应用程序在iOS 15上每月崩溃约200次,我未能解决它。崩溃报告显示如下:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000001f12d313c
Thread 0 Crashed:
0 libsystem_platform.dylib 0x00000001f12d313c _os_unfair_lock_corruption_abort + 88
1 libsystem_platform.dylib 0x00000001f12cda20 _os_unfair_lock_lock_slow + 320
2 QuartzCore 0x000000018441c7c4 CA::Display::DisplayTimingsControl::granularity+ 100292 (unsigned int) + 40
3 QuartzCore 0x000000018456b99c CA::Display::DisplayLink::timer_status_callback+ 1472924 (_CADisplayTimer*, CADisplayTimerAction, unsigned long long, unsigned long long, void*) + 692
4 QuartzCore 0x000000018441b678 display_timer_callback+ 95864 (__CFMachPort*, void*, long, void*) + 272
5 CoreFoundation 0x00000001806bf390 __CFMachPortPerform + 176
6 CoreFoundation 0x0000000180702724 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60
7 CoreFoundation 0x0000000180705f30 __CFRunLoopDoSource1 + 596
8 CoreFoundation 0x00000001806bfe0c __CFRunLoopRun + 2380
9 CoreFoundation 0x00000001806d33b8 CFRunLoopRunSpecific + 600
10 GraphicsServices 0x000000019c06338c GSEventRunModal + 164
11 UIKitCore 0x00000001830736a8 0x182b5a000 + 5346984
12 UIKitCore 0x0000000182df27f4 UIApplicationMain + 2092
13 IBUWireless 0x0000000104700584 main + 17796 (main.m:44)
14 (null) 0x00000001083d9a24 0x0 + 4433222180
我猜这是因为一个CADisPlayLink被错误地释放了,但我不知道是哪一个。
苹果锁的源代码是https://github.com/apple/darwin-libplatform/blob/main/src/os/lock.c
Apple的CADisplayLayer是开源的吗?我如何修复此崩溃?
1条答案
按热度按时间f4t66c6m1#
此崩溃是由于悬空指针引起的。当任何变量或对象试图访问一个已经被释放的对象时,就会发生这种崩溃。
检查代码并逐行跟踪。