Crash: Fatal Exception: NSInvalidArgumentException -[NWConcrete_nw_protocol_options copyWithZone:]: unrecognized selector sent to instance

Hi there,

can some one help how to debug this crashes? where I can start to find root causes of this crashes. I've got lot of these NSInvalidArgumentException crashes in myapp last version

I have no idea how to reproduce these issues since it doesn't point to any specific code on myapp, so I don't know how to start

Fatal Exception: NSInvalidArgumentException -[NWConcrete_nw_protocol_options copyWithZone:]: unrecognized selector sent to instance 0x283391d60

Fatal Exception: NSInvalidArgumentException -[NSConcreteHashTable lengthOfBytesUsingEncoding:]: unrecognized selector sent to instance 0x281d4cbe0

Fatal Exception: NSInvalidArgumentException -[_NSXPCConnectionExportedObjectTable lengthOfBytesUsingEncoding:]: unrecognized selector sent to instance 0x2829d11d0

Fatal Exception: NSInvalidArgumentException -[OS_dispatch_group lengthOfBytesUsingEncoding:]: unrecognized selector sent to instance 0x281a11900

Fatal Exception: NSInvalidArgumentException -[__NSCFData getBytes:maxLength:usedLength:encoding:options:range:remainingRange:]: unrecognized selector sent to instance 0x28210e440

Fatal Exception: NSInvalidArgumentException -[_NSCoreTypesetterLayoutCache copyWithZone:]: unrecognized selector sent to instance 0x283bbc730

Thanks

# Crashlytics - Stack trace
# Application: com.myapp.ios
# Platform: apple
# Version: 4.53.1 (230118.1554)
# Issue: dd3c71c96cddb5bb99874640746439d6
# Session: de9bb41c2b7e43fa9ccfc42e0f649aa3_DNE_0_v2
# Date: Tue Jan 24 2023 06:53:03 GMT+0700 (Western Indonesia Time)

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x99288 __exceptionPreprocess
1  libobjc.A.dylib                0x16744 objc_exception_throw
2  CoreFoundation                 0x176fc4 +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x2de98 ___forwarding___
4  CoreFoundation                 0x2cf70 _CF_forwarding_prep_0
5  CFNetwork                      0x60e4 CFURLRequestSetHTTPRequestBody
6  CoreFoundation                 0x2b7dc __CFDictionaryApplyFunction_block_invoke
7  CoreFoundation                 0x29094 CFBasicHashApply
8  CoreFoundation                 0x2afb4 CFDictionaryApplyFunction
9  CFNetwork                      0x65e88 _CFNetworkHTTPConnectionCacheSetLimit
10 CFNetwork                      0x1be670 _CFNetworkErrorGetLocalizedDescription
11 CFNetwork                      0x19ab10 _CFNetworkErrorGetLocalizedDescription
12 CFNetwork                      0x180aac _CFNetworkErrorGetLocalizedDescription
13 CFNetwork                      0x180e64 _CFNetworkErrorGetLocalizedDescription
14 CFNetwork                      0x2731cc _CFURLStorageSessionDisableCache
15 CFNetwork                      0x3bffc CFURLRequestSetShouldStartSynchronously
16 CFNetwork                      0x55694 CFHTTPMessageCopyRequestURL
17 CFNetwork                      0x10b08 CFURLCacheSetMemoryCapacity
18 CFNetwork                      0x1640c CFURLRequestSetHTTPHeaderFieldValue
19 CFNetwork                      0x118f08 CFURLDownloadCancel
20 CFNetwork                      0x185258 _CFNetworkErrorGetLocalizedDescription
21 CFNetwork                      0xa0230 _CFHTTPMessageSetResponseProxyURL
22 CFNetwork                      0x20e968 _CFNetworkHTTPConnectionCacheGetLimit
23 CFNetwork                      0x184e50 _CFNetworkErrorGetLocalizedDescription
24 CFNetwork                      0xcc9c CFURLCacheSetDiskCapacity
25 libdispatch.dylib              0x12830 _dispatch_block_async_invoke2
26 libdispatch.dylib              0x3a30 _dispatch_client_callout
27 libdispatch.dylib              0xb124 _dispatch_lane_serial_drain
28 libdispatch.dylib              0xbcb4 _dispatch_lane_invoke
29 libdispatch.dylib              0xcf80 _dispatch_workloop_invoke
30 libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread
31 libsystem_pthread.dylib        0x10bc _pthread_wqthread
32 libsystem_pthread.dylib        0xe5c start_wqthread

com.apple.main-thread
0  libsystem_kernel.dylib         0x14a0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1ae4 mach_msg + 76
2  CoreFoundation                 0x6d30 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xb1bc __CFRunLoopRun + 1180
4  CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific + 600
5  GraphicsServices               0x1374 GSEventRunModal + 164
6  UIKitCore                      0x514648 -[UIApplication _run] + 1100
7  UIKitCore                      0x295d90 UIApplicationMain + 364
8  myapp                       0x644c main + 31 (AppDelegate.swift:31)
9  ???                            0x106819ce4 (Missing)

Crashed: com.google.firebase.crashlytics.ios.exception
0  myapp                       0xb92950 FIRCLSProcessRecordAllThreads + 393 (FIRCLSProcess.c:393)
1  myapp                       0xb92d30 FIRCLSProcessRecordAllThreads + 424 (FIRCLSProcess.c:424)
2  myapp                       0xba01dc FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  myapp                       0xba0030 __FIRCLSExceptionRecord_block_invoke + 232 (FIRCLSException.mm:232)
4  libdispatch.dylib              0x3a30 _dispatch_client_callout + 20
5  libdispatch.dylib              0x12c90 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  myapp                       0xb9f03c FIRCLSExceptionRecord + 234 (FIRCLSException.mm:234)
7  myapp                       0xb9fb50 FIRCLSExceptionRecordNSException + 126 (FIRCLSException.mm:126)
8  myapp                       0xb9ec94 FIRCLSTerminateHandler() + 398 (FIRCLSException.mm:398)
9  libc++abi.dylib                0x10f18 std::__terminate(void (*)()) + 20
10 libc++abi.dylib                0x10eb4 std::terminate() + 64
11 libobjc.A.dylib                0x2d248 objc::DenseMapBase, objc::DenseMapInfo, objc::detail::DenseMapPair >, objc_class*, PendingInitialize*, objc::DenseMapValueInfo, objc::DenseMapInfo, objc::detail::DenseMapPair >::FatalCorruptHashTables(objc::detail::DenseMapPair const*, unsigned int) const + 14
12 libdispatch.dylib              0x3a44 _dispatch_client_callout + 40
13 libdispatch.dylib              0xb124 _dispatch_lane_serial_drain + 668
14 libdispatch.dylib              0xbcb4 _dispatch_lane_invoke + 444
15 libdispatch.dylib              0xcf80 _dispatch_workloop_invoke + 1784
16 libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread + 648
17 libsystem_pthread.dylib        0x10bc _pthread_wqthread + 288
18 libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

GC Timer thread
0  libsystem_kernel.dylib         0x1f24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x8298 _pthread_cond_wait + 1236
2  libc++.1.dylib                 0xd328 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock&, std::__1::chrono::time_point > >) + 100
3  myapp                       0x1397be0 void kotlin::RepeatedTimer::Run::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()>(kotlin::gc::internal::GCSchedulerDataWithTimer::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()&&) + 4397153248
4  myapp                       0x1397e8c void* std::__1::__thread_proxy >, void (*)(kotlin::ScopedThread::attributes, void (kotlin::RepeatedTimer::*&&)(kotlin::gc::internal::GCSchedulerDataWithTimer::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()&&) noexcept, kotlin::RepeatedTimer*&&, kotlin::gc::internal::GCSchedulerDataWithTimer::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()&&), kotlin::ScopedThread::attributes, void (kotlin::RepeatedTimer::*)(kotlin::gc::internal::GCSchedulerDataWithTimer::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()&&) noexcept, kotlin::RepeatedTimer*, kotlin::gc::internal::GCSchedulerDataWithTimer::GCSchedulerDataWithTimer(kotlin::gc::GCSchedulerConfig&, std::__1::function)::'lambda'()> >(void*) + 4397153932
5  libsystem_pthread.dylib        0x19ac _pthread_start + 148
6  libsystem_pthread.dylib        0xe68 thread_start + 8

GC thread
0  libsystem_kernel.dylib         0x1f24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x8298 _pthread_cond_wait + 1236
2  libc++.1.dylib                 0xd28c std::__1::condition_variable::wait(std::__1::unique_lock&) + 28
3  myapp                       0x139aaac std::__1::invoke_result&, kotlin::gc::GCScheduler&)::$_2>::type kotlin::ScopedThread::Run&, kotlin::gc::GCScheduler&)::$_2>(kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory&, kotlin::gc::GCScheduler&)::$_2&&) + 4397165228
4  myapp                       0x139be9c void* std::__1::__thread_proxy >, void (*)(kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory&, kotlin::gc::GCScheduler&)::$_2&&), kotlin::ScopedThread::attributes, kotlin::gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(kotlin::mm::ObjectFactory&, kotlin::gc::GCScheduler&)::$_2> >(void*) + 4397170332
5  libsystem_pthread.dylib        0x19ac _pthread_start + 148
6  libsystem_pthread.dylib        0xe68 thread_start + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x14a0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1ae4 mach_msg + 76
2  CoreFoundation                 0x6d30 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xb1bc __CFRunLoopRun + 1180
4  CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific + 600
5  Foundation                     0x19464 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236
6  Foundation                     0x5ae2c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92
7  UIKitCore                      0x48e770 -[UIEventFetcher threadMain] + 524
8  Foundation                     0x6943c __NSThread__start__ + 808
9  libsystem_pthread.dylib        0x19ac _pthread_start + 148
10 libsystem_pthread.dylib        0xe68 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x14a0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1ae4 mach_msg + 76
2  myapp                       0xba0794 FIRCLSMachExceptionServer + 192 (FIRCLSMachException.c:192)
3  libsystem_pthread.dylib        0x19ac _pthread_start + 148
4  libsystem_pthread.dylib        0xe68 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1108 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xe5c start_wqthread + 8

com.google.fira.worker
0  libsystem_kernel.dylib         0x34ec fsync + 8
1  libsqlite3.dylib               0x6dc28 sqlite3_free_table + 64048
2  libsqlite3.dylib               0x770fc sqlite3_randomness + 2596
3  libsqlite3.dylib               0x6d67c sqlite3_free_table + 62596
4  libsqlite3.dylib               0x58fe0 sqlite3_value_text + 19360
5  libsqlite3.dylib               0x249a0 sqlite3_finalize + 3596
6  libsqlite3.dylib               0x52c2c sqlite3_step + 60188
7  libsqlite3.dylib               0x44248 sqlite3_step + 312
8  libsqlite3.dylib               0x9d04 sqlite3_exec + 356
9  myapp                       0x146e3e8 -[APMSqliteStore endTransaction] + 4398031848
10 myapp                       0x146e24c -[APMSqliteStore performTransactionWithError:block:] + 4398031436
11 myapp                       0x13de300 -[APMDatabase performTransaction:] + 4397441792
12 myapp                       0x141e64c -[APMMeasurement(Event) writeFilteredEventOnWorkerQueue:] + 4397704780
13 myapp                       0x141e294 -[APMMeasurement(Event) writeEventOnWorkerQueue:] + 4397703828
14 myapp                       0x141dc08 -[APMMeasurement(Event) handleEventOnWorkerQueue:] + 4397702152
15 myapp                       0x1411d24 -[APMMeasurement logEventOnWorkerQueue:notifyEventListeners:] + 4397653284
16 myapp                       0x1411cd4 -[APMMeasurement logEventOnWorkerQueueWithOrigin:isPublicEvent:name:parameters:timestamp:enabled:ignoreEnabled:ignoreInterceptor:interceptor:addedScreenParameters:] + 4397653204
17 myapp                       0x14119b0 __151-[APMMeasurement logEventWithOrigin:isPublicEvent:name:parameters:timestamp:enabled:ignoreEnabled:ignoreInterceptor:interceptor:addedScreenParameters:]_block_invoke + 4397652400
18 myapp                       0x1463914 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4397988116
19 libdispatch.dylib              0x1e6c _dispatch_call_block_and_release + 32
20 libdispatch.dylib              0x3a30 _dispatch_client_callout + 20
21 libdispatch.dylib              0xb124 _dispatch_lane_serial_drain + 668
22 libdispatch.dylib              0xbc80 _dispatch_lane_invoke + 392
23 libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread + 648
24 libsystem_pthread.dylib        0x10bc _pthread_wqthread + 288
25 libsystem_pthread.dylib        0xe5c start_wqthread + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x14a0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1ae4 mach_msg + 76
2  CoreFoundation                 0x6d30 __CFRunLoopServiceMachPort + 372
3  CoreFoundation                 0xb1bc __CFRunLoopRun + 1180
4  CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific + 600
5  CFNetwork                      0x27823c _CFURLStorageSessionDisableCache + 60032
6  Foundation                     0x6943c __NSThread__start__ + 808
7  libsystem_pthread.dylib        0x19ac _pthread_start + 148
8  libsystem_pthread.dylib        0xe68 thread_start + 8

JavaScriptCore libpas scavenger
0  libsystem_kernel.dylib         0x1f24 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x8298 _pthread_cond_wait + 1236
2  JavaScriptCore                 0xe8278 scavenger_thread_main + 1232
3  libsystem_pthread.dylib        0x19ac _pthread_start + 148
4  libsystem_pthread.dylib        0xe68 thread_start + 8

By chance did you correct this ? I have the same issues, not raising from my code as well...

Do you have a crash report for this occurring in a recent version of the OS? If so, please post it here. See Posting a Crash Report for advice on how to do that.

Share and Enjoy

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

Crash: Fatal Exception: NSInvalidArgumentException -[NWConcrete_nw_protocol_options copyWithZone:]: unrecognized selector sent to instance
 
 
Q