前提・実現したいこと
AppStoreへ公開しているiOSアプリ(メモアプリ)について、クラッシュしたと報告を受けました。
該当の.clashファイルの内容を確認し、その原因を突き止めたいです。
実際にクラッシュしたと言われた環境(報告者のiPhone)は下記です
Hardware Model: iPhone11,8
iOSのバージョン:15.3.1
発生している問題・エラーメッセージ
【エラーメッセージ】
〜〜
**Exception Type: EXC_CRASH (SIGKILL)** Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: FRONTBOARD 2343432205 <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.HirokiSato.Memomomomo>:7530] failed to terminate gracefully after 5.0s ProcessVisibility: Unknown ProcessState: Running WatchdogEvent: process-exit WatchdogVisibility: Background WatchdogCPUStatistics: ( "Elapsed total CPU time (seconds): 8.620 (user 8.620, system 0.000), 26% CPU", "Elapsed application CPU time (seconds): 5.584, 17% CPU" ) reportType:CrashLog maxTerminationResistance:Interactive> Triggered by Thread: 0 Kernel Triage: VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage Thread 0 name: Thread 0 Crashed: 0 libsystem_malloc.dylib 0x0000000192b010a0 small_malloc_should_clear + 1828 (magazine_small.c:972) 1 libsystem_malloc.dylib 0x0000000192b02898 tiny_free_no_lock + 1008 (magazine_tiny.c:1286) 2 libsystem_malloc.dylib 0x0000000192b032f4 free_tiny + 428 (magazine_tiny.c:2467) 3 CoreFoundation 0x0000000180d90c74 _CFRelease + 1180 (CFRuntime.c:0) 4 CoreText 0x000000018604086c TLine::~TLine() + 224 (TLine.cpp:108) 5 CoreFoundation 0x0000000180d908d0 _CFRelease + 248 (CFRuntime.c:2134) 6 UIFoundation 0x000000018bb9a1ec __NSCoreTypesetterCreateBaseLineFromAttributedString + 508 (NSCoreTypesetter.m:459) 7 UIFoundation 0x000000018bb89c9c -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 9392 (NSCoreTypesetter.m:2179) 8 UIFoundation 0x000000018bb835a0 __NSStringDrawingEngine + 1484 (NSStringDrawing.m:1588) 9 UIFoundation 0x000000018bb7f338 -[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:] + 172 (NSStringDrawing.m:1027) 10 UIKitCore 0x000000018352785c -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 1692 (UILabel.m:0) 11 UIKitCore 0x00000001833cc49c -[UILabel _intrinsicSizeWithinSize:] + 528 (UILabel.m:3626) 12 UIKitCore 0x000000018385c6e0 -[UITableViewCellLayoutManager optimumSizeForLabel:inTotalTextRect:minimizeWidthOnVerticalOverflow:preferSingleLineWidth:] + 116 (UITableViewCellLayoutManager.m:2408) 13 UIKitCore 0x00000001833ccda8 -[UITableViewCellLayoutManager getTextLabelRect:detailTextLabelRect:forCell:rowWidth:forSizing:] + 224 (UITableViewCellLayoutManager.m:2253) 14 UIKitCore 0x00000001835f64d8 -[UITableViewCellLayoutManager _modern_layoutSubviewsOfCell:] + 1800 (UITableViewCellLayoutManager.m:1337) 15 UIKitCore 0x00000001834e2c0c -[UITableViewCell layoutSubviews] + 204 (UITableViewCell.m:4956) 16 UIKitCore 0x00000001833b2474 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2620 (UIView.m:18348) 17 QuartzCore 0x0000000184b15794 CA::Layer::layout_if_needed(CA::Transaction*) + 536 (CALayer.mm:10038) 18 UIKitCore 0x0000000183416a1c -[UIView(Hierarchy) layoutBelowIfNeeded] + 552 (UIView.m:12783) 19 UIKitCore 0x0000000183398778 +[UIView(Animation) performWithoutAnimation:] + 104 (UIView.m:14522) 20 UIKitCore 0x00000001834ad834 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 2132 (UITableView.m:16288) 21 UIKitCore 0x00000001836ac9e0 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 748 (UITableView.m:3092) 22 UIKitCore 0x00000001834d2c40 -[UITableView _updateVisibleCellsNow:] + 1396 (UITableView.m:3229) 23 UIKitCore 0x00000001833a1df4 -[UITableView layoutSubviews] + 456 (UITableView.m:10406) 24 UIKitCore 0x00000001833b2474 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2620 (UIView.m:18348) 25 QuartzCore 0x0000000184b15794 CA::Layer::layout_if_needed(CA::Transaction*) + 536 (CALayer.mm:10038) 26 QuartzCore 0x0000000184b07fb4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144 (CALayer.mm:2480) 27 QuartzCore 0x0000000184b1c5dc CA::Context::commit_transaction(CA::Transaction*, double, double*) + 524 (CAContextInternal.mm:2586) 28 QuartzCore 0x0000000184b24ed0 CA::Transaction::commit() + 680 (CATransactionInternal.mm:449) 29 UIKitCore 0x000000018338b838 _afterCACommitHandler + 88 (UIApplication.m:3039) 30 CoreFoundation 0x0000000180dbd610 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1804) 31 CoreFoundation 0x0000000180d8c8f4 __CFRunLoopDoObservers + 572 (CFRunLoop.c:1917) 32 CoreFoundation 0x0000000180d8798c __CFRunLoopRun + 1052 (CFRunLoop.c:2979) 33 CoreFoundation 0x0000000180d9b468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 34 GraphicsServices 0x000000019c93f38c GSEventRunModal + 164 (GSEvent.c:2200) 35 UIKitCore 0x000000018373e5d0 -[UIApplication _run] + 1100 (UIApplication.m:3493) 36 UIKitCore 0x00000001834bcf74 UIApplicationMain + 364 (UIApplication.m:5047) 37 libswiftUIKit.dylib 0x0000000198680fa0 UIApplicationMain(_:_:_:_:) + 104 (UIKit.swift:530) 38 Memomomomo 0x0000000102841e64 main + 80 (<compiler-generated>:11) 39 Memomomomo 0x0000000102841e64 $main + 92 (EditColorViewController.swift:0) 40 Memomomomo 0x0000000102841e64 main + 108 41 dyld 0x0000000102f39aa4 start + 520 (dyldMain.cpp:879)
試したこと
.clashファイルの内容を確認し、直接原因はシステムエラーで、Thread: 0にてCPU使い過ぎで時間かかっているためだと理解しました。
下記サイトを参考にその結論にいたりました。
クラッシュしたと報告の受けた画面はDB(Realm)から対象のデータをTableViewを表示する画面です。
Realmの読み込みで時間がかかっているのかと思い、1000件ほどデータを投入しましたが、1秒もかからず返ってきました。
別の原因として、Thread: 0の7行目が原因なのかなとも思いましたが、どこを変更すればこの値が変わるのかわかりませんでした。
7 UIFoundation 0x000000018bb89c9c -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 9392 (NSCoreTypesetter.m:2179)
Googleで色々と調べましたが、力不足でした。
ご教授願います。

回答1件
あなたの回答
tips
プレビュー