- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近在运行我的应用程序时遇到了以下错误:
EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP, subcode=0x0)
如何调试此特定错误?还有其他方法我没试过吗?
这种特定的崩溃发生在我们打开聊天对话时 UITableView
.这个UITableView
的配置涉及几个元素,如已注册的 nib 加载 UITableView
细胞以及在 dispatch_async
的帮助下将一些图像异步加载到这些细胞中
我尝试了一些常用的技巧来从调试器中获取更多有用的信息,但都没有成功:
这似乎提供了有关任何线程(main
本身除外)中唯一可见函数调用的更多信息,之前是 +[ASIHTTPRequest runRequests]
尽管我不太愿意相信真正的问题在于 ASIHttpRequest
的实现特别是因为我们多年来没有改变它......(我意识到这个库早就被弃用了)
bt
命令
正在运行 bt
似乎提供了一些半有用的数据。它至少表明该问题可能与UITableView
有关。配置。
(lldb) bt
* thread #1: tid = 0x854b7, 0x0503da6b libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0503da6b libobjc.A.dylib`objc_exception_throw
frame #1: 0x028fe86d CoreFoundation`+[NSException raise:format:] + 141
frame #2: 0x03998d7c QuartzCore`CA::Layer::set_position(CA::Vec2<double> const&, bool) + 190
frame #3: 0x03998f2a QuartzCore`-[CALayer setPosition:] + 56
frame #4: 0x039995a7 QuartzCore`-[CALayer setFrame:] + 752
frame #5: 0x03b4a20c UIKit`-[UIView(Geometry) setFrame:] + 305
frame #6: 0x03c85432 UIKit`-[UIImageView _setViewGeometry:forMetric:] + 228
frame #7: 0x03c8563a UIKit`-[UIImageView setFrame:] + 63
frame #8: 0x03b4c0cf UIKit`-[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 967
frame #9: 0x03b4ce11 UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 301
frame #10: 0x03b4ce9e UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 121
frame #11: 0x03b4b9ed UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke + 87
frame #12: 0x02824e33 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 99
frame #13: 0x028244cf CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
frame #14: 0x03b4b97d UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #15: 0x03be9df2 UIKit`-[UITableView resizeSubviewsWithOldSize:] + 98
frame #16: 0x03b4d13f UIKit`-[UIView(Geometry) setBounds:] + 537
frame #17: 0x03b6b2a7 UIKit`-[UIScrollView setBounds:] + 1071
frame #18: 0x03bea257 UIKit`-[UITableView setBounds:] + 260
frame #19: 0x03b4caae UIKit`-[UIView(Geometry) _applyISEngineLayoutValues] + 348
frame #20: 0x03b4cd6b UIKit`-[UIView(Geometry) _resizeWithOldSuperviewSize:] + 135
frame #21: 0x042a1fb6 UIKit`-[UIScrollView(_UIOldConstraintBasedLayoutSupport) _resizeWithOldSuperviewSize:] + 73
frame #22: 0x03b4ce9e UIKit`-[UIView(Geometry) resizeWithOldSuperviewSize:] + 121
frame #23: 0x03b4b9ed UIKit`__46-[UIView(Geometry) resizeSubviewsWithOldSize:]_block_invoke + 87
frame #24: 0x02824e33 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 99
frame #25: 0x028244cf CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
frame #26: 0x03b4b97d UIKit`-[UIView(Geometry) resizeSubviewsWithOldSize:] + 149
frame #27: 0x04250c39 UIKit`-[UIView(AdditionalLayoutSupport) _is_layout] + 166
frame #28: 0x03b512bf UIKit`-[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 697
frame #29: 0x03b5137c UIKit`-[UIView(Hierarchy) layoutSubviews] + 57
frame #30: 0x03b5edd1 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
frame #31: 0x05053771 libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
frame #32: 0x039a228f QuartzCore`-[CALayer layoutSublayers] + 152
frame #33: 0x03996115 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 397
frame #34: 0x03995f70 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
frame #35: 0x038f43c6 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 284
frame #36: 0x038f578c QuartzCore`CA::Transaction::commit() + 392
frame #37: 0x038f5e58 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #38: 0x028219de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #39: 0x02821920 CoreFoundation`__CFRunLoopDoObservers + 400
frame #40: 0x0281735a CoreFoundation`__CFRunLoopRun + 1226
frame #41: 0x02816bcb CoreFoundation`CFRunLoopRunSpecific + 443
frame #42: 0x028169fb CoreFoundation`CFRunLoopRunInMode + 123
frame #43: 0x067db24f GraphicsServices`GSEventRunModal + 192
frame #44: 0x067db08c GraphicsServices`GSEventRun + 104
frame #45: 0x03ad38b6 UIKit`UIApplicationMain + 1526
这就是我现在正在做的,但错误发生在一个不太常见的用例中,所以我们不确定它实际上是什么时候坏的。
我并没有最终需要这样做,但它可能对其他人有帮助。参见 Tim's answer下文了解更多详情。
提前感谢您的任何反馈/建议!
最佳答案
不幸的是,iOS 没有提供像样的内存调试器。您可以自己从源代码构建 clang
并创建自定义 Xcode 编译器来使用它。读一读 here .
完成后,如果您在 CFLAGS
和 LFLAGS
中传递 -fsanitize=address
,则 clang
将自动检查常见内存错误(如 Valgrind
redux.)
我知道这是一项繁重的工作,但是一旦您设置好它,将它作为一种方便的工具会非常有帮助。
关于ios - 在 XCode 6.1.1 中调试 EXC_BAD_INSTRUCTION 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28099524/
我有一个无法修复的错误。我刚开始使用 Swift,所以我在这里有点迷失。 Basic Swift 最佳答案 在开始在函数中编写代码之前,应调用 super.viewDidLoad() 。基本上,sup
写下该类怎么了,它返回以下错误: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) 调用operator =时。 class test {
import SpriteKit let BallCategoryName = "ball" let PaddleCategoryName = "paddle" let BlockCategoryNa
我是 swift 和 iOS 新手!我四处寻找在选择单元格后将 arrary[indexPath.row] 传递到另一个 View 的不同方法。由于某种原因,我的无法正常工作,并且出现了上述错误。我正
这里有一个大n00b:-) 我为 IOS 制作了第一个应用程序,只要填充所有文本字段,一切就可以正常工作。这个应用程序是一个简单的计算应用程序,我需要一些帮助以确保该应用程序在字段为空时不会关闭。 这
当从解析用户对象 PFUser 进行子类化时,我在使用自己的方法时遇到了错误指令错误。你们有什么想法为什么会发生这种情况 User.swift import UIKit import Parse cl
我一直在使用这个函数来生成时间戳。我在 Stack Overflow 上的某个地方找到了它。 @objc public class var timestamp: String { return
当我运行我的应用程序时,此错误不适用于: fatal error: unexpectedly found nil while unwrapping an Optional value 和 exc_ba
所以我试图在游戏中生成一个下落的物体,并且我使用一个数组来设置所有可能的 xSpawn 点,然后我通过数组进行随机化以获得 x 值,但问题是当它达到代码中的这一行: let SpawnPoint =
我知道有很多关于此错误的问题,但我还没有找到解决我的问题的方法,即使我阅读了其中的大部分。在 View Controller 中,我试图使 TextView 显示文本顶部,而不是底部。当只有一个 te
为什么下面方法的第一行给我一个EXC_BAD_INSTRUCTION运行时错误? func tableView(tableView: UITableView!, cellForRowAtIndexPa
我有这个代码: dispatch_async(dispatch_get_main_queue(), ^(void) { SEL selector = @selector(callback:);
所以我在下面的“if”行收到“线程 1:EXC_BAD_INSTRUCTION(代码=EXC_1386_INVOP,子代码=0x0)”错误。 var doorsKnocked = 20 var sal
我在 Xcode 6 中多次遇到这个问题。问题是我有一个球在运行,当他击中一个方 block 时他就死了。他可以跳。但是第一个 block 总是崩溃。就像如果我只是像不在空中一样正常滚动并击中第一个
我正在尝试按照本教程进行操作,但经过一些小的试验和错误运行后,我遇到了一个我不太了解的问题。我收到此错误 (?) exc_bad_instruction。我读到它通常发生在你试图打开 nil 或 ni
这个问题在这里已经有了答案: Crash when casting the result of arc4random() to Int (7 个答案) 关闭 8 年前。 我正在尝试从包含 3 个字符
我知道有很多关于这个错误的问题,但我还没有找到解决我的问题的方法,即使我阅读了其中的大部分。在 View Controller 中,我试图让我的 TextView 显示文本的顶部,而不是底部。当只有一
我是 Swift 的新手,目前正在尝试学习它,但我遇到了一个神秘的问题。正如您在下图中看到的,有一些控件已正确链接到此 View Controller ,在按下 UI 中的按钮后,我们将执行下面的代码
在我尝试从项目中删除 Storyboard之前,我的仪表板 View 工作正常。我使用 git 创建了一个新分支并开始删除 Storyboard并遇到了这个问题。这是我如何进入仪表板屏幕的基本设置。
我尝试编写游戏代码(我使用本教程 https://www.youtube.com/watch?v=LkYpoRj-7hA 是 Swift 中的新教程)。到目前为止,这就是我的代码: import UI
我是一名优秀的程序员,十分优秀!