Utilities.urlEncoded in the iOS library

We’re getting a crash in Utilities.urlEncoded(_:slight_smile: in the SnowplowTracker iOS library. Using 6.0.8, but I don’t see anything related in fixes for 6.0.9 or 6.1.0.

Has this happened to anyone else? It specifically happens when addingPercentEncoding(withAllowedCharacters:). I’ve tried to break that Core Foundation method will all kinds of characters or a empty string, but I can’t make it happen, yet the crash is real.

Can anyone help?

The addingPercentEncoding should be returning nil (or in our case the original string based on the urlEncode function rather than crashing.

I don’t support you have a stack trace or crash log that might be able to help?

Hi Mike. Can’t seem to attach the crash log here. And it’s reading the copy paste as containing more than 2 links, even though there are none, and not allowing it as I’m a new user.

This from the NSStringAPI file in Swift Foundation, which is called 2 steps before the crash in the crash report:
/// Returns a new string created by replacing all characters in the string
/// not in the specified set with percent encoded characters.
public func addingPercentEncoding(
withAllowedCharacters allowedCharacters: CharacterSet
) → String? {
// FIXME: the documentation states that this method can return nil if the
// transformation is not possible, without going into further details. The
// implementation can only return nil if malloc() returns nil, so in
// practice this is not possible. Still, to be consistent with
// documentation, we declare the method as returning an optional String.
//
// rdar://problem/17901698 Docs for -[NSString
// stringByAddingPercentEncodingWithAllowedCharacters] don’t precisely
// describe when return value is nil
return _ns.addingPercentEncoding(withAllowedCharacters:
allowedCharacters
)
}

I’ve bumped your trust level (it’s just there to prevent spam) which should hopefully unblock you from posting that now.

Thanks. Attaching the crash report below. All crashes come from users running iOS 18.1.1, but that needn’t be relevant. There are only 21 reports across 6 users. Seems perhaps they have a memory issue on their device, malloc() returns NULL, but that fails to become a nil return from the method.

Distributor ID: com.apple.AppStore
Hardware Model: iPhone16,2
AppStoreTools: 16C5031b
AppVariant: 1:iPhone16,2:18
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]]

Date/Time: 2025-01-16 02:24:48.8735 +0100
Launch Time: 2025-01-16 01:37:36.6761 +0100
OS Version: iPhone OS 18.1.1 (22B91)
Release Type: User
Baseband Version: 2.20.03
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region. Bytes before following region: 4345217024
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
—>
__TEXT 102fec000-102ff0000 [ 16K] r-x/r-x SM=COW /var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Casino
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [3287]

Triggered by Thread: 5

Thread 0:
0 libswiftCore.dylib 0x000000019814edf4 print_unlocked<A, B>(::slight_smile: + 540 (:0)
1 Casino 0x000000010310b420 AccessibilityIdentifying.identifier.getter + 108 (AccessibilityIdentifying.swift:12)
2 Casino 0x00000001036faf44 protocol witness for AccessibilityIdentifying.identifier.getter in conformance LimitsView.LimitViewIdentifier + 24 (:0)
3 Casino 0x00000001036faf44 specialized View.accessibilityIdentifier(
:slight_smile: + 64 (LimitsView.swift:95)
4 Casino 0x00000001036faf44 closure #1 in closure #1 in LimitsView.header.getter + 716
5 Casino 0x00000001036fab70 specialized HStack.init(alignment:spacing:content:) + 28 (:0)
6 Casino 0x00000001036fab70 closure #1 in LimitsView.header.getter + 312
7 SwiftUICore 0x00000002598160c4 closure #1 in VStack.init(alignment:spacing:content:) + 196 (VStack.swift:58)
8 SwiftUICore 0x0000000259af31a0 VariadicView.Tree.init(:content:) + 256 (VariadicView.swift:69)
9 SwiftUICore 0x0000000259815ff4 VStack.init(alignment:spacing:content:) + 92 (VStack.swift:55)
10 Casino 0x00000001036f8af8 LimitsView.header.getter + 92 (LimitsView.swift:82)
11 Casino 0x00000001036f8af8 closure #1 in LimitsView.body.getter + 468 (LimitsView.swift:24)
12 Casino 0x00000001036f8718 specialized VStack.init(alignment:spacing:content:) + 28 (:0)
13 Casino 0x00000001036f8718 LimitsView.body.getter + 264
14 SwiftUICore 0x0000000259a036dc specialized ViewBodyAccessor.updateBody(of:changed:) + 1240 (CustomView.swift:69)
15 SwiftUICore 0x0000000259b0fdac closure #1 in DynamicBody.updateValue() + 600 (DynamicProperty.swift:474)
16 SwiftUICore 0x0000000259b0f7c0 DynamicBody.updateValue() + 928 (DynamicProperty.swift:466)
17 SwiftUICore 0x0000000259bafcc0 partial apply for implicit closure #1 in closure #1 in closure #1 in Attribute.init(_:slight_smile: + 32 (:0)
18 AttributeGraph 0x00000001c5d1050c AG::Graph::UpdateStack::update() + 540 (ag-graph-update.cc:583)
19 AttributeGraph 0x00000001c5d100d0 AG::Graph::update_attribute(AG::data::ptr
AG::Node, unsigned int) + 424 (ag-graph-update.cc:712)
20 AttributeGraph 0x00000001c5d0fca4 AG::Subgraph::update(unsigned int) + 848 (ag-subgraph.cc:758)
21 SwiftUICore 0x0000000259cf6a58 GraphHost.flushTransactions() + 860 (GraphHost.swift:646)
22 SwiftUI 0x000000019e453478 closure #1 in _UIHostingView._renderForTest(interval:) + 24 (_UIHostingView.swift:368)
23 SwiftUICore 0x000000025a0954fc partial apply for closure #1 in ViewGraphDelegate.updateGraph(body:) + 28 (:0)
24 SwiftUICore 0x000000025a0795d8 ViewRendererHost.updateViewGraph
(body:) + 120 (ViewRendererHost.swift:102)
25 SwiftUICore 0x000000025a07f3ec ViewGraphDelegate.updateGraph
(body:) + 84 (ViewGraph.swift:28)
26 SwiftUI 0x000000019e453444 closure #1 in closure #1 in closure #1 in _UIHostingView.beginTransaction() + 172 (UIHostingView.swift:368)
27 SwiftUI 0x000000019e45bddc partial apply for closure #1 in closure #1 in closure #1 in UIHostingView.beginTransaction() + 24 (:0)
28 SwiftUICore 0x0000000259b13fd0 closure #1 in static Update.ensure
(:slight_smile: + 56 (Update.swift:165)
29 SwiftUICore 0x0000000259b12dd4 static Update.ensure
(
:slight_smile: + 100 (Update.swift:162)
30 SwiftUI 0x000000019e45bdb4 partial apply for closure #1 in closure #1 in UIHostingView.beginTransaction() + 80 (:0)
31 SwiftUICore 0x0000000259b12ed4 thunk for @callee_guaranteed () → () + 28 (:0)
32 SwiftUICore 0x000000025a007e0c specialized closure #1 in static NSRunLoop.addObserver(
:slight_smile: + 144 (RunLoopUtils.swift:21)
33 CoreFoundation 0x0000000199a5a1f4 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 36 (CFRunLoop.c:1802)
34 CoreFoundation 0x0000000199a59f98 __CFRunLoopDoObservers + 552 (CFRunLoop.c:1915)
35 CoreFoundation 0x0000000199a89028 __CFRunLoopRun + 948 (CFRunLoop.c:2997)
36 CoreFoundation 0x0000000199a88830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
37 GraphicsServices 0x00000001e5a681c4 GSEventRunModal + 164 (GSEvent.c:2196)
38 UIKitCore 0x000000019c5eeeb0 -[UIApplication _run] + 816 (UIApplication.m:3844)
39 UIKitCore 0x000000019c69d5b4 UIApplicationMain + 340 (UIApplication.m:5496)
40 Casino 0x0000000102ff0a14 main + 68 (AppDelegate.swift:11)
41 dyld 0x00000001bf476ec8 start + 2724 (dyldMain.cpp:1334)

Thread 1:
0 libsystem_kernel.dylib 0x00000001e9e4a688 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001e9e4dd98 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001e9e4dcb0 mach_msg_overwrite + 424 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001e9e4dafc mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x0000000199a89a84 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2637)
5 CoreFoundation 0x0000000199a89130 __CFRunLoopRun + 1212 (CFRunLoop.c:3021)
6 CoreFoundation 0x0000000199a88830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
7 Foundation 0x0000000198730500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8 Foundation 0x0000000198730350 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9 UIKitCore 0x000000019c602358 -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1241)
10 Foundation 0x00000001987416c8 NSThread__start + 724 (NSThread.m:991)
11 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
12 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 2:
0 libsystem_kernel.dylib 0x00000001e9e4a688 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001e9e4dd98 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001e9e4dcb0 mach_msg_overwrite + 424 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001e9e4dafc mach_msg + 24 (mach_msg.c:323)
4 Casino 0x0000000103d4d11c exception_server_thread + 188 (PLCrashMachExceptionServer.m:681)
5 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
6 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 3:
0 libsystem_kernel.dylib 0x00000001e9e4ff90 __psynch_cvwait + 8 (:-1)
1 libsystem_pthread.dylib 0x0000000221fbea50 _pthread_cond_wait + 1204 (pthread_cond.c:862)
2 JavaScriptCore 0x00000001b17fabe0 0x1b0254000 + 22703072
3 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
4 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 4:
0 libsystem_kernel.dylib 0x00000001e9e4a688 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001e9e4dd98 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001e9e4dcb0 mach_msg_overwrite + 424 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001e9e4dafc mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x0000000199a89a84 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2637)
5 CoreFoundation 0x0000000199a89130 __CFRunLoopRun + 1212 (CFRunLoop.c:3021)
6 CoreFoundation 0x0000000199a88830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
7 CFNetwork 0x000000019b004ee0 +[__CFN_CoreSchedulingSetRunnable _run:] + 416 (CoreSchedulingSet.mm:1473)
8 Foundation 0x00000001987416c8 NSThread__start + 724 (NSThread.m:991)
9 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
10 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 5 Crashed:
0 CoreFoundation 0x0000000199a78a44 CFStringCreateByAddingPercentEncodingWithAllowedCharacters + 512 (CFURLComponents_URIParser.c:0)
1 Foundation 0x0000000198713298 -[NSString(NSURLUtilities) stringByAddingPercentEncodingWithAllowedCharacters:] + 32 (NSURL.m:1882)
2 Foundation 0x0000000198d08da4 closure #1 in StringProtocol.addingPercentEncoding(withAllowedCharacters:) + 92 (NSStringAPI.swift:854)
3 Foundation 0x0000000198d0aaf0 partial apply for closure #1 in StringProtocol.addingPercentEncoding(withAllowedCharacters:) + 24 (:0)
4 Foundation 0x0000000198d077d0 specialized CharacterSet.withUnsafeImmutableStorage
(:slight_smile: + 64 (CharacterSet.swift:0)
5 Foundation 0x0000000198713268 StringProtocol.addingPercentEncoding(withAllowedCharacters:) + 68 (NSStringAPI.swift:853)
6 Casino 0x000000010326b86c static Utilities.urlEncode(:slight_smile: + 56 (Utilities.swift:137)
7 Casino 0x000000010326b86c specialized closure #1 in static Utilities.urlEncode(
:slight_smile: + 368 (Utilities.swift:128)
8 Casino 0x00000001032c9434 specialized thunk for @callee_guaranteed (@guaranteed String, @in_guaranteed Any) → (@owned String, @error @owned Error) + 12 (:0)
9 Casino 0x00000001032c9434 specialized Collection.map
(:slight_smile: + 360
10 Casino 0x00000001032cc6a0 static Utilities.urlEncode(
:slight_smile: + 12 (Utilities.swift:127)
11 Casino 0x00000001032cc6a0 DefaultNetworkConnection.buildGet(:slight_smile: + 504 (DefaultNetworkConnection.swift:246)
12 Casino 0x00000001032cce30 closure #1 in DefaultNetworkConnection.sendRequests(
:slight_smile: + 44 (DefaultNetworkConnection.swift:121)
13 Casino 0x00000001032cce30 specialized Collection.map
(:slight_smile: + 276 (:0)
14 Casino 0x00000001032caa8c specialized Collection.map
(:slight_smile: + 16 (:0)
15 Casino 0x00000001032caa8c DefaultNetworkConnection.sendRequests(:slight_smile: + 240 (DefaultNetworkConnection.swift:121)
16 Casino 0x00000001032cb194 @objc DefaultNetworkConnection.sendRequests(
:slight_smile: + 68 (:0)
17 Casino 0x0000000103222a88 closure #2 in Emitter.attemptEmit() + 76 (Emitter.swift:380)
18 Casino 0x00000001032c92bc thunk for @escaping @callee_guaranteed @Sendable () → () + 28 (:0)
19 libdispatch.dylib 0x00000001a178c370 _dispatch_call_block_and_release + 32 (init.c:1549)
20 libdispatch.dylib 0x00000001a178e0d0 _dispatch_client_callout + 20 (object.m:576)
21 libdispatch.dylib 0x00000001a17956d8 _dispatch_lane_serial_drain + 744 (queue.c:3934)
22 libdispatch.dylib 0x00000001a17961e0 _dispatch_lane_invoke + 380 (queue.c:4025)
23 libdispatch.dylib 0x00000001a17a1258 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:7193)
24 libdispatch.dylib 0x00000001a17a0aa4 _dispatch_workloop_worker_thread + 540 (queue.c:6787)
25 libsystem_pthread.dylib 0x0000000221fbfc7c _pthread_wqthread + 288 (pthread.c:2696)
26 libsystem_pthread.dylib 0x0000000221fbc488 start_wqthread + 8 (:-1)

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

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

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

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

Thread 10:
0 libsystem_pthread.dylib 0x0000000221fbc480 start_wqthread + 0 (:-1)

Thread 11:
0 libsystem_kernel.dylib 0x00000001e9e4a61c semaphore_timedwait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001a178e6e8 _dispatch_sema4_timedwait + 64 (lock.c:154)
2 libdispatch.dylib 0x00000001a178ece8 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3 libdispatch.dylib 0x00000001a179fb60 _dispatch_worker_thread + 324 (queue.c:7509)
4 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
5 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 12:
0 libsystem_kernel.dylib 0x00000001e9e4a61c semaphore_timedwait_trap + 8 (:-1)
1 libdispatch.dylib 0x00000001a178e6e8 _dispatch_sema4_timedwait + 64 (lock.c:154)
2 libdispatch.dylib 0x00000001a178ece8 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3 libdispatch.dylib 0x00000001a179fb60 _dispatch_worker_thread + 324 (queue.c:7509)
4 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
5 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 13:
0 libsystem_kernel.dylib 0x00000001e9e4a688 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001e9e4dd98 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001e9e4dcb0 mach_msg_overwrite + 424 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001e9e4dafc mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x0000000199a89a84 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2637)
5 CoreFoundation 0x0000000199a89130 __CFRunLoopRun + 1212 (CFRunLoop.c:3021)
6 CoreFoundation 0x0000000199a88830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
7 Foundation 0x0000000198730500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8 Foundation 0x00000001987303d4 -[NSRunLoop(NSRunLoop) run] + 64 (NSRunLoop.m:398)
9 SwiftUI 0x000000019e9e51f4 specialized static DisplayLink.asyncThread(arg:) + 792 (UIHostingViewBase.swift:1382)
10 SwiftUI 0x000000019e9e4558 @objc static DisplayLink.asyncThread(arg:) + 72 (:1364)
11 Foundation 0x00000001987416c8 NSThread__start + 724 (NSThread.m:991)
12 libsystem_pthread.dylib 0x0000000221fc137c _pthread_start + 136 (pthread.c:931)
13 libsystem_pthread.dylib 0x0000000221fbc494 thread_start + 8 (:-1)

Thread 14:
0 libsystem_malloc.dylib 0x00000001a9ce26c0 _nanov2_free + 660 (nanov2_malloc.c:1198)
1 libswiftCore.dylib 0x000000019843883c _swift_release_dealloc + 56 (HeapObject.cpp:847)
2 libswiftCore.dylib 0x0000000198439950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 (RefCount.h:0)
3 CoreFoundation 0x0000000199a41f18 __CFBasicHashDrain + 404 (CFBasicHash.c:1150)
4 CoreFoundation 0x0000000199a3d30c _CFRelease + 292 (CFRuntime.c:2169)
5 Foundation 0x00000001986a1dac _NSXPCSerializationCreateWriteData + 60 (NSXPCCoder_Serialization.m:272)
6 Foundation 0x00000001986a1cb4 -[NSXPCEncoder _encodeInvocationObjectArgumentsOnly:count:typeString:selector:isReply:into:] + 236 (NSXPCCoder.m:532)
7 Foundation 0x00000001986d675c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 1208 (NSXPCConnection.m:1522)
8 Foundation 0x000000019873d0c4 -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:arg3:arg4:] + 144 (NSXPCConnection.m:1315)
9 Foundation 0x000000019873cfdc _NSXPCDistantObjectSimpleMessageSend4 + 84 (NSXPCDistantObject.m:292)
10 CoreTelephony 0x000000019b2d4d70 -[CoreTelephonyClient(CarrierBundle) copyCarrierBundleValue:key:bundleType:error:] + 392 (CoreTelephonyClient+CarrierBundle.mm:72)
11 CoreTelephony 0x000000019b2d4054 -[CTTelephonyNetworkInfo getCarrierName:forContext:withError:] + 120 (CTTelephonyNetworkInfo.mm:315)
12 CoreTelephony 0x000000019b2d33e4 -[CTTelephonyNetworkInfo updateNetworkInfoAndShouldNotifyClient:forContext:] + 164 (CTTelephonyNetworkInfo.mm:452)
13 CoreTelephony 0x000000019b2d2d68 -[CTTelephonyNetworkInfo initWithClient:] + 528 (CTTelephonyNetworkInfo.mm:236)
14 CoreTelephony 0x000000019b2cbfe4 -[CTTelephonyNetworkInfo init] + 96 (CTTelephonyNetworkInfo.mm:205)
15 Casino 0x00000001030a3c48 @nonobjc CTTelephonyNetworkInfo.init() + 12 (:0)
16 Casino 0x00000001030a3c48 CTTelephonyNetworkInfo.__allocating_init() + 24 (CTTelephonyNetworkInfo.swift:10)
17 Casino 0x00000001030a3c48 CTTelephonyNetworkInfo.carrierTypeName.getter + 24 (:0)
18 Casino 0x00000001030a3c48 protocol witness for CTTelephonyNetworkInfoProtocol.carrierTypeName.getter in conformance CTTelephonyNetworkInfo + 40
19 Casino 0x00000001030d4798 ReachabilityProviding.connectionType.getter + 336 (ReachabilityProviding.swift:38)
20 Casino 0x00000001030e1b20 SplunkReportRequestBuilder.makeClientMetadata(context:) + 12 (SplunkReportRequestBuilder.swift:62)
21 Casino 0x00000001030e1b20 SplunkReportRequestBuilder.makeEventRequest(events:) + 360 (SplunkReportRequestBuilder.swift:19)
22 Casino 0x00000001030f4774 SplunkManager.submitEvents(customerId:username:events:completionHandler:) + 392 (SplunkManager.swift:16)
23 Casino 0x00000001030ed2f0 closure #1 in Splunk.submit(customerId:username:events:completionHandler:) + 280 (Splunk.swift:132)
24 Casino 0x00000001030ecf94 thunk for @escaping @callee_guaranteed @Sendable () → () + 28
25 libdispatch.dylib 0x00000001a178c370 _dispatch_call_block_and_release + 32 (init.c:1549)
26 libdispatch.dylib 0x00000001a178e0d0 _dispatch_client_callout + 20 (object.m:576)
27 libdispatch.dylib 0x00000001a17956d8 _dispatch_lane_serial_drain + 744 (queue.c:3934)
28 libdispatch.dylib 0x00000001a17961e0 _dispatch_lane_invoke + 380 (queue.c:4025)
29 libdispatch.dylib 0x00000001a17a1258 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:7193)
30 libdispatch.dylib 0x00000001a17a0aa4 _dispatch_workloop_worker_thread + 540 (queue.c:6787)
31 libsystem_pthread.dylib 0x0000000221fbfc7c _pthread_wqthread + 288 (pthread.c:2696)
32 libsystem_pthread.dylib 0x0000000221fbc488 start_wqthread + 8 (:-1)

Thread 15:
0 libsystem_pthread.dylib 0x0000000221fbc480 start_wqthread + 0 (:-1)

Thread 5 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000bec x1: 0x00000001595a5c00 x2: 0x0000000000000bec x3: 0x0000000008000100
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x00000000000023c4
x8: 0x0000000000000bec x9: 0x0000000302f45110 x10: 0x0000000000000005 x11: 0x0000000000000000
x12: 0x0000000105cebff8 x13: 0x0000000000000000 x14: 0x01000001fd86c3c1 x15: 0x00000001fd86c3c0
x16: 0x0000000000000007 x17: 0x0000000199a3bed8 x18: 0x0000000000000000 x19: 0x0000000000008f10
x20: 0x0000000000000000 x21: 0x00000000000023c4 x22: 0x0000000302c50f60 x23: 0x0000000000000000
x24: 0x00000000000023c4 x25: 0x0000000000000025 x26: 0x0000000199ec855a x27: 0x00000001fef4f578
x28: 0x0000000104225710 fp: 0x00000003d5f6a100 lr: 0xf84b000199a789d4
sp: 0x00000003d5f6a090 pc: 0x0000000199a78a44 cpsr: 0x20001000
esr: 0x92000006 (Data Abort) byte read Translation fault

Binary Images:
0x102fec000 - 0x104577fff Casino arm64 /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Casino
0x104bc0000 - 0x104bfbfff FBAEMKit arm64 /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Frameworks/FBAEMKit.framework/FBAEMKit
0x104dc8000 - 0x104f8bfff Lottie arm64 <4c5219a480bf3b5fa4f4c38d50491047> /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Frameworks/Lottie.framework/Lottie
0x105038000 - 0x105167fff FBSDKCoreKit arm64 <7e56c1979bc63bc097b8e87abaabd89c> /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit
0x105378000 - 0x105387fff FBSDKCoreKit_Basics arm64 <6ed9543dd0003c65a476da0b5450fce2> /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Frameworks/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics
0x1053a0000 - 0x10543bfff OPPWAMobile arm64 /private/var/containers/Bundle/Application/17C03FC7-A322-4858-BE96-74E37D52D66C/Casino.app/Frameworks/OPPWAMobile.framework/OPPWAMobile
0x107df8000 - 0x107e03fff libobjc-trampolines.dylib arm64e <35a44678195b39c2bdd7072893564b45> /private/preboot/Cryptexes/OS/usr/lib/libobjc-trampolines.dylib
0x130fd8000 - 0x130fdbfff iCloudDriveFileProviderOverride arm64e <5de9ce32cd703abca0b951643ad20971> /System/Library/Frameworks/FileProvider.framework/OverrideBundles/iCloudDriveFileProviderOverride.bundle/iCloudDriveFileProviderOverride
0x131004000 - 0x13100bfff FileProviderOverride arm64e <664c9c68fd2032c39751b24182c710a7> /System/Library/Frameworks/FileProvider.framework/OverrideBundles/FileProviderOverride.bundle/FileProviderOverride
0x198061000 - 0x198602fff libswiftCore.dylib arm64e <1ae81ac9024c33c59e78ccfa639c5f06> /usr/lib/swift/libswiftCore.dylib
0x198679000 - 0x199386fff Foundation arm64e <6d0212cc3b9e32c9be2072989ce3acb8> /System/Library/Frameworks/Foundation.framework/Foundation
0x199a36000 - 0x199f78fff CoreFoundation arm64e <1532d3d89b3b3f2fb35f55a20ddf411b> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x19af07000 - 0x19b2c9fff CFNetwork arm64e <999c659afc7d351fa477e97bbf2d8081> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x19b2ca000 - 0x19b4e6fff CoreTelephony arm64e <57537ae194b5360ab85a2c416b65f22f> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x19c21c000 - 0x19e0effff UIKitCore arm64e <575e5140fa6a37c2b00ba4eacedfda53> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x19e0f0000 - 0x19f3e4fff SwiftUI arm64e <9f67c19cfcde3e979fc23bba36998297> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
0x1a178a000 - 0x1a17cffff libdispatch.dylib arm64e <7de7ec03cfb7349d9b9e8782b38f231d> /usr/lib/system/libdispatch.dylib
0x1a17d0000 - 0x1a184fff3 libsystem_c.dylib arm64e <0150f750db0a3f54b23ad21c55af8824> /usr/lib/system/libsystem_c.dylib
0x1a9cdf000 - 0x1a9d1aff7 libsystem_malloc.dylib arm64e <5dba2c0192ca3d1da27eb4e14cffb2f0> /usr/lib/system/libsystem_malloc.dylib
0x1b0254000 - 0x1b19d8fff JavaScriptCore arm64e /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
0x1bf443000 - 0x1bf4c699f dyld arm64e <3060d36a16ce3c3a92583881459f5714> /usr/lib/dyld
0x1c5d07000 - 0x1c5d4afff AttributeGraph arm64e <6dfbf865450c3897a13fc9a348db0267> /System/Library/PrivateFrameworks/AttributeGraph.framework/AttributeGraph
0x1e5a67000 - 0x1e5a6ffff GraphicsServices arm64e <8425ea11000e3e5e8abcbddf3ff3fa32> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1e9e49000 - 0x1e9e82ff3 libsystem_kernel.dylib arm64e /usr/lib/system/libsystem_kernel.dylib
0x221fbb000 - 0x221fc7ff3 libsystem_pthread.dylib arm64e <3ca98e388eee3c269862c5f66aad93c0> /usr/lib/system/libsystem_pthread.dylib
0x25966e000 - 0x25a1fcfff SwiftUICore arm64e /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore

EOF

Hi @jamie,

Thank you for the report, I just looked into this, but it seems a bit challenging to resolve as it is an exception produced in Foundation APIs and not something under our control.

We can’t really catch the exception as it is a low level memory access signal. As you suggested, it could relate to a memory issue, perhaps low memory on device.

We could consider using a different method for URL encoding in the tracker, perhaps one that is implemented in Swift rather than ObjC and more memory safe.

That would be a help for sure, but thanks for taking a look anyway.