CIFilter with CIQRCodeGenerator cause crash - ios

I'm trying to generate QR code with following code :
DispatchQueue.main.async {
let image = generateQRCode(from: qrCodeString)
}
func generateQRCode(from string: String?) -> UIImage? {
if let data = string?.data(using: .utf8, allowLossyConversion: false) {
if let filter = CIFilter(name: "CIQRCodeGenerator") {
filter.setValue(data, forKey: "inputMessage")
let transform = CGAffineTransform(scaleX: 5, y: 5)
if let output = filter.outputImage?.transformed(by: transform) {
return UIImage(ciImage: output)
}
}
}
return nil
}
This code works well for most devices/iOS version.
But firebase brings me a lot of device crashes: iPhone 11, XR. iOS 13.4.0
Crashed: com.apple.main-thread
0 CocoaDebug 0x1023a0adc perform_rebinding_with_section + 332
1 CocoaDebug 0x1023a087c rebind_symbols_for_image + 416
2 libdyld.dylib 0x1999c3f4c invocation function for block in dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 244
3 libdyld.dylib 0x1999c3768 dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 160
4 libdyld.dylib 0x1999c8dd8 dyld3::AllImages::loadImage(Diagnostics&, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool) + 580
5 libdyld.dylib 0x1999c89ec dyld3::AllImages::dlopen(Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*) + 868
6 libdyld.dylib 0x1999ca434 dyld3::dlopen_internal(char const*, int, void*) + 364
7 libdyld.dylib 0x1999bd6c0 dlopen + 116
8 CoreFoundation 0x199bcf5c8 _CFBundleDlfcnLoadBundle + 156
9 CoreFoundation 0x199af1eac _CFBundleLoadExecutableAndReturnError + 372
10 Foundation 0x199ec27a8 -[NSBundle loadAndReturnError:] + 316
11 CoreImage 0x19b479bcc invocation function for block in register_more_builtins(void (NSString*) block_pointer) + 804
12 libdispatch.dylib 0x19986833c _dispatch_client_callout + 20
13 libdispatch.dylib 0x199869a68 _dispatch_once_callout + 32
14 CoreImage 0x19b476318 register_more_builtins(void (NSString*) block_pointer) + 304
15 CoreImage 0x19b476b40 classNameIsSystemFilter(NSString*) + 112
16 CoreImage 0x19b476dbc +[CIFilter(CIFilterRegistryPrivate) filterWithName:setDefaults:] + 396
17 MYApp 0x100656598 QRCodeViewController.generateQRCode(from:) + 4370490776 (<compiler-generated>:4370490776)
18 MYApp 0x1006563a4 QRCodeViewController.viewDidLoad() + 28 (QRCodeViewController.swift:28)
19 MYApp 0x10065642c #objc QRCodeViewController.viewDidLoad() + 4370490412 (<compiler-generated>:4370490412)
20 UIKitCore 0x19d6a236c -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 104
21 UIKitCore 0x19d6a6f20 -[UIViewController loadViewIfRequired] + 952
22 UIKitCore 0x19d6a730c -[UIViewController view] + 32
23 UIKitCore 0x19d602fa4 -[UINavigationController _startCustomTransition:] + 1148
24 UIKitCore 0x19d617478 -[UINavigationController _startDeferredTransitionIfNeeded:] + 692
25 UIKitCore 0x19d618818 -[UINavigationController __viewWillLayoutSubviews] + 176
26 UIKitCore 0x19d5fb4fc -[UILayoutContainerView layoutSubviews] + 228
27 UIKitCore 0x19e1de6a0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2168
28 QuartzCore 0x1a08314a0 -[CALayer layoutSublayers] + 292
29 QuartzCore 0x1a08318e0 CA::Layer::layout_if_needed(CA::Transaction*) + 472
30 QuartzCore 0x1a0843dc4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
31 QuartzCore 0x1a0788884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
32 QuartzCore 0x1a07b33d0 CA::Transaction::commit() + 656
33 QuartzCore 0x1a07b3fc8 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 96
34 CoreFoundation 0x199b42c54 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
35 CoreFoundation 0x199b3d8e4 __CFRunLoopDoObservers + 420
36 CoreFoundation 0x199b3dd84 __CFRunLoopRun + 1020
37 CoreFoundation 0x199b3d660 CFRunLoopRunSpecific + 480
38 GraphicsServices 0x1a3f4e604 GSEventRunModal + 164
39 UIKitCore 0x19dd1215c UIApplicationMain + 1944
40 MYApp 0x100518e54 main + 4369190484 (<compiler-generated>:4369190484)
41 libdyld.dylib 0x1999b91ec start + 4
I tried several different encoding, I tried to do it on the main thread or in backgroud, but always without result.
it looks like the whole class CIFilter causes a crash !!

I figured out how to fix it. The problem was the third-party CocoaDebug ! I remove the pod and I have no more crashes! Thanks!

Related

coder.decodeDouble causing crashes on app updates, value was previously an optional

I have an object that stores latitude and longitude coordinates. At one point, they were stored as an Optional Double?. I have since changed so it is a non optional Double. Now I see random crash logs from what I assume is users updating their app.
I tried checking to make sure that there is a value there, but it is still causing the crash.
let lat: Double
...
required init (coder aDecoder: NSCoder) {
...
if aDecoder.containsValue(forKey: "lat") {
lat = aDecoder.decodeDouble(forKey: "lat") //here is the crash
}else{
lat = 0
}
...
}
I previously came across this issue and used the following code to get around it, but Xcode says I cannot decode Doubles from objects any more
if let v = aDecoder.decodeObject(forKey: "lat") as? Double{//*** -[NSKeyedUnarchiver decodeObjectForKey:] : value for key ( lat ) is not an object. This will become an error in the future.
lat = v
}else{
if aDecoder.containsValue(forKey: "lat") {
lat = aDecoder.decodeDouble(forKey: "lat")
}else{
lat = 0
}
}
Here is a crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x18120004c __exceptionPreprocess + 220 (NSException.m:200)
1 libobjc.A.dylib 0x199874f54 objc_exception_throw + 60 (objc-exception.mm:565)
2 Foundation 0x182aa8e68 -[NSCoder __failWithException:] + 180 (NSCoder.m:0)
3 Foundation 0x182aa8fd4 -[NSCoder(Exceptions) __failWithExceptionName:errorCode:format:] + 260 (NSCoder.m:1191)
4 Foundation 0x182a4689c _decodeDouble + 660 (NSKeyedArchiver.m:0)
5 Foundation 0x1829bd3cc -[NSKeyedUnarchiver decodeDoubleForKey:] + 172 (NSKeyedArchiver.m:3918)
6 *Project* 0x102eefb98 specialized Location.init(coder:) + 1936 (Location.swift:145)
7 *Project* 0x102eed854 init + 4 (<compiler-generated>:0)
8 *Project* 0x102eed854 #objc Location.init(coder:) + 32
9 Foundation 0x1829c0268 _decodeObjectBinary + 2560 (NSKeyedArchiver.m:3058)
10 Foundation 0x1829a4a78 _decodeObject + 180 (NSKeyedArchiver.m:3324)
11 Foundation 0x1829c4304 -[NSKeyedUnarchiver decodeObjectForKey:] + 176 (NSKeyedArchiver.m:3344)
12 Foundation 0x182a272b8 +[NSKeyedUnarchiver unarchiveObjectWithData:] + 84 (NSKeyedArchiver.m:2390)
13 *Project* 0x102ee729c APS.loadOnDeckFromiCloud() + 240 (APS.swift:138)
14 *Project* 0x102ee7058 APS.().init() + 860 (APS.swift:105)
15 *Project* 0x102ee6ce8 one-time initialization function for SI + 40 (APS.swift:0)
16 libdispatch.dylib 0x180e72660 _dispatch_client_callout + 20 (object.m:560)
17 libdispatch.dylib 0x180e73f08 _dispatch_once_callout + 32 (once.c:52)
18 *Project* 0x102f3417c specialized DivertToOnboardingIfNeeded_VC.viewWillAppear(_:) + 1536 (APS.swift:97)
19 *Project* 0x102f334a8 viewWillAppear + 4 (<compiler-generated>:0)
20 *Project* 0x102f334a8 #objc DivertToOnboardingIfNeeded_VC.viewWillAppear(_:) + 28
21 UIKitCore 0x1837ba3e0 -[UIViewController _setViewAppearState:isAnimating:] + 664 (UIViewController.m:5522)
22 UIKitCore 0x1838e9004 -[UIViewController __viewWillAppear:] + 120 (UIViewController.m:5654)
23 UIKitCore 0x1838ba5b0 -[UINavigationController _startTransition:fromViewController:toViewController:] + 720 (UINavigationController.m:7329)
24 UIKitCore 0x183ae657c -[UINavigationController _startDeferredTransitionIfNeeded:] + 876 (UINavigationController.m:7494)
25 UIKitCore 0x1839bb6ac -[UINavigationController __viewWillLayoutSubviews] + 168 (UINavigationController.m:7806)
26 UIKitCore 0x1838e20f4 -[UILayoutContainerView layoutSubviews] + 228 (UILayoutContainerView.m:88)
27 UIKitCore 0x18379aed8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2620 (UIView.m:18347)
28 QuartzCore 0x184ef6e24 CA::Layer::layout_if_needed(CA::Transaction*) + 536 (CALayer.mm:10038)
29 QuartzCore 0x184ee9644 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144 (CALayer.mm:2480)
30 QuartzCore 0x184efdc6c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 524 (CAContextInternal.mm:2586)
31 QuartzCore 0x184f06560 CA::Transaction::commit() + 680 (CATransactionInternal.mm:449)
32 UIKitCore 0x183963f9c __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 44 (UIApplication.m:11470)
33 CoreFoundation 0x1811d9924 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (CFRunLoop.c:1820)
34 CoreFoundation 0x1811da820 __CFRunLoopDoBlocks + 412 (CFRunLoop.c:1862)
35 CoreFoundation 0x181172808 __CFRunLoopRun + 840 (CFRunLoop.c:2953)
36 CoreFoundation 0x1811863b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
37 GraphicsServices 0x19cb1638c GSEventRunModal + 164 (GSEvent.c:2200)
38 UIKitCore 0x183b266a8 -[UIApplication _run] + 1100 (UIApplication.m:3493)
39 UIKitCore 0x1838a57f4 UIApplicationMain + 2092 (UIApplication.m:5046)
40 *Project* 0x102e93388 main + 68 (MapBox_VC.swift:15)
41 dyld 0x103169a24 start + 520 (dyldMain.cpp:876)
How do I check the value stored in lat to make sure it is a Double ? (Non optional)

CIFilter causes a crash on iPhone 11 and XR

All init of CIFilter causes a crash for some devices iPhone 11 & iPhone XR. iOS version 13.3.1, 13.4.1.
I tried to import :
import CoreImage
import CoreImage.CIFilter
import CoreImage.CIFilterBuiltins
But Its not working !
I use xCode 11.4.1 & xCode 11.5
I have tried several things:
if let filter = CIFilter(name: "CIQRCodeGenerator") {
filter.setValue(data, forKey: "inputMessage")
let transform = CGAffineTransform(scaleX: 5, y: 5)
if let output = filter.outputImage?.transformed(by: transform) {
return UIImage(ciImage: output)
}
}
or this :
let filter = CIFilter.qrCodeGenerator()
I also tried to link to CoreImage.framework explicitly in the target settings.
Crash log:
Crashed: com.apple.main-thread
0 CocoaDebug 0x1023a0adc perform_rebinding_with_section + 332
1 CocoaDebug 0x1023a087c rebind_symbols_for_image + 416
2 libdyld.dylib 0x1999c3f4c invocation function for block in dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 244
3 libdyld.dylib 0x1999c3768 dyld3::AllImages::runImageCallbacks(dyld3::Array<dyld3::LoadedImage> const&) + 160
4 libdyld.dylib 0x1999c8dd8 dyld3::AllImages::loadImage(Diagnostics&, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool) + 580
5 libdyld.dylib 0x1999c89ec dyld3::AllImages::dlopen(Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*) + 868
6 libdyld.dylib 0x1999ca434 dyld3::dlopen_internal(char const*, int, void*) + 364
7 libdyld.dylib 0x1999bd6c0 dlopen + 116
8 CoreFoundation 0x199bcf5c8 _CFBundleDlfcnLoadBundle + 156
9 CoreFoundation 0x199af1eac _CFBundleLoadExecutableAndReturnError + 372
10 Foundation 0x199ec27a8 -[NSBundle loadAndReturnError:] + 316
11 CoreImage 0x19b479bcc invocation function for block in register_more_builtins(void (NSString*) block_pointer) + 804
12 libdispatch.dylib 0x19986833c _dispatch_client_callout + 20
13 libdispatch.dylib 0x199869a68 _dispatch_once_callout + 32
14 CoreImage 0x19b476318 register_more_builtins(void (NSString*) block_pointer) + 304
15 CoreImage 0x19b476b40 classNameIsSystemFilter(NSString*) + 112
16 CoreImage 0x19b476dbc +[CIFilter(CIFilterRegistryPrivate) filterWithName:setDefaults:] + 396
17 MYApp 0x100656598 QRCodeViewController.generateQRCode(from:) + 4370490776 (<compiler-generated>:4370490776)
18 MYApp 0x1006563a4 QRCodeViewController.viewDidLoad() + 28 (QRCodeViewController.swift:28)
19 MYApp 0x10065642c #objc QRCodeViewController.viewDidLoad() + 4370490412 (<compiler-generated>:4370490412)
20 UIKitCore 0x19d6a236c -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 104
21 UIKitCore 0x19d6a6f20 -[UIViewController loadViewIfRequired] + 952
22 UIKitCore 0x19d6a730c -[UIViewController view] + 32
23 UIKitCore 0x19d602fa4 -[UINavigationController _startCustomTransition:] + 1148
24 UIKitCore 0x19d617478 -[UINavigationController _startDeferredTransitionIfNeeded:] + 692
25 UIKitCore 0x19d618818 -[UINavigationController __viewWillLayoutSubviews] + 176
26 UIKitCore 0x19d5fb4fc -[UILayoutContainerView layoutSubviews] + 228
27 UIKitCore 0x19e1de6a0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2168
28 QuartzCore 0x1a08314a0 -[CALayer layoutSublayers] + 292
29 QuartzCore 0x1a08318e0 CA::Layer::layout_if_needed(CA::Transaction*) + 472
30 QuartzCore 0x1a0843dc4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
31 QuartzCore 0x1a0788884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
32 QuartzCore 0x1a07b33d0 CA::Transaction::commit() + 656
33 QuartzCore 0x1a07b3fc8 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 96
34 CoreFoundation 0x199b42c54 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
35 CoreFoundation 0x199b3d8e4 __CFRunLoopDoObservers + 420
36 CoreFoundation 0x199b3dd84 __CFRunLoopRun + 1020
37 CoreFoundation 0x199b3d660 CFRunLoopRunSpecific + 480
38 GraphicsServices 0x1a3f4e604 GSEventRunModal + 164
39 UIKitCore 0x19dd1215c UIApplicationMain + 1944
40 MYApp 0x100518e54 main + 4369190484 (<compiler-generated>:4369190484)
41 libdyld.dylib 0x1999b91ec start + 4
With the simulator it works well.
Someone would have any idea ?
Thanks
I figured out how to fix it.
The problem was the third-party CocoaDebug !
I remove the pod and I have no more crashes!
Thanks!

What's the reason of App crashing with Crashed: com.apple.main-thread on firstIndex(where:)

I am getting a crash report in Crashlytics as below.
I tried a lot of ways generating this crash, but I am not able to generate this crash
Crashed: com.apple.main-thread
0 MyApp 0x1010d4b1c specialized Collection.firstIndex(where:) + 2433 (MyViewController.swift:2433)
1 MyApp 0x101094ee4 MyViewController.collectionView(_:cellForItemAt:) + 4307881700 (<compiler-generated>:4307881700)
2 MyApp 0x1010c2df4 #objc MyViewController.collectionView(_:cellForItemAt:) + 4308069876
3 UIKitCore 0x1aba8ae74 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 424
4 UIKitCore 0x1aba8f6f0 -[UICollectionView _updateVisibleCellsNow:] + 4352
5 UIKitCore 0x1aba93fbc -[UICollectionView layoutSubviews] + 320
6 UIKitCore 0x1ac6bc17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140
7 QuartzCore 0x1aec242c0 -[CALayer layoutSublayers] + 284
8 QuartzCore 0x1aec2a43c CA::Layer::layout_if_needed(CA::Transaction*) + 480
9 QuartzCore 0x1aec35140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
10 QuartzCore 0x1aeb7d884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
11 QuartzCore 0x1aeba7574 CA::Transaction::commit() + 676
12 QuartzCore 0x1aeba7f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
13 CoreFoundation 0x1a811de68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
14 CoreFoundation 0x1a8118d54 __CFRunLoopDoObservers + 416
15 CoreFoundation 0x1a8119320 __CFRunLoopRun + 1308
16 CoreFoundation 0x1a8118adc CFRunLoopRunSpecific + 464
17 GraphicsServices 0x1b20b9328 GSEventRunModal + 104
18 UIKitCore 0x1ac22663c UIApplicationMain + 1936
19 MyApp 0x100d80fa8 main + 30 (MyDatabase.swift:30)
20 libdyld.dylib 0x1a7fa2360 start + 4
Below is the line where the report says on which the crash has been generated.
if let index = cell.array.firstIndex(where: {$0.name == self.name}){
//code here
}
I looked for a lot of solutions out there but couldn't find any right solution for myself.
Thanks!

Crash when loading an enum

I received a crash log and am a bit puzzled about it.
0 libobjc.A.dylib 0x000000018e4c20a0 objc_msgSend + 32
1 UIKitCore 0x0000000192be86b8 -[UIView(AdditionalLayoutSupport) _nsis_center:bounds:inEngine:forLayoutGuide:] + 1328 (NSLayoutConstraint_UIKitAdditions.m:3674)
2 UIKitCore 0x0000000192ca003c -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 364 (UIView.m:0)
3 UIKitCore 0x0000000192ca04ac -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136 (UIView.m:10182)
4 CoreFoundation 0x000000018e77195c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16 (NSArrayHelpers.m:9)
5 CoreFoundation 0x000000018e674fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416 (NSArrayM_Common.h:390)
6 UIKitCore 0x0000000192c9f5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156 (UIView.m:9953)
7 UIKitCore 0x0000000192be76fc -[UIView(AdditionalLayoutSupport) _is_layout] + 148 (NSLayoutConstraint_UIKitAdditions.m:3231)
8 UIKitCore 0x0000000192ca7090 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 1032 (UIView.m:12082)
9 UIKitCore 0x0000000192cba17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140 (UIView.m:17028)
10 QuartzCore 0x00000001952222c0 -[CALayer layoutSublayers] + 284 (CALayer.mm:9627)
11 QuartzCore 0x000000019522843c CA::Layer::layout_if_needed(CA::Transaction*) + 480 (CALayer.mm:9501)
12 QuartzCore 0x0000000195233140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136 (CALayer.mm:2461)
13 QuartzCore 0x000000019517b884 CA::Context::commit_transaction(CA::Transaction*, double) + 304 (CAContextInternal.mm:1992)
14 QuartzCore 0x00000001951a5574 CA::Transaction::commit() + 676 (CATransactionInternal.mm:438)
15 QuartzCore 0x00000001951a5f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92 (CATransactionInternal.mm:888)
16 CoreFoundation 0x000000018e71be68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1758)
17 CoreFoundation 0x000000018e716d54 __CFRunLoopDoObservers + 416 (CFRunLoop.c:1868)
18 CoreFoundation 0x000000018e717320 __CFRunLoopRun + 1308 (CFRunLoop.c:2910)
19 CoreFoundation 0x000000018e716adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
20 GraphicsServices 0x00000001986b7328 GSEventRunModal + 104 (GSEvent.c:2246)
21 UIKitCore 0x000000019282463c UIApplicationMain + 1936 (UIApplication.m:4773)
22 MyAppName 0x0000000100b96974 main + 68 (Theme+Fonts.swift:14)
23 libdyld.dylib 0x000000018e5a0360 start + 4
The Theme+Fonts.swift file is a simple enum
enum ThemeFont: String {
case arialBold = "Arial-BoldMT",
arialRoundedBold = "Arial Rounded MT Bold", // This is line 14
…
}
How can I investigate further?
It happened on an iPhone 7. I don't have a device but I tested on the Simulator and got nothing.
This is probably not caused by the enum code but rather has something to do with the callback here
16 CoreFoundation 0x000000018e71be68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1758)

iOS CoreText crash: EXC_BAD_ACCESS KERN_INVALID_ADDRESS while setting view height

Following is the stack trace from Crashlytics, it crashes when text view's frame height is set:
(I got EXC_BAD_ACCESS KERN_INVALID_ADDRESS and SIGABRT ABORT crash at the same line #objc UIView.height.setter (UIView+.swift))
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000000d
Crashed: com.apple.main-thread
0 CoreText 0x194d24cd8 TOpenTypeMorph::SetLookups(OTL::GSUB&, unsigned int const*, OTL::GlyphLookups&) + 200
1 CoreText 0x194d24dd4 TOpenTypeMorph::SetLookups(OTL::GSUB&, unsigned int const*, OTL::GlyphLookups&) + 452
2 CoreText 0x194d25a40 void TOpenTypeMorph::ApplyShapingEngine<TInlineVector<unsigned int, 30ul> >(OTL::GSUB&, OTL::GlyphLookups&, unsigned int*, CFRange, TInlineVector<unsigned int, 30ul>&, SyncState&) + 1620
3 CoreText 0x194d24fac TOpenTypeMorph::ShapeGlyphs(SyncState&) + 340
4 CoreText 0x194cc4a4c TShapingEngine::ShapeGlyphs(TLine&, TCharStream const&) + 224
5 CoreText 0x194c8fa48 TTypesetter::TTypesetter(__CFArray const*, __CFString const*, void const* (*)(__CTRun const*, __CFString const*, void*), void*) + 188
6 CoreText 0x194c8f860 CTTypesetterCreateWithRunArray + 88
7 UIFoundation 0x197dffbb4 -[NSATSGlyphStorage createCTTypesetter] + 1512
8 UIFoundation 0x197dfa960 -[NSATSTypesetter _ctTypesetter] + 296
9 UIFoundation 0x197e03b14 -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 128
10 UIFoundation 0x197dfb534 -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2316
11 UIFoundation 0x197dfcaf8 -[NSATSTypesetter layoutParagraphAtPoint:] + 160
12 UIFoundation 0x197e53980 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 5692
13 UIFoundation 0x197e53da4 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244
14 UIFoundation 0x197dfd558 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448
15 UIFoundation 0x197de968c -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1116
16 UIFoundation 0x197deb180 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 196
17 UIFoundation 0x197deb8b4 -[NSLayoutManager(NSPrivate) _markSelfAsDirtyForBackgroundLayout:] + 344
18 UIFoundation 0x197df477c -[NSLayoutManager(NSPrivate) _invalidateLayoutForExtendedCharacterRange:isSoft:invalidateUsage:] + 2292
19 UIFoundation 0x197e1dee8 -[NSLayoutManager textContainerChangedGeometry:] + 332
20 UIFoundation 0x197e40220 -[NSTextContainer setSize:] + 160
21 UIKit 0x197f74508 _UITextContainerViewResyncNSTextContainer + 264
22 UIKit 0x19890198c __64-[_UITextContainerView _setFrameOrBounds:oldRect:settingAction:]_block_invoke + 52
23 UIKit 0x198901878 -[_UITextContainerView _setFrameOrBounds:oldRect:settingAction:] + 308
24 UIKit 0x197f7436c -[_UITextContainerView setFrame:] + 188
25 UIKit 0x1988ee64c -[UITextView _resyncContainerFrameForNonAutolayoutDeferringSizeToFit:] + 644
26 UIKit 0x1988ef1b4 -[UITextView _setFrameOrBounds:fromOldRect:settingAction:] + 500
27 UIKit 0x197f73bf8 -[UITextView setFrame:] + 188
28 MyAppCore 0x1024ac944 #objc UIView.height.setter (UIView+.swift)
29 MyAppShell 0x1030a1cbc MyAppTextBaseCell.setSubviewFrames() -> () (MyAppTextBaseCell.swift)
30 MyAppShell 0x1059254e0 MyAppCollectionViewCell.layoutSubviews() -> () (MyAppCollectionViewCell.swift:215)
31 MyAppShell 0x1059255d4 #objc MyAppCollectionViewCell.layoutSubviews() -> () (MyAppCollectionViewCell.swift)
32 UIKit 0x197ec6220 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1196
33 QuartzCore 0x195386188 -[CALayer layoutSublayers] + 148
34 QuartzCore 0x19537ae64 CA::Layer::layout_if_needed(CA::Transaction*) + 292
35 UIKit 0x197edac90 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1020
36 MyAppLib 0x100b56ea4 -[MyAppImpressionTracker reloadViewPortCellsWithCompletion:] (MyAppImpressionTracker.m:59)
37 MyAppLib 0x100b65f0c -[MyAppTracker viewPortWillRefresh:withReloadDataCompletion:] (MyAppTracker.m:150)
38 MyAppShell 0x1030d3440 MyAppViewController.reloadData() -> () (MyAppViewController.swift)
39 MyAppFeed 0x102a85ad4 MyAppViewController.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () (MyAppViewController.swift)
40 MyAppFeed 0x102a85c80 #objc MyAppViewController.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () (MyAppViewController.swift)
41 MyAppFeed 0x102a53030 protocol witness for MyAppProviderDelegate.providerHasUpdated(fromCache : Bool, hasInitialUpdates : Bool) -> () in conformance MyAppViewController (MyAppCellViewModel.swift)
42 MyAppFeed 0x102b35c84 specialized MyAppProvider.(updateSectionProviders(Bool, hasInitialUpdates : Bool, completion : () -> ()?) -> ()).(closure #2) (MyAppProvider.swift)
43 MyAppFeed 0x102b32380 partial apply for MyAppProvider.(updateSectionProviders(Bool, hasInitialUpdates : Bool, completion : () -> ()?) -> ()).(closure #2) (MyAppProvider.swift)
44 MyAppCore 0x10246188c partial apply for static GCD.(dispatchAsyncMyAppOperationQueue(() -> (), thenOnMainQueue : () -> ()?) -> ()).(closure #1).(closure #1) (QueueHelper.swift)
45 libdispatch.dylib 0x190ef9200 _dispatch_call_block_and_release + 24
46 libdispatch.dylib 0x190ef91c0 _dispatch_client_callout + 16
47 libdispatch.dylib 0x190efdd6c _dispatch_main_queue_callback_4CF + 1000
48 CoreFoundation 0x19201bf2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
49 CoreFoundation 0x192019b18 __CFRunLoopRun + 1660
50 CoreFoundation 0x191f48048 CFRunLoopRunSpecific + 444
51 GraphicsServices 0x1939ce198 GSEventRunModal + 180
52 UIKit 0x197f342fc -[UIApplication _run] + 684
53 UIKit 0x197f2f034 UIApplicationMain + 208
54 MyApp 0x1000b344c main (AppDelegate.swift:27)
55 libdispatch.dylib 0x190f2c5b8 (Missing)
As the crash logs are related to Glyph, it seems to be happening for some weird character/symbol may be in language other than english.
I have not been able to repro this crash, can someone please provide any pointer.
This is happening because of jña telugu character being received. It is an issue with older ios versions though. See this video.

Resources