如何在iOS 9.3.1上的QuartzCore CALayerGetLayer中修复EXC_BAD_ACCESS崩溃?

时间:2016-04-26 11:48:35

标签: ios swift crash exc-bad-access

我正在调查Fabric中的崩溃报告,我不知道是什么导致了它。堆栈跟踪不是特别有用,但它看起来应用程序正准备在后台暂停。这是崩溃消息:

  

崩溃:com.apple.main-thread

     

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445

这是堆栈跟踪:

Crashed: com.apple.main-thread
0  QuartzCore                     0x18680fdf0 CALayerGetLayer + 12
1  QuartzCore                     0x186810540 CA::Context::invalidate() + 68
2  QuartzCore                     0x1868104cc -[CAContextImpl dealloc] + 64
3  UIKit                          0x188f04bc4 -[UIWindow _destroyContext] + 324
4  UIKit                          0x188f049e4 +[UIWindow _prepareWindowsForAppSuspend] + 172
5  UIKit                          0x188f0491c -[UIApplication _destroyContextsAndNotifySpringBoard] + 28
6  UIKit                          0x189124244 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke_2 + 240
7  UIKit                          0x1891280f0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke2283 + 148
8  FrontBoardServices             0x1856c9fc0 -[FBSSceneSnapshotAction _finishAllRequests] + 80
9  FrontBoardServices             0x1856c9d38 -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:] + 224
10 UIKit                          0x189127ee0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke + 272
11 UIKit                          0x1891274e0 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] + 900
12 UIKit                          0x189127d7c -[UIApplication _performSnapshotsWithAction:forScene:completion:] + 560
13 UIKit                          0x189127ad0 -[UIApplication _handleSnapshotAction:forScene:completion:] + 156
14 UIKit                          0x1891243dc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2031 + 272
15 UIKit                          0x189123ffc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2017 + 1040
16 UIKit                          0x189126fd8 _runAfterCACommitDeferredBlocks + 292
17 UIKit                          0x189134990 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
18 UIKit                          0x188e664a4 _afterCACommitHandler + 96
19 CoreFoundation                 0x183ce07b0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
20 CoreFoundation                 0x183cde554 __CFRunLoopDoObservers + 372
21 CoreFoundation                 0x183cde984 __CFRunLoopRun + 928
22 CoreFoundation                 0x183c08d10 CFRunLoopRunSpecific + 384
23 GraphicsServices               0x1854f0088 GSEventRunModal + 180
24 UIKit                          0x188eddf70 UIApplicationMain + 204
25 HDWR                           0x1000706dc main (AppDelegate.swift:37)
26 libdispatch.dylib              0x1837a68b8 (Missing)

知道如何才能深入了解这一点吗?

这看起来好像是UIKit或QuartzCore中的错误,还是更有可能成为我们自己代码中的错误?

1 个答案:

答案 0 :(得分:0)

崩溃:com.apple.main-thread

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445

我认为你使用的是没有被侮辱的nil对象