I have an app which is Live on Appstore and has several daily active users. Recently a user reported consistent crash at random sports on her device. After communicating with the user, I got that the crash from her iPad mini 2 with iOS 12.4.8 and the stack trace has following information:
After symbolicate the log:Thread 0 name: Dispatch queue: org.reactivecocoa.ReactiveObjC.RACScheduler.mainThreadScheduler
Thread 0 Crashed:
0 libsystem_platform.dylib 0x0000000194547258 os_unfair_lock_lock$VARIANT$mp (in libsystem_platform.dylib) + 24
1 CoreFoundation 0x0000000194903190 __CFGetConverter (in CoreFoundation) + 92
2 CoreFoundation 0x0000000194902960 CFStringEncodingUnicodeToBytes (in CoreFoundation) + 180
3 CoreFoundation 0x0000000194905d78 __CFStringEncodeByteStream (in CoreFoundation) + 1604
4 Foundation 0x00000001952953d4 -[NSString(NSStringOtherEncodings) getBytes:maxLength:usedLength:encoding:options:range:remainingRange:] (in Foundation) + 248
5 CoreFoundation 0x000000019482de84 -[NSTaggedPointerString getBytes:maxLength:usedLength:encoding:options:range:remainingRange:] (in CoreFoundation) + 120
6 CoreFoundation 0x00000001948eb958 CFStringGetBytes (in CoreFoundation) + 144
7 Foundation 0x00000001954415ac _convertJSONString (in Foundation) + 416
8 Foundation 0x000000019544074c _writeJSONString (in Foundation) + 92
9 Foundation 0x00000001954418e0 ___writeJSONObject_block_invoke (in Foundation) + 80
10 libswiftCore.dylib 0x00000001c1f199f0 specialized _SwiftDeferredNSDictionary.enumerateKeysAndObjects(options:using:) (in libswiftCore.dylib) + 852
11 libswiftCore.dylib 0x00000001c1d6776c @objc _SwiftDeferredNSDictionary.enumerateKeysAndObjects(options:using:) (in libswiftCore.dylib) + 44
12 Foundation 0x0000000195440f20 _writeJSONObject (in Foundation) + 384
13 Foundation 0x0000000195441b84 ___writeJSONArray_block_invoke (in Foundation) + 156
14 CoreFoundation 0x0000000194919944 __NSArrayEnumerate (in CoreFoundation) + 412
15 Foundation 0x000000019544133c _writeJSONArray (in Foundation) + 288
16 Foundation 0x00000001952fd58c -[_NSJSONWriter dataWithRootObject:options:error:] (in Foundation) + 140
17 Foundation 0x00000001952fd2b4 +[NSJSONSerialization dataWithJSONObject:options:error:] (in Foundation) + 356
18 ??? 0x00000001035737b8 static Mapper.toJSONData(_:options:) (in --) (Mapper.swift:388)
19 ??? 0x00000001035736a4 static Mapper.toJSONString(_:prettyPrint:) (in --) (<compiler-generated>:0)
20 ??? 0x0000000103570e38 Mapper.toJSONString(_:prettyPrint:) (in --) (Mapper.swift:370)
21 ??? 0x000000010356eb94 Array<A>.toJSONString(prettyPrint:) (in --) (Mappable.swift:104)
The logic is to dump an array to a file. Can anyone suggest what could be the possible issue here?