xcode 调试 EXC_BAD_ACCESS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35189829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debugging EXC_BAD_ACCESS
提问by Daniel
I've not worked on this project in quite some time.. When I left it some time in the iOS 8s it ran just fine, however.. on the latest XCode I'm getting many inconsistent EXC_BAD_ACCESS crashes. Now afaik it's requiring a deallocated object. However, the error is lacking where to look. This is quite a big project and like I say, the errors are inconsistent.
我已经有很长一段时间没有在这个项目上工作了.. 当我在 iOS 8s 中离开它一段时间时它运行得很好,但是.. 在最新的 XCode 上,我遇到了许多不一致的 EXC_BAD_ACCESS 崩溃。现在 afaik 它需要一个释放的对象。但是,错误缺少在哪里查看。这是一个相当大的项目,就像我说的,错误是不一致的。
I've tried enabling zombie objects, as well as passing it as a starting parameter. However, this is leading me to no joy. I'm expecting something in the debug console with zombies enabled, is this right?
我试过启用僵尸对象,并将其作为起始参数传递。然而,这让我没有快乐。我期待在启用了僵尸的调试控制台中出现一些东西,对吗?
If anyone has any tips on how to find an easier way to debug this, as opposed to tinkering with everything and hoping it works..
如果有人有任何关于如何找到更简单的调试方法的提示,而不是修补所有内容并希望它有效..
回答by bbum
EXC_BAD_ACCESS
just means that your app is trying to access an invalid memory address. While it is oft caused be a deallocated object, that isn't always the case.
EXC_BAD_ACCESS
只是意味着您的应用程序正在尝试访问无效的内存地址。虽然它通常是一个解除分配的对象,但情况并非总是如此。
When the app crashes, there should be a crash log or backtrace. Post it as that'll provide clues.
当应用程序崩溃时,应该有崩溃日志或回溯。发布它,因为它会提供线索。
Lovely; a crash entirely in framework code. Seeing as how it is SceneKit that is crashing, I would suggest replacing any graphic assets with new ones and see if that fixes it (even if it doesn't look right). Then check to make sure all of your geometries and layouts are correct.
迷人的; 完全在框架代码中崩溃。看到 SceneKit 是如何崩溃的,我建议用新的图形资产替换任何图形资产,看看是否能修复它(即使它看起来不正确)。然后检查以确保所有几何图形和布局都正确。
回答by Anthony Castelli
Have you tried adding a global Exception or Symbolic breakpoint? Those usually help me 99% of the time when I encounter issues without any sort of backtrace.
您是否尝试过添加全局异常或符号断点?当我遇到没有任何回溯的问题时,这些通常可以帮助我 99%。