gpt4 book ai didi

ios - CoreTelephony 崩溃(不可重现)

转载 作者:可可西里 更新时间:2023-11-01 06:04:38 25 4
gpt4 key购买 nike

这种崩溃只发生在生产环境中

Crashed Thread
0
libobjc.A.dylib 0x000000019843fbd0 objc_msgSend + 16
1
CoreTelephony 0x00000001886bac5c _ZL25_ServerConnectionCallbackP20__CTServerConnectionPK10__CFStringPK14__CFDictionaryPv + 48
2
CoreTelephony 0x00000001886d1030 ___ZNK13CTServerState21sendNotification_syncE7CTEventPK10__CFStringPK14__CFDictionary_block_invoke14 + 28
3
libdispatch.dylib 0x0000000198a713ac _dispatch_call_block_and_release + 20
4
libdispatch.dylib 0x0000000198a7136c _dispatch_client_callout + 12
5
libdispatch.dylib 0x0000000198a7b4c0 _dispatch_queue_drain + 1212
6
libdispatch.dylib 0x0000000198a74474 _dispatch_queue_invoke + 128
7
libdispatch.dylib 0x0000000198a7d224 _dispatch_root_queue_drain + 660
8
libdispatch.dylib 0x0000000198a7e75c _dispatch_worker_thread3 + 104
9
libsystem_pthread.dylib 0x0000000198c4d2e4 _pthread_wqthread + 812
10
libsystem_pthread.dylib 0x0000000198c4cfa8 start_wqthread + 0

这个也是

Crashed Thread
0
libobjc.A.dylib 0x306e1f46 objc_msgSend + 6
1
CoreTelephony 0x2291fc95 ___ZNK13CTServerState21sendNotification_syncE7CTEventPK10__CFStringPK14__CFDictionary_block_invoke14 + 14
2
libdispatch.dylib 0x30c662e3 _dispatch_call_block_and_release + 8
3
libdispatch.dylib 0x30c6e729 _dispatch_queue_drain + 1466
4
libdispatch.dylib 0x30c68aad _dispatch_queue_invoke + 82
5
libdispatch.dylib 0x30c6ff9f _dispatch_root_queue_drain + 392
6
libdispatch.dylib 0x30c713c3 _dispatch_worker_thread3 + 92
7
libsystem_pthread.dylib 0x30dcddc1 _pthread_wqthread + 666
8
libsystem_pthread.dylib 0x30dcdb14 start_wqthread + 6

我从日志中猜测这些只会在设备休眠一段时间后发生。因为崩溃和上次事件日志之间的时间戳至少相隔 10 分钟。我们自己不使用 coretelephony,但我们使用的一些框架确实将 coretelephony 作为依赖项。任何人都知道如何复制这个,或者知道如何解决这个问题?

最佳答案

当 CTTelephonyNetworkInfo 发布后收到通知时会出现此错误。相反,你应该使用:

   static CTTelephonyNetworkInfo *netInfo; 
static dispatch_once_t dispatchToken;
if (!netInfo) {
dispatch_once(&dispatchToken, ^{
netInfo = [[CTTelephonyNetworkInfo alloc] init];
});
}

因为,正如其他人所说:

"There is an iOS bug that causes instances of theCTTelephonyNetworkInfo class to sometimes get notifications after theyhave been deallocated. Instead of instantiating, using, and releasinginstances you must instead retain and never release them to workaround the bug."

更多信息 here

关于ios - CoreTelephony 崩溃(不可重现),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33748737/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com