EAAccessoryManager crashes

Hi,

The company produces MFI-certified devices. A lot of users are affected. it happens when users are in the background.

The crash happens in NSArray; it looks like the array is out of bounds to which EAAccessoryManager tries to access.

The only assumption I have is that something is wrong with Threads. Maybe we are blocking a Thread somewhere, or EAAccessory should always work on the Main Thread but we switch streams to another thread.

It is hard to believe that Apple could have such a simple bug. If it were Apple's bug, other companies who produce MFI devices could also experience the identical bug, but I don't see anyone raising the identical issue.

The issues don't have a relation to iOS versions; it happens for us from iOS 13 till iOS 18.

Thanks in advance, Eugene.

Incident Identifier: 9071D48D-2B8C-4636-90E0-8D4BCD382C6A
Distributor ID:      com.apple.AppStore
Hardware Model:      iPhone14,2
Process:             Poly Lens iOS [441]
Path:                /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Poly Lens iOS
Identifier:          com.plantronics.myheadset
Version:             4.4.3 (15741)
AppStoreTools:       16A242b
AppVariant:          1:iPhone14,2:15
Code Type:           ARM-64 (Native)
Role:                unknown
Parent Process:      launchd [1]
Coalition:           com.plantronics.myheadset [627]

Date/Time:           2024-09-13 09:42:31.4873 +0200
Launch Time:         2024-09-13 08:23:27.2514 +0200
OS Version:          iPhone OS 17.6.1 (21G93)
Release Type:        User
Baseband Version:    3.50.04
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Reason: *** -[NSArray initWithArray:range:copyItems:]: range {0, 1} extends beyond bounds for empty array
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: Poly Lens iOS [441]

Triggered by Thread:  10

Last Exception Backtrace:
0   CoreFoundation                	0x1918fcf20 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib               	0x18979b2b8 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x19188c0ac -[NSArray initWithArray:range:copyItems:] + 1180 (NSArray.m:0)
3   CoreFoundation                	0x1918c39a8 +[NSArray arrayWithArray:] + 60 (NSArray.m:975)
4   ExternalAccessory             	0x1c4beada4 -[EAAccessoryManager _findExtraAccessoriesContainedOnlyInEA:] + 88 (EAAccessoryManager.m:1235)
5   ExternalAccessory             	0x1c4bea630 -[EAAccessoryManager _checkForConnectedAccessories:backgroundTaskIdentifier:] + 144 (EAAccessoryManager.m:1274)
6   libdispatch.dylib             	0x1997a113c _dispatch_call_block_and_release + 32 (init.c:1530)
7   libdispatch.dylib             	0x1997a2dd4 _dispatch_client_callout + 20 (object.m:576)
8   libdispatch.dylib             	0x1997a5f6c _dispatch_queue_override_invoke + 928 (queue.c:4967)
9   libdispatch.dylib             	0x1997b4894 _dispatch_root_queue_drain + 392 (queue.c:7136)
10  libdispatch.dylib             	0x1997b509c _dispatch_worker_thread2 + 156 (queue.c:7204)
11  libsystem_pthread.dylib       	0x1ee34c8f8 _pthread_wqthread + 228 (pthread.c:2709)
12  libsystem_pthread.dylib       	0x1ee3490cc start_wqthread + 8 (:-1)

I can't attach full log cause Forum showed this error: This post contains sensitive language. Please revise it in order to continue.

Please try again. See Posting a Crash Report for specific advice on how to do this and a workaround if you continue to have problems.

Share and Enjoy

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

Thanks!

Full log is here:

Incident Identifier: 9071D48D-2B8C-4636-90E0-8D4BCD382C6A
Distributor ID:      com.apple.AppStore
Hardware Model:      iPhone14,2
Process:             Poly Lens iOS [441]
Path:                /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Poly Lens iOS
Identifier:          com.plantronics.myheadset
Version:             4.4.3 (15741)
AppStoreTools:       16A242b
AppVariant:          1:iPhone14,2:15
Code Type:           ARM-64 (Native)
Role:                unknown
Parent Process:      launchd [1]
Coalition:           com.plantronics.myheadset [627]

Date/Time:           2024-09-13 09:42:31.4873 +0200
Launch Time:         2024-09-13 08:23:27.2514 +0200
OS Version:          iPhone OS 17.6.1 (21G93)
Release Type:        User
Baseband Version:    3.50.04
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Reason: *** -[NSArray initWithArray:range:copyItems:]: range {0, 1} extends beyond bounds for empty array
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: Poly Lens iOS [441]

Triggered by Thread:  10

Last Exception Backtrace:
0   CoreFoundation                	0x1918fcf20 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib               	0x18979b2b8 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x19188c0ac -[NSArray initWithArray:range:copyItems:] + 1180 (NSArray.m:0)
3   CoreFoundation                	0x1918c39a8 +[NSArray arrayWithArray:] + 60 (NSArray.m:975)
4   ExternalAccessory             	0x1c4beada4 -[EAAccessoryManager _findExtraAccessoriesContainedOnlyInEA:] + 88 (EAAccessoryManager.m:1235)
5   ExternalAccessory             	0x1c4bea630 -[EAAccessoryManager _checkForConnectedAccessories:backgroundTaskIdentifier:] + 144 (EAAccessoryManager.m:1274)
6   libdispatch.dylib             	0x1997a113c _dispatch_call_block_and_release + 32 (init.c:1530)
7   libdispatch.dylib             	0x1997a2dd4 _dispatch_client_callout + 20 (object.m:576)
8   libdispatch.dylib             	0x1997a5f6c _dispatch_queue_override_invoke + 928 (queue.c:4967)
9   libdispatch.dylib             	0x1997b4894 _dispatch_root_queue_drain + 392 (queue.c:7136)
10  libdispatch.dylib             	0x1997b509c _dispatch_worker_thread2 + 156 (queue.c:7204)
11  libsystem_pthread.dylib       	0x1ee34c8f8 _pthread_wqthread + 228 (pthread.c:2709)
12  libsystem_pthread.dylib       	0x1ee3490cc start_wqthread + 8 (:-1)

Thread 0 name:
Thread 0:
0   libsystem_kernel.dylib        	0x00000001da5516c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001da554ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001da554de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001da554c20 mach_msg + 24 (mach_msg.c:323)
4   libdispatch.dylib             	0x00000001997bdb18 _dispatch_mach_send_and_wait_for_reply + 544 (mach.c:1980)
5   libdispatch.dylib             	0x00000001997bdeb8 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:2017)
6   libxpc.dylib                  	0x00000001ee39cac8 xpc_connection_send_message_with_reply_sync + 264 (connection.c:3985)
7   Foundation                    	0x000000019078b6a8 __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16 (NSXPCConnection.m:223)
8   Foundation                    	0x0000000190787d14 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2160 (NSXPCConnection.m:1678)
9   CoreFoundation                	0x0000000191899d88 ___forwarding___ + 1016 (NSForwarding.m:3646)
10  CoreFoundation                	0x00000001918998d0 _CF_forwarding_prep_0 + 96 (:-1)
11  AudioSession                  	0x00000001aeb01fc4 GetPropertyXPC(std::__1::shared_ptr, unsigned int, NSString*, bool) + 176 (AVAudioSessionUtilities.h:200)
12  AudioSession                  	0x00000001aeb01ebc GetProperty(AVAudioSessionImpl*, NSString*, bool) + 92 (AVAudioSession_iOS.mm:1158)
13  AudioSession                  	0x00000001aeb128b8 -[AVAudioSession privateRefreshAvailableInputs] + 68 (AVAudioSession_iOS.mm:4940)
14  LensMobileCore                	0x0000000102ba5214 PLTDevice.getDeviceName(from:) + 48 (PLTDevice.swift:124)
15  LensMobileCore                	0x0000000102ba5214 PLTDevice.update(with:) + 736 (PLTDevice.swift:92)
16  LensMobileCore                	0x0000000102ba4f00 PLTDevice.init(accessory:) + 1444 (PLTDevice.swift:65)
17  LensMobileCore                	0x0000000102a7415c PLTDevice.__allocating_init(accessory:) + 36 (PLTDevice.swift:0)
18  LensMobileCore                	0x0000000102a7415c closure #1 in AccessoriesHolder.device(from:) + 368 (AccessoriesHolder.swift:40)
19  LensMobileCore                	0x0000000102a8a7d0 partial apply for closure #1 in AccessoriesHolder.device(from:) + 16 (:0)
20  libswiftDispatch.dylib        	0x000000019ac9e28c partial apply for thunk for @callee_guaranteed () -> (@out A, @error @owned Error) + 28 (:0)
21  libswiftDispatch.dylib        	0x000000019ac9e268 thunk for @callee_guaranteed () -> (@out A, @error @owned Error)partial apply + 16 (:-1)
22  libswiftDispatch.dylib        	0x000000019ac9e1a8 closure #1 in closure #1 in OS_dispatch_queue._syncHelper<a>(fn:execute:rescue:) + 192 (Queue.swift:399)
23  libswiftDispatch.dylib        	0x000000019ac9e0cc partial apply for thunk for @callee_guaranteed () -> () + 28 (:0)
24  libswiftDispatch.dylib        	0x000000019ac9e0a4 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
25  libdispatch.dylib             	0x00000001997a2dd4 _dispatch_client_callout + 20 (object.m:576)
26  libdispatch.dylib             	0x00000001997b22c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1100)
27  libswiftDispatch.dylib        	0x000000019ac9f96c implicit closure #2 in implicit closure #1 in OS_dispatch_queue.asyncAndWait</a><a>(execute:) + 192 (:-1)
28  libswiftDispatch.dylib        	0x000000019ac9f8a4 partial apply for implicit closure #2 in implicit closure #1 in OS_dispatch_queue.sync</a><a>(execute:) + 76 (:0)
29  libswiftDispatch.dylib        	0x000000019ac9f724 OS_dispatch_queue._syncHelper</a><a>(fn:execute:rescue:) + 404 (Queue.swift:396)
30  libswiftDispatch.dylib        	0x000000019ac9f560 OS_dispatch_queue.asyncAndWait</a><a>(execute:) + 140 (:-1)
31  libswiftDispatch.dylib        	0x000000019ac9f4cc OS_dispatch_queue.sync</a><a>(execute:) + 64 (:-1)
32  LensMobileCore                	0x0000000102a87ec0 AccessoriesHolder.device(from:) + 48 (AccessoriesHolder.swift:31)
33  LensMobileCore                	0x0000000102a87ec0 CommunicatorImpl.device(from:) + 92 (CommunicatorImpl.swift:192)
34  LensMobileCore                	0x0000000102a87e34 closure #1 in CommunicatorImpl.observeAccessoryChange(_:) + 88 (CommunicatorImpl.swift:138)
35  LensMobileCore                	0x0000000102a89ff8 partial apply for closure #1 in CommunicatorImpl.observeAccessoryChange(_:) + 16 (:0)
36  RxSwift                       	0x000000010231634c CompactMapSink.on(_:) + 536 (CompactMap.swift:41)
37  RxSwift                       	0x00000001023165a8 protocol witness for ObserverType.on(_:) in conformance CompactMapSink + 20 (:0)
38  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
39  RxSwift                       	0x0000000102340150 closure #1 in MergeSinkIter.on(_:) + 400 (Merge.swift:394)
40  RxSwift                       	0x000000010233ff9c specialized NSRecursiveLock.performLocked</a><a>(_:) + 24 (Lock.swift:21)
41  RxSwift                       	0x000000010233ff9c MergeSinkIter.on(_:) + 68 (Merge.swift:391)
42  RxSwift                       	0x0000000102340320 protocol witness for ObserverType.on(_:) in conformance MergeSinkIter + 20 (:0)
43  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
44  RxSwift                       	0x0000000102340150 closure #1 in MergeSinkIter.on(_:) + 400 (Merge.swift:394)
45  RxSwift                       	0x000000010233ff9c specialized NSRecursiveLock.performLocked</a><a>(_:) + 24 (Lock.swift:21)
46  RxSwift                       	0x000000010233ff9c MergeSinkIter.on(_:) + 68 (Merge.swift:391)
47  RxSwift                       	0x0000000102340320 protocol witness for ObserverType.on(_:) in conformance MergeSinkIter + 20 (:0)
48  RxSwift                       	0x0000000102353224 implicit closure #2 in implicit closure #1 in PublishSubject.synchronized_subscribe</a><a>(_:) + 8 (PublishSubject.swift:107)
49  RxSwift                       	0x0000000102353224 partial apply for implicit closure #2 in implicit closure #1 in PublishSubject.synchronized_subscribe</a><a>(_:) + 44 (:0)
50  RxSwift                       	0x0000000102362bdc thunk for @escaping @callee_guaranteed (@in_guaranteed Event</a><a>) -> () + 20 (:0)
51  RxSwift                       	0x0000000102351ddc thunk for @escaping @callee_guaranteed (@in_guaranteed Event</a><a>) -> (@out ()) + 12 (:0)
52  RxSwift                       	0x0000000102351ddc dispatch</a><a>(_:_:) + 28 (PublishSubject.swift:61)
53  RxSwift                       	0x0000000102351ddc PublishSubject.on(_:) + 76
54  RxSwift                       	0x0000000102353020 protocol witness for ObserverType.on(_:) in conformance PublishSubject</a><a> + 20 (:0)
55  RxCocoa                       	0x0000000101f8afe4 partial apply for closure #1 in closure #2 in ObservableType.bind</a><a>(to:) + 40
56  RxCocoa                       	0x0000000101f8afb4 partial apply for closure #1 in closure #1 in ObservableType.bind</a><a>(to:) + 12
57  libswiftCore.dylib            	0x000000019027ee70 Sequence.forEach(_:) + 756 (Sequence.swift:791)
58  RxCocoa                       	0x0000000101f8ac6c closure #1 in ObservableType.bind</a><a>(to:) + 100
59  RxCocoa                       	0x0000000101f8aca8 partial apply for closure #1 in ObservableType.bind</a><a>(to:) + 28
60  RxSwift                       	0x0000000102346e8c closure #1 in ObservableType.subscribe(_:) + 4 (ObservableType+Extensions.swift:22)
61  RxSwift                       	0x0000000102346e8c partial apply for closure #1 in ObservableType.subscribe(_:) + 20 (:0)
62  RxSwift                       	0x00000001022fa040 AnonymousObserver.onCore(_:) + 20 (AnonymousObserver.swift:22)
63  RxSwift                       	0x0000000102349278 ObserverBase.on(_:) + 288 (ObserverBase.swift:16)
64  RxSwift                       	0x00000001023493bc protocol witness for ObserverType.on(_:) in conformance ObserverBase</a><a> + 20 (:0)
65  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
66  RxSwift                       	0x000000010236acac SubscribeOnSink.on(_:) + 32 (SubscribeOn.swift:64)
67  RxSwift                       	0x000000010236b184 protocol witness for ObserverType.on(_:) in conformance SubscribeOnSink + 20 (:0)
68  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
69  RxSwift                       	0x0000000102340150 closure #1 in MergeSinkIter.on(_:) + 400 (Merge.swift:394)
70  RxSwift                       	0x000000010233ff9c specialized NSRecursiveLock.performLocked</a><a>(_:) + 24 (Lock.swift:21)
71  RxSwift                       	0x000000010233ff9c MergeSinkIter.on(_:) + 68 (Merge.swift:391)
72  RxSwift                       	0x0000000102340320 protocol witness for ObserverType.on(_:) in conformance MergeSinkIter + 20 (:0)
73  RxSwift                       	0x000000010233929c Just.subscribe</a><a>(_:) + 176 (Just.swift:83)
74  RxSwift                       	0x000000010233f9e0 MergeSink.subscribeInner(_:) + 404 (Merge.swift:479)
75  RxSwift                       	0x000000010233f7fc MergeSink.on(_:) + 1024 (Merge.swift:459)
76  RxSwift                       	0x00000001023405ec protocol witness for ObserverType.on(_:) in conformance MergeSink + 20 (:0)
77  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
78  RxSwift                       	0x000000010235eb60 ScanSink.on(_:) + 688 (Scan.swift:65)
79  RxSwift                       	0x000000010235ed48 protocol witness for ObserverType.on(_:) in conformance ScanSink + 20 (:0)
80  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
81  RxSwift                       	0x000000010233e3b4 MergeLimitedSinkIter.synchronized_on(_:) + 360 (Merge.swift:166)
82  RxSwift                       	0x000000010236db28 SynchronizedOnType.synchronizedOn(_:) + 92 (SynchronizedOnType.swift:16)
83  RxSwift                       	0x000000010233e600 protocol witness for ObserverType.on(_:) in conformance MergeLimitedSinkIter + 20 (:0)
84  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
85  RxSwift                       	0x000000010233ad9c MapSink.on(_:) + 680 (Map.swift:43)
86  RxSwift                       	0x000000010233aec0 protocol witness for ObserverType.on(_:) in conformance MapSink + 20 (:0)
87  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
88  RxSwift                       	0x000000010233ad9c MapSink.on(_:) + 680 (Map.swift:43)
89  RxSwift                       	0x000000010233aec0 protocol witness for ObserverType.on(_:) in conformance MapSink + 20 (:0)
90  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
91  RxSwift                       	0x00000001022fb39c AsSingleSink.on(_:) + 912 (AsSingle.swift:28)
92  RxSwift                       	0x00000001022fb56c protocol witness for ObserverType.on(_:) in conformance AsSingleSink</a><a> + 20 (:0)
93  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
94  RxSwift                       	0x00000001023578f8 ReduceSink.on(_:) + 1112 (Reduce.swift:76)
95  RxSwift                       	0x0000000102357a78 protocol witness for ObserverType.on(_:) in conformance ReduceSink + 20 (:0)
96  RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
97  RxSwift                       	0x0000000102340530 MergeSink.checkCompleted() + 56 (Merge.swift:501)
98  RxSwift                       	0x0000000102340530 closure #2 in MergeSink.on(_:) + 200 (Merge.swift:470)
99  RxSwift                       	0x000000010233f6e8 specialized NSRecursiveLock.performLocked</a><a>(_:) + 24 (Lock.swift:21)
100 RxSwift                       	0x000000010233f6e8 MergeSink.on(_:) + 748 (Merge.swift:467)
101 RxSwift                       	0x00000001023405ec protocol witness for ObserverType.on(_:) in conformance MergeSink + 20 (:0)
102 RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
103 RxSwift                       	0x000000010236eac4 TailRecursiveSink.done() + 132 (TailRecursiveSink.swift:60)
104 RxSwift                       	0x000000010236e834 TailRecursiveSink.moveNextCommand() + 2112 (TailRecursiveSink.swift:124)
105 RxSwift                       	0x000000010236ecf0 protocol witness for InvocableWithValueType.invoke(_:) in conformance TailRecursiveSink + 24 (:0)
106 RxSwift                       	0x00000001022fbcc4 AsyncLock.invoke(_:) + 576 (AsyncLock.swift:84)
107 RxSwift                       	0x000000010236dfd0 TailRecursiveSink.schedule(_:) + 148 (TailRecursiveSink.swift:56)
108 RxSwift                       	0x000000010236ded4 TailRecursiveSink.run(_:) + 456 (TailRecursiveSink.swift:40)
109 RxSwift                       	0x000000010231bd48 Concat.run</a><a>(_:cancel:) + 348 (Concat.swift:127)
110 RxSwift                       	0x0000000102350b7c Producer.subscribe</a><a>(_:) + 300 (Producer.swift:18)
111 RxSwift                       	0x000000010233fd3c MergeSink.run(_:) + 320 (Merge.swift:509)
112 RxSwift                       	0x00000001023406cc FlatMap.run</a><a>(_:cancel:) + 176
113 RxSwift                       	0x0000000102350b7c Producer.subscribe</a><a>(_:) + 300 (Producer.swift:18)
114 RxSwift                       	0x0000000102357b44 Reduce.run</a><a>(_:cancel:) + 192 (Reduce.swift:105)
115 RxSwift                       	0x0000000102350b7c Producer.subscribe</a><a>(_:) + 300 (Producer.swift:18)
116 RxSwift                       	0x00000001022fb654 AsSingle.run</a><a>(_:cancel:) + 164 (AsSingle.swift:48)
117 RxSwift                       	0x0000000102350b7c Producer.subscribe</a><a>(_:) + 300 (Producer.swift:18)
118 RxSwift                       	0x000000010233af98 Map.run</a><a>(_:cancel:) + 204 (Map.swift:73)
119 RxSwift                       	0x0000000102350b7c Producer.subscribe</a><a>(_:) + 300 (Producer.swift:18)
120 RxSwift                       	0x000000010233af98 Map.run</a><a>(_:cancel:) + 204 (Map.swift:73)
121 RxSwift                       	0x0000000102351664 closure #1 in Producer.subscribe</a><a>(_:) + 228 (Producer.swift:26)
122 RxSwift                       	0x0000000102350d54 specialized CurrentThreadScheduler.schedule</a><a>(_:action:) + 172 (CurrentThreadScheduler.swift:94)
123 RxSwift                       	0x0000000102350c50 Producer.subscribe</a><a>(_:) + 512 (Producer.swift:24)
124 RxSwift                       	0x000000010233ea8c MergeLimitedSink.subscribe(_:group:) + 416 (Merge.swift:247)
125 RxSwift                       	0x000000010233ef28 MergeLimitedSink.on(_:) + 1084 (Merge.swift:292)
126 RxSwift                       	0x000000010233f208 protocol witness for ObserverType.on(_:) in conformance MergeLimitedSink + 20 (:0)
127 RxSwift                       	0x0000000102368030 Sink.forwardOn(_:) + 112 (Sink.swift:34)
128 RxSwift                       	0x000000010232848c DistinctUntilChangedSink.on(_:) + 916 (DistinctUntilChanged.swift:105)
129 RxSwift                       	0x00000001023286d0 protocol witness for ObserverType.on(_:) in conformance DistinctUntilChangedSink + 20 (:0)
130 RxSwift                       	0x0000000102353224 implicit closure #2 in implicit closure #1 in PublishSubject.synchronized_subscribe</a><a>(_:) + 8 (PublishSubject.swift:107)
131 RxSwift                       	0x0000000102353224 partial apply for implicit closure #2 in implicit closure #1 in PublishSubject.synchronized_subscribe</a><a>(_:) + 44 (:0)
132 RxSwift                       	0x0000000102362bdc thunk for @escaping @callee_guaranteed (@in_guaranteed Event</a><a>) -> () + 20 (:0)
133 RxSwift                       	0x0000000102351ddc thunk for @escaping @callee_guaranteed (@in_guaranteed Event</a><a>) -> (@out ()) + 12 (:0)
134 RxSwift                       	0x0000000102351ddc dispatch</a><a>(_:_:) + 28 (PublishSubject.swift:61)
135 RxSwift                       	0x0000000102351ddc PublishSubject.on(_:) + 76
136 LensMobileCore                	0x0000000102a15918 specialized protocol witness for ObserverType.on(_:) in conformance PublishSubject</a><a> + 8 (:0)
137 LensMobileCore                	0x0000000102a15918 specialized ObserverType.onNext(_:) + 8 (:0)
138 LensMobileCore                	0x0000000102a15918 AVAudioSessionWrapperImpl.handleRouteChange(notification:) + 1140
139 LensMobileCore                	0x0000000102a15a40 @objc AVAudioSessionWrapperImpl.handleRouteChange(notification:) + 112 (:0)
140 CoreFoundation                	0x00000001918ca78c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 (CFNotificationCenter.c:700)
141 CoreFoundation                	0x00000001918ca6a8 ___CFXRegistrationPost_block_invoke + 88 (CFNotificationCenter.c:193)
142 CoreFoundation                	0x00000001918ca5f0 _CFXRegistrationPost + 440 (CFNotificationCenter.c:221)
143 CoreFoundation                	0x00000001918c8bb8 _CFXNotificationPost + 728 (CFNotificationCenter.c:1247)
144 Foundation                    	0x0000000190756254 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:531)
145 AudioSession                  	0x00000001aeb06be4 __63-[AVAudioSession privatePostNotificationForType:name:userInfo:]_block_invoke + 72 (AVAudioSession_iOS.mm:3203)
146 libdispatch.dylib             	0x00000001997a113c _dispatch_call_block_and_release + 32 (init.c:1530)
147 libdispatch.dylib             	0x00000001997a2dd4 _dispatch_client_callout + 20 (object.m:576)
148 libdispatch.dylib             	0x00000001997b15a4 _dispatch_main_queue_drain + 988 (queue.c:7898)
149 libdispatch.dylib             	0x00000001997b11b8 _dispatch_main_queue_callback_4CF + 44 (queue.c:8058)
150 CoreFoundation                	0x00000001918cf710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
151 CoreFoundation                	0x00000001918cc914 __CFRunLoopRun + 1996 (CFRunLoop.c:3149)
152 CoreFoundation                	0x00000001918cbcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
153 GraphicsServices              	0x00000001d63191a8 GSEventRunModal + 164 (GSEvent.c:2196)
154 UIKitCore                     	0x0000000193f05ae8 -[UIApplication _run] + 888 (UIApplication.m:3713)
155 UIKitCore                     	0x0000000193fb9d98 UIApplicationMain + 340 (UIApplication.m:5303)
156 SwiftUI                       	0x0000000195ac0294 closure #1 in KitRendererCommon(_:) + 168 (UIKitApp.swift:51)
157 SwiftUI                       	0x0000000195a6c860 runApp</a><a>(_:) + 152 (UIKitApp.swift:14)
158 SwiftUI                       	0x0000000195a7861c static App.main() + 132 (App.swift:114)
159 Poly Lens iOS                 	0x00000001008cd618 static PolyLensApp.$main() + 52 (PolyLensApp.swift:0)
160 Poly Lens iOS                 	0x00000001008cd618 main + 64
161 dyld                          	0x00000001b50a3154 start + 2356 (dyldMain.cpp:1298)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib        	0x00000001da5516c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001da554ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001da554de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001da554c20 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001918ccf5c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x00000001918cc600 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x00000001918cbcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   Foundation                    	0x00000001907ecb5c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x00000001907ec9ac -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x0000000193f1981c -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1207)
10  Foundation                    	0x0000000190803428 __NSThread__start__ + 732 (NSThread.m:991)
11  libsystem_pthread.dylib       	0x00000001ee34e06c _pthread_start + 136 (pthread.c:931)
12  libsystem_pthread.dylib       	0x00000001ee3490d8 thread_start + 8 (:-1)

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib        	0x00000001da5516c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001da554ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001da554de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001da554c20 mach_msg + 24 (mach_msg.c:323)
4   FirebaseCrashlytics           	0x0000000101c3f4f8 FIRCLSMachExceptionReadMessage + 56 (FIRCLSMachException.c:192)
5   FirebaseCrashlytics           	0x0000000101c3f4f8 FIRCLSMachExceptionServer + 104 (FIRCLSMachException.c:168)
6   libsystem_pthread.dylib       	0x00000001ee34e06c _pthread_start + 136 (pthread.c:931)
7   libsystem_pthread.dylib       	0x00000001ee3490d8 thread_start + 8 (:-1)

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib        	0x00000001da559334 __select + 8 (:-1)
1   CoreFoundation                	0x0000000191937b7c __CFSocketManager + 640 (CFSocket.c:1340)
2   libsystem_pthread.dylib       	0x00000001ee34e06c _pthread_start + 136 (pthread.c:931)
3   libsystem_pthread.dylib       	0x00000001ee3490d8 thread_start + 8 (:-1)

Thread 4 name:
Thread 4:
0   libsystem_kernel.dylib        	0x00000001da5516c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001da554ec8 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001da554de0 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001da554c20 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001918ccf5c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x00000001918cc600 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x00000001918cbcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   CFNetwork                     	0x0000000192aacc7c +[__CFN_CoreSchedulingSetRunnable _run:] + 384 (CoreSchedulingSet.mm:1473)
8   Foundation                    	0x0000000190803428 __NSThread__start__ + 732 (NSThread.m:991)
9   libsystem_pthread.dylib       	0x00000001ee34e06c _pthread_start + 136 (pthread.c:931)
10  libsystem_pthread.dylib       	0x00000001ee3490d8 thread_start + 8 (:-1)

Thread 5 name:
Thread 5:
0   libswiftCore.dylib            	0x0000000190549644 swift_retain_n + 56 (HeapObject.cpp:538)
1   Foundation                    	0x000000019075e0cc JSONDecoderImpl.container</a><a>(keyedBy:) + 476 (:0)
2   Foundation                    	0x000000019075dee4 protocol witness for Decoder.container</a><a>(keyedBy:) in conformance JSONDecoderImpl + 24 (:0)
3   libswiftCore.dylib            	0x0000000190501cf8 dispatch thunk of Decoder.container</a><a>(keyedBy:) + 32
4   LensMobileCore                	0x0000000102a03480 specialized DeviceSetting.Item.PolyValue.Payload.init(from:) + 164 (DeviceSetting.swift:343)
5   LensMobileCore                	0x0000000102a012a0 DeviceSetting.Item.PolyValue.Payload.init(from:) + 8 (:0)
6   LensMobileCore                	0x0000000102a012a0 protocol witness for Decodable.init(from:) in conformance DeviceSetting.Item.PolyValue.Payload + 28
7   libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
8   Foundation                    	0x00000001907a2f90 specialized JSONDecoderImpl.unwrap(_:as:for:_:) + 952 (JSONDecoder.swift:623)
9   Foundation                    	0x00000001907fe8e0 JSONDecoderImpl.UnkeyedContainer.decode</a><a>(_:) + 752 (JSONDecoder.swift:1480)
10  Foundation                    	0x00000001907fe5e8 protocol witness for UnkeyedDecodingContainer.decode</a><a>(_:) in conformance JSONDecoderImpl.UnkeyedContainer + 16 (:0)
11  libswiftCore.dylib            	0x0000000190212b24 Array</a><a>.init(from:) + 432 (Codable.swift:5434)
12  libswiftCore.dylib            	0x0000000190212c10 protocol witness for Decodable.init(from:) in conformance </a><a> [A] + 32 (:0)
13  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
14  Foundation                    	0x00000001907a26cc JSONDecoderImpl.unwrap(_:as:for:_:) + 996 (JSONDecoder.swift:623)
15  Foundation                    	0x00000001907a20e8 JSONDecoderImpl.KeyedContainer.decode</a><a>(_:forKey:) + 548 (JSONDecoder.swift:1297)
16  Foundation                    	0x00000001907a1eb8 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 56 (:-1)
17  Foundation                    	0x00000001907a1e78 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 36 (:-1)
18  libswiftCore.dylib            	0x000000019020409c _KeyedDecodingContainerBox.decode(_:forKey:) + 508 (Codable.swift:4324)
19  libswiftCore.dylib            	0x00000001901f55cc KeyedDecodingContainer.decode</a><a>(_:forKey:) + 68 (Codable.swift:1759)
20  LensMobileCore                	0x0000000102a03bb8 specialized DeviceSetting.Item.PolyValue.init(from:) + 388 (DeviceSetting.swift:414)
21  LensMobileCore                	0x0000000102a017c8 DeviceSetting.Item.PolyValue.init(from:) + 4 (:0)
22  LensMobileCore                	0x0000000102a017c8 protocol witness for Decodable.init(from:) in conformance DeviceSetting.Item.PolyValue + 20
23  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
24  Foundation                    	0x00000001907a2f90 specialized JSONDecoderImpl.unwrap(_:as:for:_:) + 952 (JSONDecoder.swift:623)
25  Foundation                    	0x00000001907fe8e0 JSONDecoderImpl.UnkeyedContainer.decode</a><a>(_:) + 752 (JSONDecoder.swift:1480)
26  Foundation                    	0x00000001907fe5e8 protocol witness for UnkeyedDecodingContainer.decode</a><a>(_:) in conformance JSONDecoderImpl.UnkeyedContainer + 16 (:0)
27  libswiftCore.dylib            	0x0000000190212b24 Array</a><a>.init(from:) + 432 (Codable.swift:5434)
28  libswiftCore.dylib            	0x0000000190212c10 protocol witness for Decodable.init(from:) in conformance </a><a> [A] + 32 (:0)
29  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
30  Foundation                    	0x00000001907a26cc JSONDecoderImpl.unwrap(_:as:for:_:) + 996 (JSONDecoder.swift:623)
31  Foundation                    	0x00000001907a20e8 JSONDecoderImpl.KeyedContainer.decode</a><a>(_:forKey:) + 548 (JSONDecoder.swift:1297)
32  Foundation                    	0x00000001907a1eb8 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 56 (:-1)
33  Foundation                    	0x00000001907a1e78 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 36 (:-1)
34  libswiftCore.dylib            	0x000000019020409c _KeyedDecodingContainerBox.decode(_:forKey:) + 508 (Codable.swift:4324)
35  libswiftCore.dylib            	0x00000001901f55cc KeyedDecodingContainer.decode</a><a>(_:forKey:) + 68 (Codable.swift:1759)
36  LensMobileCore                	0x0000000102a02d34 specialized DeviceSetting.Item.init(from:) + 708 (DeviceSetting.swift:288)
37  LensMobileCore                	0x0000000102a006a4 DeviceSetting.Item.init(from:) + 8 (:0)
38  LensMobileCore                	0x0000000102a006a4 protocol witness for Decodable.init(from:) in conformance DeviceSetting.Item + 28
39  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
40  Foundation                    	0x00000001907a26cc JSONDecoderImpl.unwrap(_:as:for:_:) + 996 (JSONDecoder.swift:623)
41  Foundation                    	0x00000001907a20e8 JSONDecoderImpl.KeyedContainer.decode</a><a>(_:forKey:) + 548 (JSONDecoder.swift:1297)
42  Foundation                    	0x00000001907a1eb8 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 56 (:-1)
43  Foundation                    	0x00000001907a1e78 protocol witness for KeyedDecodingContainerProtocol.decode</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 36 (:-1)
44  libswiftCore.dylib            	0x00000001901f4f68 KeyedDecodingContainerProtocol.decodeIfPresent</a><a>(_:forKey:) + 740 (Codable.swift:6020)
45  Foundation                    	0x0000000190737f0c protocol witness for KeyedDecodingContainerProtocol.decodeIfPresent</a><a>(_:forKey:) in conformance JSONDecoderImpl.KeyedContainer</a><a> + 36 (:0)
46  libswiftCore.dylib            	0x0000000190206ab0 _KeyedDecodingContainerBox.decodeIfPresent(_:forKey:) + 508 (Codable.swift:4459)
47  libswiftCore.dylib            	0x00000001901f5b74 KeyedDecodingContainer.decodeIfPresent</a><a>(_:forKey:) + 76 (Codable.swift:2059)
48  LensMobileCore                	0x0000000102a020b0 specialized DeviceSetting.init(from:) + 340 (DeviceSetting.swift:255)
49  LensMobileCore                	0x00000001029fff7c DeviceSetting.init(from:) + 8 (:0)
50  LensMobileCore                	0x00000001029fff7c protocol witness for Decodable.init(from:) in conformance DeviceSetting + 28
51  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
52  Foundation                    	0x00000001907a2f90 specialized JSONDecoderImpl.unwrap(_:as:for:_:) + 952 (JSONDecoder.swift:623)
53  Foundation                    	0x00000001907fe8e0 JSONDecoderImpl.UnkeyedContainer.decode</a><a>(_:) + 752 (JSONDecoder.swift:1480)
54  Foundation                    	0x00000001907fe5e8 protocol witness for UnkeyedDecodingContainer.decode</a><a>(_:) in conformance JSONDecoderImpl.UnkeyedContainer + 16 (:0)
55  libswiftCore.dylib            	0x0000000190212b24 Array</a><a>.init(from:) + 432 (Codable.swift:5434)
56  libswiftCore.dylib            	0x0000000190212c10 protocol witness for Decodable.init(from:) in conformance </a><a> [A] + 32 (:0)
57  libswiftCore.dylib            	0x0000000190501bd4 dispatch thunk of Decodable.init(from:) + 32 (:-1)
58  Foundation                    	0x00000001907a2f90 specialized JSONDecoderImpl.unwrap(_:as:for:_:) + 952 (JSONDecoder.swift:623)
59  Foundation                    	0x00000001907a19a8 partial apply for closure #1 in JSONDecoder.decode</a><a>(_:from:) + 84 (:0)
60  Foundation                    	0x000000019079f0ec closure #1 in JSONDecoder._decode</a><a>(_:from:) + 768 (JSONDecoder.swift:386)
61  Foundation                    	0x000000019079ede4 partial apply for closure #1 in JSONDecoder._decode</a><a>(_:from:) + 24 (:0)
62  Foundation                    	0x000000019079ecf4 closure #1 in static JSONDecoder.withUTF8Representation</a><a>(of:_:) + 768 (JSONDecoder.swift:465)
63  Foundation                    	0x000000019079e9ec partial apply for closure #1 in static JSONDecoder.withUTF8Representation</a><a>(of:_:) + 24 (:0)
64  Foundation                    	0x000000019079e9c0 closure #1 in Data.withBufferView</a><a>(_:) + 40 (BufferViewCompatibility.swift:27)
65  Foundation                    	0x000000019079e990 partial apply for closure #1 in Data.withBufferView</a><a>(_:) + 24 (:0)
66  Foundation                    	0x000000019079e964 Data.InlineSlice.withUnsafeBytes</a><a>(_:) + 100 (Data.swift:918)
67  Foundation                    	0x000000019079e488 JSONDecoder.decode</a><a>(_:from:) + 616 (JSONDecoder.swift:348)
68  Foundation                    	0x000000019079e218 dispatch thunk of JSONDecoder.decode</a><a>(_:from:) + 56 (:-1)
69  LensMobileCore                	0x0000000102a669b0 specialized DataAssetLoader.load</a><a>(_:bundle:name:) + 120 (DataAssetLoader.swift:24)
70  LensMobileCore                	0x0000000102a669b0 specialized DataAssetLoader.globalSettings(for:) + 480 (AccessoryGlobalSettingsLoader.swift:20)
71  LensMobileCore                	0x0000000102a6c1d4 DataAssetLoader.globalSettings(for:) + 12 (:15)
72  LensMobileCore                	0x0000000102a6c1d4 protocol witness for AccessoryGlobalSettingsLoader.globalSettings(for:) in conformance DataAssetLoader + 12 (:0)
73  LensMobileCore                	0x0000000102a6c1d4 AccessorySettingsManagerImpl.executor(from:) + 108
74  LensMobileCore                	0x0000000102a70ad4 thunk for @escaping @callee_guaranteed (@in_guaranteed DeviceInfo) -> (@owned Observable<(uid: DeviceIdentifier, executor: DeviceSettingsExecutor)>, @error @owned Error) + 4 (:0)
75  LensMobileCore                	0x0000000102a70ad4 partial apply for thunk for @escaping @callee_guaranteed (@in_guaranteed DeviceInfo) -> (@owned Observable<(uid: DeviceIdentifier, executor: DeviceSettingsExecutor)>, @error @owned Error) + 24
76  RxSwift                       	0x000000010233fe64 FlatMapSink.performMap(_:) + 32
77  RxSwift                       	0x000000010233fda0 FlatMapSink.performMap(_:) + 12
78  RxSwift                       	0x000000010233f65c closure #1 in MergeSink.nextElementArrived(element:) + 48 (Merge.swift:443)
79  RxSwift                       	0x000000010233f65c specialized NSRecursiveLock.performLocked</a><a>(_:) + 64 (Lock.swift:21)
80  RxSwift                       	0x000000010233f65c MergeSink.nextElementArrived(element:) + 76 (Merge.swift:437)
81  RxSwift                       	0x000000010233f65c MergeSink.on(_:) + 608 (Merge.swift:458)
82  RxSwift                       	0x00000001023405ec protocol witness for ObserverType.on(_:) in conformance MergeSink + 20 (:0)
83  RxSwift                       	0x0000000102348538 closure #1 in ObserveOnSerialDispatchQueueSink.init(scheduler:observer:cancel:) + 404 (ObserveOn.swift:196)
84  RxSwift                       	0x0000000102348868 thunk for @escaping @callee_guaranteed (@guaranteed ObserveOnSerialDispatchQueueSink</a><a>, @in_guaranteed Event) -> (@out Disposable) + 160 (:0)
85  RxSwift                       	0x0000000102326b10 closure #1 in DispatchQueueConfiguration.schedule</a><a>(_:action:) + 104 (DispatchQueueConfiguration.swift:27)
86  RxSwift                       	0x000000010231cb04 thunk for @escaping @callee_guaranteed @Sendable () -> () + 28 (:0)
87  libdispatch.dylib             	0x00000001997a113c _dispatch_call_block_and_release + 32 (init.c:1530)
88  libdispatch.dylib             	0x00000001997a2dd4 _dispatch_client_callout + 20 (object.m:576)
89  libdispatch.dylib             	0x00000001997aa400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
90  libdispatch.dylib             	0x00000001997aaf30 _dispatch_lane_invoke + 380 (queue.c:3991)
91  libdispatch.dylib             	0x00000001997b5cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
92  libdispatch.dylib             	0x00000001997b5528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
93  libsystem_pthread.dylib       	0x00000001ee34c934 _pthread_wqthread + 288 (pthread.c:2696)
94  libsystem_pthread.dylib       	0x00000001ee3490cc start_wqthread + 8 (:-1)

Thread 6:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)

Thread 7:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)

Thread 8:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)

Thread 9:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)

Thread 10 name:
Thread 10 Crashed:
0   libsystem_kernel.dylib        	0x00000001da55c2ec __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001ee34fc0c pthread_kill + 268 (pthread.c:1721)
2   libsystem_c.dylib             	0x000000019985bc34 __abort + 136 (abort.c:159)
3   libsystem_c.dylib             	0x000000019985bbac abort + 192 (abort.c:126)
4   libc++abi.dylib               	0x00000001ee26cca4 abort_message + 132 (abort_message.cpp:78)
5   libc++abi.dylib               	0x00000001ee25ce5c demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77)
6   libobjc.A.dylib               	0x00000001897b714c _objc_terminate() + 144 (objc-exception.mm:496)
7   FirebaseCrashlytics           	0x0000000101c36558 FIRCLSTerminateHandler() + 340 (FIRCLSException.mm:463)
8   libc++abi.dylib               	0x00000001ee26c068 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
9   libc++abi.dylib               	0x00000001ee26c00c std::terminate() + 108 (cxa_handlers.cpp:88)
10  libdispatch.dylib             	0x00000001997a2de8 _dispatch_client_callout + 40 (object.m:579)
11  libdispatch.dylib             	0x00000001997a5f6c _dispatch_queue_override_invoke + 928 (queue.c:4967)
12  libdispatch.dylib             	0x00000001997b4894 _dispatch_root_queue_drain + 392 (queue.c:7136)
13  libdispatch.dylib             	0x00000001997b509c _dispatch_worker_thread2 + 156 (queue.c:7204)
14  libsystem_pthread.dylib       	0x00000001ee34c8f8 _pthread_wqthread + 228 (pthread.c:2709)
15  libsystem_pthread.dylib       	0x00000001ee3490cc start_wqthread + 8 (:-1)

Thread 11:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)

Thread 12:
0   libsystem_pthread.dylib       	0x00000001ee3490c4 start_wqthread + 0 (:-1)


Thread 10 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x0000000000000000   x5: 0x0000000000989680   x6: 0x000000000000006e   x7: 0x0000000000000000
    x8: 0x411b1eebff405be2   x9: 0x411b1eea90386be2  x10: 0x00000000000003e8  x11: 0x000000016f7828b0
   x12: 0x0000000000000000  x13: 0x00000000001ff800  x14: 0x0000000000000010  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x000000016f783000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x000000000000f20f  x21: 0x000000016f7830e0  x22: 0x0000000000000007  x23: 0x0000000101c65ea7
   x24: 0x0000000000000000  x25: 0x00000001f22111c0  x26: 0x00000000000005ff  x27: 0x00000001f34cedc4
   x28: 0x0000000000000000   fp: 0x000000016f782cb0   lr: 0x00000001ee34fc0c
    sp: 0x000000016f782c90   pc: 0x00000001da55c2ec cpsr: 0x40001000
   esr: 0x56000080  Address size fault


Binary Images:
        0x100704000 -         0x100fabfff Poly Lens iOS arm64  <1d3135a3488d34ecaa5584e935426633> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Poly Lens iOS
        0x1012e0000 -         0x1012ebfff AzureIoTuMqtt arm64  <2f0eddaac13539929155d89d055162b1> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/AzureIoTuMqtt.framework/AzureIoTuMqtt
        0x10130c000 -         0x101333fff AzureIoTUtility arm64  <5f8d234c3c8f3013993676897b9651a6> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/AzureIoTUtility.framework/AzureIoTUtility
        0x101358000 -         0x10135ffff FirebaseCoreExtension arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseCoreExtension.framework/FirebaseCoreExtension
        0x101378000 -         0x1013ebfff AzureIoTHubClient arm64  <1682c9419f9234f39f924c0d484235f8> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/AzureIoTHubClient.framework/AzureIoTHubClient
        0x101430000 -         0x101437fff RxRelay arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/RxRelay.framework/RxRelay
        0x101460000 -         0x10146ffff FBLPromises arm64  <7e29a6ccd0d335318e37b94ced640b79> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FBLPromises.framework/FBLPromises
        0x1014a0000 -         0x1014dffff AzureIoTuAmqp arm64  <27e8943b8a6333f382960ee0fd09c1d7> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/AzureIoTuAmqp.framework/AzureIoTuAmqp
        0x101510000 -         0x10151bfff FirebaseRemoteConfigInterop arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseRemoteConfigInterop.framework/FirebaseRemoteConfigInterop
        0x101534000 -         0x10153bfff nanopb arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/nanopb.framework/nanopb
        0x1019e4000 -         0x1019f7fff FirebaseCore arm64  <2a2096fc1a483f559e8d8f3c36dc23cb> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseCore.framework/FirebaseCore
        0x101a18000 -         0x101a2ffff FirebaseInstallations arm64  <7ae99081fe6f367e894df674d6860a78> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseInstallations.framework/FirebaseInstallations
        0x101a70000 -         0x101a9ffff CombineExt arm64  <94d3ade949a93dd1a8ad27800e726744> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/CombineExt.framework/CombineExt
        0x101b00000 -         0x101b1bfff FirebaseCoreInternal arm64  <32407368462f3d25b732b3da6861b60f> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseCoreInternal.framework/FirebaseCoreInternal
        0x101b58000 -         0x101b63fff Reachability arm64  <4682668d4ce73dcaa2de8b4f21515317> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/Reachability.framework/Reachability
        0x101b84000 -         0x101b8ffff LensShared arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/LensShared.framework/LensShared
        0x101bb0000 -         0x101bcbfff FirebaseSessions arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseSessions.framework/FirebaseSessions
        0x101c28000 -         0x101c77fff FirebaseCrashlytics arm64  <3fe9ed014a963bc8b39709194be16479> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/FirebaseCrashlytics.framework/FirebaseCrashlytics
        0x101cf8000 -         0x101d17fff GoogleUtilities arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/GoogleUtilities.framework/GoogleUtilities
        0x101d5c000 -         0x101d83fff GoogleDataTransport arm64  <83a44c977ac03e1a90d6ae624bfc1967> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/GoogleDataTransport.framework/GoogleDataTransport
        0x101dc0000 -         0x101dd3fff Promises arm64  <463e22a04a8439539de199790766ff87> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/Promises.framework/Promises
        0x101e30000 -         0x101e4bfff PolyIoT arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/PolyIoT.framework/PolyIoT
        0x101e70000 -         0x101ea3fff RxSwiftExt arm64  <5c6fb78468d639cd80080198d1e22384> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/RxSwiftExt.framework/RxSwiftExt
        0x101f28000 -         0x101f33fff libobjc-trampolines.dylib arm64e   /private/preboot/Cryptexes/OS/usr/lib/libobjc-trampolines.dylib
        0x101f60000 -         0x101fd3fff RxCocoa arm64   /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/RxCocoa.framework/RxCocoa
        0x102168000 -         0x1021d7fff PolyAuth arm64  <5a69cf65be573baa9747c4c5a6b23173> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/PolyAuth.framework/PolyAuth
        0x1022f0000 -         0x1023affff RxSwift arm64  <54ac95556741334492709b0fdb2ed8aa> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/RxSwift.framework/RxSwift
        0x10251c000 -         0x102653fff PolyCloud arm64  <4fb607eef49031e78949e81e353534ed> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/PolyCloud.framework/PolyCloud
        0x1029dc000 -         0x102bf7fff LensMobileCore arm64  <6bb3f1bde9793eb99f536ddb555b6d6d> /private/var/containers/Bundle/Application/AE5D4478-F14C-4CFB-B892-60D90F2F2BBA/Poly Lens iOS.app/Frameworks/LensMobileCore.framework/LensMobileCore
        0x189784000 -         0x1897d4cf3 libobjc.A.dylib arm64e   /usr/lib/libobjc.A.dylib
        0x1901a0000 -         0x1906effff libswiftCore.dylib arm64e  <42ba5407c1fe30888d7d0b89f6b541e1> /usr/lib/swift/libswiftCore.dylib
        0x190725000 -         0x19129afff Foundation arm64e   /System/Library/Frameworks/Foundation.framework/Foundation
        0x191879000 -         0x191da6fff CoreFoundation arm64e  <76a3b1983c09323e83590d4978e156f5> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
        0x1929af000 -         0x192d8bfff CFNetwork arm64e  <371394cd79f23216acb0a159c09c668d> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
        0x193afb000 -         0x19561cfff UIKitCore arm64e  <9da0d27355063712b73de0149d74c13c> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
        0x1956cc000 -         0x19746afff SwiftUI arm64e  <2cdac0c43f6a38be99d155296a43d89f> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
        0x19979f000 -         0x1997e5fff libdispatch.dylib arm64e  <5f66cdb608a936158c6a4e3b47005495> /usr/lib/system/libdispatch.dylib
        0x1997e6000 -         0x199863ff3 libsystem_c.dylib arm64e  <7135c2c8ba5836368b46a9e6226ead45> /usr/lib/system/libsystem_c.dylib
        0x19ac9b000 -         0x19acb2ff7 libswiftDispatch.dylib arm64e  <37c324582b943636b0374c8c82c9511f> /usr/lib/swift/libswiftDispatch.dylib
        0x1aeb00000 -         0x1aeb4cfff AudioSession arm64e  <183f444eba223c0897940dde9d906f39> /System/Library/PrivateFrameworks/AudioSession.framework/AudioSession
        0x1b5066000 -         0x1b50f3937 dyld arm64e  <52039c944da13638bd52020a0b5fa399> /usr/lib/dyld
        0x1c4be8000 -         0x1c4c05fff ExternalAccessory arm64e   /System/Library/Frameworks/ExternalAccessory.framework/ExternalAccessory
        0x1d6318000 -         0x1d6320fff GraphicsServices arm64e  <3ebbd576e7d83f69bcb5b9810ddcc90e> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
        0x1da550000 -         0x1da589fef libsystem_kernel.dylib arm64e  <21ee5290d1193c31b948431865a67738> /usr/lib/system/libsystem_kernel.dylib
        0x1ee258000 -         0x1ee273ffb libc++abi.dylib arm64e   /usr/lib/libc++abi.dylib
        0x1ee348000 -         0x1ee354ff3 libsystem_pthread.dylib arm64e   /usr/lib/system/libsystem_pthread.dylib
        0x1ee38c000 -         0x1ee3d4fff libxpc.dylib arm64e   /usr/lib/system/libxpc.dylib

EOF
</a>

It is hard to believe that Apple could have such a simple bug. If it were Apple's bug, other companies who produce MFI devices could also experience the identical bug, but I don't see anyone raising the identical issue.

If you haven't already, please file a bug on this then post the bug back here. The bug is not simple, but we might be able to do something to handle this better.

Looking at the crash itself, let me start with this error:

Exception Reason: *** -[NSArray initWithArray:range:copyItems:]: range {0, 1} extends beyond bounds for empty array

What this error actually means is that you passed in a range that's outside of the contents of the target array. In this case, you'd be passing in the range {0, 1} to an empty array. The problem here is that this is NOT what EAAccessory did. What they called was:

3   CoreFoundation                	0x1918c39a8 +[NSArray arrayWithArray:] (in CoreFoundation) + 60

And what arrayWithArray actually did was:

return [[[self alloc] initWithArray:array range:NSMakeRange(0, [array count]) copyItems:NO] autorelease];

On it's own, that code should never generate this failure since, by defintion, the range of any array is {0, count}. Also, just to cover the edge case, the issue isn't that the array is NULL, as initWithArray will actually work fine with a NULL array and a null array would have generated {0, 0}.

That leads to here...

The only assumption I have is that something is wrong with Threads.

Yes, threads are definitely. The only way I can see this happening is that something deleted the object from that array at EXACTLY the moment the array was being created. However, that does imply some very specific timing and I'm no sure what would have created that.

Moving to here:

Maybe we are blocking a Thread somewhere, or EAAccessory should always work on the Main Thread but we switch streams to another thread.

Yes, though it's not the main thread itself that's at issue. A few things I'd be concerned about here:

  • EAAccessory calls it's delegate on the main thread, so using it on another thread means you're creating race conditions between those two thread.

  • NSStream is a VERY old API which, depending on how it's used, is heavily reliant on a having a working run loop. That basically means that using it on a GCD thread could cause weird problems, depending on exactly how it's used.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

@DTS Engineer

First of all thanks for your answer.

In the message before yours I have posted full log.

The interesting stuff for me, that NSArray is handling by EAAccessory, it is part of EAAccessory framework, not my Array. So I try to understand what I can do with thread to affect Main Thread in that way that Object could be deleted in that moment when it was created.

And usually it is happens in background. And btw, it is only visible on PROD, so when optimization is turned on. Our QA has never observed the bug.

Thanks, Eugene.

In the message before yours I have posted full log.

Yep, that's what I based my earlier post on. Unfortunately, all I can really talk about here is what happened in "our" code. There's clearly plenty of other thread activity happening as well which is probably involved in creating the problem, but I can't really be any more specific than that.

The interesting stuff for me, that NSArray is handling by EAAccessory, it is part of EAAccessory framework, not my Array. So I try to understand what I can do with thread to affect Main Thread in that way that Object could be deleted in that moment when it was created.

Yes, but that array is holding the systems references to underlying object that EAAccessory manipulates. I'm not sure of what's happening that actually creates the crash, but that's my best guess from comparing the crash log and our code.

Also, to clarify, I do think our code has some "involvement" here, as that array shouldn't really be able to be put into that state. However, that doesn't mean you don't also have an issue here. Our fix for this kind of threading issue often ends up exposing other issue that were previously hidden by the current crash, assuming it doesn't simply result in a different crash*.

*As a more direct and dramatic example of this, my recommendation to any developer who's app manages to cause a kernel panic is:

  1. File a bug immediately. The kernel should never panic, so all kernel panics are bugs.

  2. Figure out what you're doing that's causing the panic and stop immediately.

The reason for #2 is quite simple. I said the kernel shouldn't panic, I didn't say it had to keep running your app. As far as the kernel is concerned terminating your process is a perfectly reasonable way to avoid panic'ing, but that "fix" won't really improve your apps user experience.

And usually it is happens in background. And btw, it is only visible on PROD, so when optimization is turned on.

FYI, you can change the compiler optimization level for debug builds. It defaults to "0" because optimizations like instruction reordering confuse the debugger*, but you can still follow the "flow" pretty well even at "5".

Also, if you haven't already, take a look at "Diagnosing memory, thread, and crash issues early" and do some testing with those tools, particularly the Thread Sanitizer. I can't promise they'll find anything (unfortunately, bug like this are hard...), but these issues are hard enough to investigate that a tool that finds even SOME problems can be a huge help.

Our QA has never observed the bug.

Yes, that's pretty common. The nature of threading failures is that they often require very specific circumstances to reproduce and, in most cases, you won't known what those are until after you've found the problem. However, two things you can look at here:

  1. If you're in contact with any users experiencing this issue or have any other data about them, what makes them "different" than other user? Why makes them "special" compared to everyone else? One thing I particularly like to look at here is the crash timestamps, looking for things like how long the app was running, what time the crash occurred, and what timezone the crash was in (which gives an indication of "where" the users might be).

  2. What is your QA process actually testing. For accessory apps in particular, I think there are two different "extremes" that testing should be focused on:

  • Stressing the accessory and app to artificially induce failure. For example, leaks or other issues are more likely at "transition" points, so a testing process that forces the app to connect/disconnect hundreds/thousands of times can be a lot more useful than simply testing normal app use.

  • Replicating real world usage in a way that gets you good data about what actually went wrong. The specifics of how this work depend on what you're accessory actually is but one crash from an app build that generates detailed activity logs or from a developers who's aware of your app internal implementation details can be FAR more useful than a standalone crash log.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

EAAccessoryManager crashes
 
 
Q