单步执行调试器时,EXC_BAD_ACCESS(代码= 1,地址= 0x0)

Bob*_*sky 32 debugging xcode ios xcode5 osx-mavericks

每次我尝试跳过一个电话时,我的应用程序都会崩溃.没有调试器它工作正常.

此外,当我在模拟器中运行应用程序时,无论是否使用调试器都可以.

最近我将Mac OS X 10.8升级到了10.9(Mavericks).升级前没有问题.

是什么导致了这个问题,我该如何解决?

下面是回溯.我的应用程序使用ARC.我已启用僵尸并添加了异常断点但没有检测到的僵尸,并且永远不会触发异常断点.

    * thread #1: tid = 0x2503, 0x00000000, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
        frame #0: 0x00000000
        frame #1: 0x35e170c4 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 72
        frame #2: 0x35e17076 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
        frame #3: 0x35e17054 UIKit`-[UIControl sendAction:to:forEvent:] + 44
        frame #4: 0x35e1690a UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 502
        frame #5: 0x35e16e00 UIKit`-[UIControl touchesEnded:withEvent:] + 488
        frame #6: 0x35d3f5f0 UIKit`-[UIWindow _sendTouchesForEvent:] + 524
        frame #7: 0x35d2c800 UIKit`-[UIApplication sendEvent:] + 380
        frame #8: 0x35d2c11a UIKit`_UIApplicationHandleEvent + 6154
        frame #9: 0x37a1e5a2 GraphicsServices`_PurpleEventCallback + 590
        frame #10: 0x37a1e1d2 GraphicsServices`PurpleEventCallback + 34
        frame #11: 0x33ef9172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
        frame #12: 0x33ef9116 CoreFoundation`__CFRunLoopDoSource1 + 138
        frame #13: 0x33ef7f98 CoreFoundation`__CFRunLoopRun + 1384
        frame #14: 0x33e6aebc CoreFoundation`CFRunLoopRunSpecific + 356
        frame #15: 0x33e6ad48 CoreFoundation`CFRunLoopRunInMode + 104
        frame #16: 0x37a1d2ea GraphicsServices`GSEventRunModal + 74
        frame #17: 0x35d80300 UIKit`UIApplicationMain + 1120
        frame #18: 0x000faac8 MyApp`main(argc=1, argv=0x2fd0fd08) + 116 at main.m:16
Run Code Online (Sandbox Code Playgroud)

编辑:

我有最新的Xcode版本5.0.1(5A2053).

我从头开始创建新的应用程序并且没有问题地运行它.然后,我把一个断点ViewControllerviewDidLoad,上前一步了.在这里我又发生了一次撞车

* thread #1: tid = 0x2503, 0x3bb9d7c4 libobjc.A.dylib`objc_msgSendSuper2 + 4, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x4)
    frame #0: 0x3bb9d7c4 libobjc.A.dylib`objc_msgSendSuper2 + 4
    frame #1: 0x000b913a test`-[ViewController viewDidLoad](self=0x1cda5c70, _cmd=0x361bd5db) + 62 at ViewController.m:19
    frame #2: 0x35d4b594 UIKit`-[UIViewController loadViewIfRequired] + 364
    frame #3: 0x35d8bd78 UIKit`-[UIWindow addRootViewControllerViewIfPossible] + 64
    frame #4: 0x35d87aec UIKit`-[UIWindow _setHidden:forced:] + 364
    frame #5: 0x35dc91e8 UIKit`-[UIWindow makeKeyAndVisible] + 60
    frame #6: 0x35d8c83e UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1666
    frame #7: 0x35d8484a UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 698
    frame #8: 0x35d2cc38 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1004
    frame #9: 0x35d2c6cc UIKit`-[UIApplication sendEvent:] + 72
    frame #10: 0x35d2c11a UIKit`_UIApplicationHandleEvent + 6154
    frame #11: 0x37a1e5a2 GraphicsServices`_PurpleEventCallback + 590
    frame #12: 0x37a1e1d2 GraphicsServices`PurpleEventCallback + 34
    frame #13: 0x33ef9172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
    frame #14: 0x33ef9116 CoreFoundation`__CFRunLoopDoSource1 + 138
    frame #15: 0x33ef7f98 CoreFoundation`__CFRunLoopRun + 1384
    frame #16: 0x33e6aebc CoreFoundation`CFRunLoopRunSpecific + 356
    frame #17: 0x33e6ad48 CoreFoundation`CFRunLoopRunInMode + 104
    frame #18: 0x35d83484 UIKit`-[UIApplication _run] + 668
    frame #19: 0x35d80300 UIKit`UIApplicationMain + 1120
    frame #20: 0x000b93bc test`main(argc=1, argv=0x2fd51d30) + 116 at main.m:16
    frame #21: 0x3bfd9b20 libdyld.dylib`start + 4
Run Code Online (Sandbox Code Playgroud)

编辑2:

XCode 5中的格雷格克莱顿在设备上运行应用程序时发生崩溃建议跟随

Others have seen this issue.
A few things to try:
1 - Reboot your device and try again. The theory is an old developer disk image is already mounted and won't be unmounted until you reboot.
2 - Re-install the OS on the device

Hopefully #1 fixes your issue. Others have done #2 and had their issue fixed, but hopefully it doesn't require an OS re-install.
Run Code Online (Sandbox Code Playgroud)

我做了两个,但没有帮助.

我尝试使用其他设备,但它有所不同.如果我使用iOS 6.1的iPod Touch,但iOS 7.0的iPad工作正常,则仍有例外情况.

因此,该问题看起来与设备上安装的iOS版本有关.我仍然不确定如何解决它.

编辑3:

我的命令行工具版本与我的Xcode版本匹配(实际上我只有一个版本的命令行工具).

这些问题可能与正在调试的代码无关.它与Xcode创建的新创建的单视图应用程序崩溃.当踩到琐碎的代码时,它会崩溃:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
Run Code Online (Sandbox Code Playgroud)

我在Apple开发者论坛上提出过要求并得到了Jason Molenda的回应:

我们正在跟踪一个听起来像你在这里看到的错误.这是一个微妙的计时问题,需要稍慢的主机或稍慢的设备才能命中.它主要是iPhone 4和类似的,它将在iOS 7中看到这一点.对于iOS 6,iPhone 4和iPhone 3GS设备最有可能体验它....这个问题只会发生在Xcode 5.0.1上.

所以,它似乎是Xcode中的一个错误.

Bob*_*sky 23

好的,这绝对是Xcode 5.0.1中的一个错误.

这是由Apple开发者论坛上的Jason Molenda证实的.目前唯一的解决方法是使用旧版本的Xcode和旧版本的Mac OS X,因为Xcode 5需要OS X 10.8.4.

没有公布ETA来解决此问题.Apple开发者论坛关于ETA的直接问题没有答案.

2013年11月6日更新:

今天,在developer.apple.com上发布了Xcode 5.0.2的预发布版本.此版本修复了(除其他外)以下问题:

在运行iOS 6.x的设备上调试应用程序会导致应用程序因EXC_BAD_ACCESS而崩溃.这已经解决了.(15310896)

我安装了新版本,问题确实消失了.现在我可以再次在我的6.x设备上调试应用程序.

Jason Molenda在苹果开发者论坛上发表讲话说:

我被告知你可以使用这个Xcode 5.0.2种子将应用程序提交到应用程序商店.

  • 这已在Xcode(5.0.2)的最新种子版本中得到修复."在运行iOS 6.x的设备上调试应用程序会导致应用程序因EXC_BAD_ACCESS而崩溃.这已得到解决.(15310896)" (2认同)