herald-for-ios
herald-for-ios copied to clipboard
Crash occurring when starting sensors
Hello,
I have been trying to implement Herald into a project I'm involved in. The project is purely tailored for scientific research use. We successfully implemented the Herald protocol and were able to get devices to detect each other. On occasions we get a crash report that seems a bit odd to us as it originates from within Herald.
Sometimes, during initialization we get the following error in our stack:
#0 (null) in _dispatch_queue_xref_dispose.cold.2 ()
and this is originating from notifySubscribers("start") in the ConcreteBLETransmitter.startAdvertising() method. Attached below is a screenshot of the stack trace and the crash log (the crashing thread is Thread 3)

Incident Identifier: 2BF80B50-FEE8-4E53-83CC-81C31D0BD186 Hardware Model: iPhone13,3 Process: [redacted] [4518] Path: /private/var/containers/Bundle/Application/416F98AB-E681-4CA3-A161-ED79C7EC6755/[redacted].app/[redacted] Identifier: [redacted] Version: 1.4.16 (181) AppStoreTools: 14B44 AppVariant: 1:iPhone13,3:16 Beta: YES Code Type: ARM-64 (Native) Role: Non UI Parent Process: launchd [1] Coalition: [redacted] [1166]
Date/Time: 2022-11-28 19:02:58.3831 -0600 Launch Time: 2022-11-28 19:02:58.0143 -0600 OS Version: iPhone OS 16.1.1 (20B101) Release Type: User Baseband Version: 3.07.00 Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001cc1e4ebc Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [4518]
Triggered by Thread: 3
Thread 0 name: Thread 0: 0 libsystem_kernel.dylib 0x00000002017d1b48 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000002017e4008 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000002017e4248 mach_msg_overwrite + 388 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000002017d208c mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001c4c4eaf0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x00000001c4c4fd34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005) 6 CoreFoundation 0x00000001c4c54ed4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 GraphicsServices 0x00000001fdf52368 GSEventRunModal + 164 (GSEvent.c:2196) 8 UIKitCore 0x00000001c71333d0 -[UIApplication _run] + 888 (UIApplication.m:3745) 9 UIKitCore 0x00000001c7133034 UIApplicationMain + 340 (UIApplication.m:5335) 10 [redacted] 0x0000000100e318e0 main + 68 (AppDelegate.swift:19) 11 dyld 0x00000001e32bc960 start + 2528 (dyldMain.cpp:1170)
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x00000002017d1ac4 semaphore_wait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001cc1ae578 _dispatch_sema4_wait + 28 (lock.c:139)
2 libdispatch.dylib 0x00000001cc1aec2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3 [redacted] 0x000000010106ae7c CountdownLatch.await() + 4 (CountdownLatch.swift:34)
4 [redacted] 0x000000010106ae7c AlarmExecutor.execute() + 128 (AlarmExecutor.swift:106)
5 [redacted] 0x000000010106ae7c AlarmTasker.doAlarmTaskerWork(caller:lookahead:) + 1848 (AlarmTasker.swift:263)
6 [redacted] 0x000000010106f4cc closure #1 in closure #1 in AlarmTasker.checkAndFireAlarms(caller:lookahead:) + 4 (AlarmTasker.swift:223)
7 [redacted] 0x000000010106f4cc partial apply for closure #1 in closure #1 in AlarmTasker.checkAndFireAlarms(caller:lookahead:) + 20 (
Thread 2 name:
Thread 2:
0 LocationSupport 0x00000001dfd95098 CLConnectionClient::setRequireManualCachedMessageSend(bool) + 0 (CLConnectionClient.mm:544)
1 CoreLocation 0x00000001d0567894 CLClientCreateWithBundleIdentifierAndPathWithWebsiteOnSilo + 1456 (CLClient.mm:820)
2 CoreLocation 0x00000001d0572984 -[CLLocationManagerInternal initWithInfo:bundleIdentifier:bundlePath:websiteIdentifier:delegate:silo:] + 252 (CLLocationManager.m:414)
3 CoreLocation 0x00000001d0572f0c -[CLLocationManager initWithEffectiveBundleIdentifier:bundlePath:websiteIdentifier:delegate:silo:] + 428 (CLLocationManager.m:622)
4 [redacted] 0x000000010111726c LocationAlwaysPermission.status.getter + 3060332 (LocationAlwaysPermission.swift:44)
5 [redacted] 0x0000000101078f88 Permission.denied.getter + 20 (Permission.swift:31)
6 [redacted] 0x0000000100fb8f5c specialized PhoneSettingsComplianceChecker.areLocationPermissionsEnabled() + 1625948 (PhoneSettingsComplianceChecker.swift:63)
7 [redacted] 0x0000000100f9121c PhoneSettingsComplianceChecker.areLocationPermissionsEnabled() + 4 (
Thread 3 name:
Thread 3 Crashed:
0 libdispatch.dylib 0x00000001cc1e4ebc _dispatch_queue_xref_dispose.cold.2 + 36 (queue.c:2959)
1 libdispatch.dylib 0x00000001cc1b4644 _dispatch_queue_xref_dispose + 64 (queue.c:0)
2 libdispatch.dylib 0x00000001cc1ad844 -[OS_dispatch_source xref_dispose] + 28 (object.m:350)
3 [redacted] 0x0000000100f63a64 ConcreteBLETransmitter.notifySubscribers(:) + 1312 (
Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x00000002017d1adc semaphore_timedwait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001cc1ae5f4 dispatch_sema4_timedwait + 64 (lock.c:154)
2 libdispatch.dylib 0x00000001cc1aebf4 dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3 libswiftDispatch.dylib 0x00000001cd38795c OS_dispatch_semaphore.wait(wallTimeout:) + 24 (Dispatch.swift:189)
4 [redacted] 0x0000000100f18e58 GroupMembershipNetworkCall.execute() + 1744 (GroupMembershipNetworkCall.swift:45)
5 [redacted] 0x000000010100faa0 specialized AbstractNetworkCall.executeCall() + 1981088 (AbstractNetworkCall.swift:89)
6 [redacted] 0x0000000100f4da34 RuleQuestionInitialState.processAlarm(alarmCode:caller:) + 712 (RuleQuestionInitialState.swift:56)
7 [redacted] 0x0000000101024578 closure #1 in AbstractState.handleIntent(intent:caller:) + 2065784 (AbstractState.swift:56)
8 [redacted] 0x0000000100f2d2d8 specialized syncedMethod<A>(::) + 32 ([redacted]Sync.swift:17)
9 [redacted] 0x0000000100f2d2d8 AbstractState.handleIntent(intent:caller:) + 32 (AbstractState.swift:47)
10 [redacted] 0x0000000100f2d2d8 AbstractStatefulService.handleIntent(intent:alarmID_toCancel:) + 392 (AbstractStatefulService.swift:175)
11 [redacted] 0x0000000100f2c158 AbstractStatefulService.onHandleIntent(intent:alarmID_toCancel:) + 1048920 (AbstractStatefulService.swift:109)
12 [redacted] 0x0000000100f2e5b0 partial apply for closure #1 in AbstractStatefulService.onStartCommand(intent:alarmID_toCancel:) + 1058224 (
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x00000002017d1ac4 semaphore_wait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001cc1ae578 _dispatch_sema4_wait + 28 (lock.c:139)
2 libdispatch.dylib 0x00000001cc1aec2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3 libswiftDispatch.dylib 0x00000001cd38795c OS_dispatch_semaphore.wait(wallTimeout:) + 24 (Dispatch.swift:189)
4 [redacted] 0x0000000100fe3bdc Scheduler.run_realTimeAsync(speed:) + 1801180 (Scheduler.swift:334)
5 [redacted] 0x0000000100fe4f44 protocol witness for IScheduler.run_realTimeAsync(speed:) in conformance Scheduler + 20 (
Thread 6 name: Thread 6: 0 libsystem_kernel.dylib 0x00000002017d1b48 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000002017e4008 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000002017e4248 mach_msg_overwrite + 388 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000002017d208c mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001c4c4eaf0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x00000001c4c4fd34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005) 6 CoreFoundation 0x00000001c4c54ed4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 Foundation 0x00000001beff6334 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373) 8 Foundation 0x00000001beff621c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420) 9 UIKitCore 0x00000001c726833c -[UIEventFetcher threadMain] + 436 (UIEventFetcher.m:1377) 10 Foundation 0x00000001bf00f808 NSThread__start + 716 (NSThread.m:963) 11 libsystem_pthread.dylib 0x0000000211c346cc _pthread_start + 148 (pthread.c:893) 12 libsystem_pthread.dylib 0x0000000211c33ba4 thread_start + 8 (:-1)
Thread 7: 0 libsystem_kernel.dylib 0x00000002017d2008 __semwait_signal + 8 (:-1) 1 libsystem_c.dylib 0x00000001cc1f67d8 nanosleep + 220 (nanosleep.c:104) 2 libsystem_c.dylib 0x00000001cc20aad8 sleep + 52 (sleep.c:62) 3 BugfenderSDK 0x0000000101845fe4 monitorCachedData + 600 4 libsystem_pthread.dylib 0x0000000211c346cc _pthread_start + 148 (pthread.c:893) 5 libsystem_pthread.dylib 0x0000000211c33ba4 thread_start + 8 (:-1)
Thread 8 name: Thread 8: 0 libsystem_kernel.dylib 0x00000002017d1b48 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000002017e4008 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000002017e4248 mach_msg_overwrite + 388 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000002017d208c mach_msg + 24 (mach_msg.c:323) 4 BugfenderSDK 0x0000000101850f90 handleExceptions + 164 5 libsystem_pthread.dylib 0x0000000211c346cc _pthread_start + 148 (pthread.c:893) 6 libsystem_pthread.dylib 0x0000000211c33ba4 thread_start + 8 (:-1)
Thread 9 name: Thread 9: 0 libsystem_kernel.dylib 0x00000002017d1b48 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000002017e4008 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000002017e4248 mach_msg_overwrite + 388 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000002017d208c mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001c4c4eaf0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x00000001c4c4fd34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005) 6 CoreFoundation 0x00000001c4c54ed4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 CFNetwork 0x00000001c5fac5a8 +[__CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1372) 8 Foundation 0x00000001bf00f808 NSThread__start + 716 (NSThread.m:963) 9 libsystem_pthread.dylib 0x0000000211c346cc _pthread_start + 148 (pthread.c:893) 10 libsystem_pthread.dylib 0x0000000211c33ba4 thread_start + 8 (:-1)
Thread 10 name:
Thread 10:
0 libsystem_kernel.dylib 0x00000002017d1ac4 semaphore_wait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001cc1ae578 _dispatch_sema4_wait + 28 (lock.c:139)
2 libdispatch.dylib 0x00000001cc1aec2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3 libswiftDispatch.dylib 0x00000001cd38795c OS_dispatch_semaphore.wait(wallTimeout:) + 24 (Dispatch.swift:189)
4 [redacted] 0x0000000100ec1e78 closure #1 in [redacted]ExecutorService.init(serviceName:queueSize:) + 614008 ([redacted]ExecutorService.swift:27)
5 [redacted] 0x0000000100f87948 thunk for @escaping @callee_guaranteed () -> () + 28 (
Thread 11: 0 libsystem_pthread.dylib 0x0000000211c33b90 start_wqthread + 0 (:-1)
Thread 12 name: Thread 12: 0 libsystem_kernel.dylib 0x00000002017d1ac4 semaphore_wait_trap + 8 (:-1) 1 libdispatch.dylib 0x00000001cc1ae578 _dispatch_sema4_wait + 28 (lock.c:139) 2 libdispatch.dylib 0x00000001cc1aec2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132) 3 BugfenderSDK 0x000000010185445c -[BFStorageItem bf_sendSessionWithError:] + 256 4 BugfenderSDK 0x00000001018540c4 __41-[BFStorageItem sendWithCompletionBlock:]_block_invoke + 80 5 Foundation 0x00000001bf05b2f0 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 24 (NSOperation.m:1545) 6 Foundation 0x00000001bf02f4a0 -[NSBlockOperation main] + 104 (NSOperation.m:1564) 7 Foundation 0x00000001bf02f430 NSOPERATION_IS_INVOKING_MAIN + 16 (NSOperation.m:2189) 8 Foundation 0x00000001beff07d8 -[NSOperation start] + 708 (NSOperation.m:2206) 9 Foundation 0x00000001beff050c NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION + 16 (NSOperation.m:2220) 10 Foundation 0x00000001beff5c20 __NSOQSchedule_f + 172 (NSOperation.m:2231) 11 libdispatch.dylib 0x00000001cc1bd114 _dispatch_block_async_invoke2 + 148 (queue.c:555) 12 libdispatch.dylib 0x00000001cc1adfdc _dispatch_client_callout + 20 (object.m:560) 13 libdispatch.dylib 0x00000001cc1b146c _dispatch_continuation_pop + 504 (inline_internal.h:2632) 14 libdispatch.dylib 0x00000001cc1b0ad4 _dispatch_async_redirect_invoke + 584 (queue.c:830) 15 libdispatch.dylib 0x00000001cc1bfa6c _dispatch_root_queue_drain + 396 (inline_internal.h:0) 16 libdispatch.dylib 0x00000001cc1c0284 _dispatch_worker_thread2 + 164 (queue.c:7052) 17 libsystem_pthread.dylib 0x0000000211c33dbc _pthread_wqthread + 228 (pthread.c:2631) 18 libsystem_pthread.dylib 0x0000000211c33b98 start_wqthread + 8 (:-1)
Thread 13 name:
Thread 13:
0 [redacted] 0x00000001010513e0 @objc ConcreteBLEReceiver.centralManagerDidUpdateState(_:) + 0 (
Thread 14 name: Thread 14: 0 Foundation 0x00000001bf8dfea0 objc_msgSend$_allocWithExtraBytes: + 0 1 Foundation 0x00000001bf0051e0 -[_NSPlaceholderData initWithBytes:length:copy:deallocator:] + 76 (NSData.m:209) 2 Foundation 0x00000001bf004d10 +[NSData(NSData) dataWithBytes:length:] + 40 (NSData.m:732) 3 LocationSupport 0x00000001dfd8cc74 CLConnectionMessage::getObjectOfClasses(NSSet*) const + 96 (CLConnection.mm:782) 4 CoreLocation 0x00000001d0554cfc ___ZL25_CLClientCreateConnectionP10__CLClient_block_invoke + 212 (CLClient.mm:1325) 5 LocationSupport 0x00000001dfd95064 ___ZN18CLConnectionClient24setDefaultMessageHandlerEU13block_pointerFvNSt3__110shared_ptrI19CLConnectionMessageEEE_block_invoke_2 + 68 (CLConnectionClient.mm:438) 6 LocationSupport 0x00000001dfda0774 ___ZN18CLConnectionClient24setDefaultMessageHandlerEU13block_pointerFvNSt3__110shared_ptrI19CLConnectionMessageEEE_block_invoke + 152 (CLCallbackDropManager.h:46) 7 LocationSupport 0x00000001dfd8fc1c CLConnection::handleMessage(std::__1::shared_ptr<CLConnectionMessage>) + 512 (CLConnection.mm:317) 8 LocationSupport 0x00000001dfd8c7e8 ___ZN12CLConnection23initializeConnection_nlEv_block_invoke + 56 (CLConnection.mm:271) 9 LocationSupport 0x00000001dfd8d7d4 ___ZL15setEventHandlerPU24objcproto13OS_xpc_object8NSObjectU13block_pointerFvNSt3__110shared_ptrI19CLConnectionMessageEEEU13block_pointerFvvES9_PS9_NS3_I28CLConnectionEntitlementCacheEE_block_invoke + 448 (CLConnection.mm:435) 10 libxpc.dylib 0x0000000211c88bc0 _xpc_connection_call_event_handler + 152 (connection.c:834) 11 libxpc.dylib 0x0000000211c88ff0 _xpc_connection_mach_event + 992 (connection.c:1445) 12 libdispatch.dylib 0x00000001cc1ae09c _dispatch_client_callout4 + 20 (object.m:600) 13 libdispatch.dylib 0x00000001cc1ca830 _dispatch_mach_msg_invoke + 468 (mach.c:2462) 14 libdispatch.dylib 0x00000001cc1b556c _dispatch_lane_serial_drain + 376 (inline_internal.h:0) 15 libdispatch.dylib 0x00000001cc1cb54c _dispatch_mach_invoke + 448 (mach.c:2784) 16 libdispatch.dylib 0x00000001cc1b556c _dispatch_lane_serial_drain + 376 (inline_internal.h:0) 17 libdispatch.dylib 0x00000001cc1b61e0 _dispatch_lane_invoke + 384 (queue.c:3940) 18 libdispatch.dylib 0x00000001cc1c0e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846) 19 libsystem_pthread.dylib 0x0000000211c33df8 _pthread_wqthread + 288 (pthread.c:2618) 20 libsystem_pthread.dylib 0x0000000211c33b98 start_wqthread + 8 (:-1)
Thread 15: 0 libsystem_pthread.dylib 0x0000000211c33b90 start_wqthread + 0 (:-1)
Thread 16: 0 libsystem_pthread.dylib 0x0000000211c33b90 start_wqthread + 0 (:-1)
Thread 3 crashed with ARM Thread State (64-bit): x0: 0x019ffe8000000000 x1: 0x00000001c04298de x2: 0x000000021b240580 x3: 0x059ffe8000000000 x4: 0x0000000280440d38 x5: 0x0000000000000280 x6: 0x0000000000000000 x7: 0x000000021bb80e30 x8: 0x019ffe8000000000 x9: 0x0000000000000003 x10: 0x0000000222fdfb60 x11: 0x000000000000000f x12: 0x0000000000280400 x13: 0x000000028243d5c8 x14: 0x000000021b240580 x15: 0x000000021b240580 x16: 0x000000021b240580 x17: 0x00000001cc1ad828 x18: 0x0000000000000000 x19: 0x0000000280440d00 x20: 0x0000000280440d00 x21: 0x0000000282a35380 x22: 0x0000000125e9da40 x23: 0x00000000000000b0 x24: 0x000000021d9704a0 x25: 0x000000016f1720d0 x26: 0x000000016f1720c0 x27: 0x000000021c5dcbc8 x28: 0x000000028117fb50 fp: 0x000000016f172030 lr: 0x00000001cc1b4644 sp: 0x000000016f172030 pc: 0x00000001cc1e4ebc cpsr: 0x1000 esr: 0xf2000001 (Breakpoint) brk 1
Binary Images:
0x100e2c000 - 0x101237fff [redacted] arm64 <67d6786b26d93d8493f23c9c70014be3> /private/var/containers/Bundle/Application/416F98AB-E681-4CA3-A161-ED79C7EC6755/[redacted].app/[redacted]
0x10180c000 - 0x101877fff BugfenderSDK arm64 <16e5974c3be337c388544182b4e94491> /private/var/containers/Bundle/Application/416F98AB-E681-4CA3-A161-ED79C7EC6755/[redacted].app/Frameworks/BugfenderSDK.framework/BugfenderSDK
0x1befb4000 - 0x1bf8fdfff Foundation arm64e
EOF