当进入debugging器时,EXC_BAD_ACCESS(代码= 1,地址= 0x0)

我的应用程序崩溃,每一次我尝试跨过一个电话。 没有debugging器,它工作正常。

另外,当我在模拟器中运行应用程序时,可以使用或不使用debugging器。

最近我把我的Mac OS X 10.8升级到了10.9(小牛)。 升级前没有问题。

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

以下是后面的跟踪。 我的应用程序使用ARC。 我已经启用僵尸和添加exception断点,但没有发现僵尸和exception断点永远不会触发。

* 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 

编辑:

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

我从头创build了新的应用程序,并没有问题的运行。 然后,我在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 

编辑2:

格雷格克莱顿在XCode 5崩溃,而在设备上运行的应用程序build议以下

 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. 

我做了两个,它没有帮助。

我试图使用另一个设备,它有所作为。 如果我在iOS 6.1中使用iPod Touch,但是在iOS 7.0.2中使用iPad,则例外仍然存在。

所以,看起来问题与设备上安装的iOS版本有关。 我仍然不确定如何解决这个问题。

编辑3:

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

问题可能与正在debugging的代码无关。 它与由Xcode创build的新创build的Single View Application崩溃。 而当它跨越琐碎的代码时,它崩溃了:

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

我已经问过苹果开发者论坛,并得到Jason Molenda的回应:

我们正在跟踪一个听起来像你在这里看到的错误。 这是一个微妙的时间问题,需要一个稍慢的主机或稍慢的设备打。 主要是iPhone 4和类似的,可以在iOS 7上看到。使用iOS 6,iPhone 4和iPhone 3GS设备最有可能体验到这一点。 …这个问题只会发生在Xcode 5.0.1。

所以,这似乎是Xcode中的一个错误。

好的,这绝对是Xcode 5.0.1中的一个bug。

Jason Molenda 在苹果开发者论坛上证实了这一点。 现在唯一的解决方法是使用旧版本的Xcode和旧版本的Mac OS X,因为Xcode 5需要OS X 10.8.4。

这个问题没有公布的ETA解决scheme。 苹果开发者论坛关于ETA的直接问题没有回答。

更新06-Nov-2013:

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

在运行iOS 6.x的设备上debugging应用程序会导致应用程序崩溃,并使用EXC_BAD_ACCESS。 这已经解决了。 (15310896)

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

Jason Molenda在苹果开发者论坛上发言说:

我被告知可以使用此Xcode 5.0.2种子将应用程序提交到应用程序商店。

我确认我有完全相同的错误。 我的应用程序工作正常 升级到Xcode 5和小牛代码工作,但是当我debugging我不能跨越特定的行,因为我得到EXC_BAD_ACCESS。

所以我必须记住我不能通过的步骤,并在这些行之后放置断点或使用继续行来跳过这些有问题的行。

PS

下载Xcode 5.0.2 GM seed和debugging好得多。 到目前为止,我花了30分钟用新的Xcode。

请login开发人员网站并下载Xcode 5.0.2 GM种子 ,修复了这个bug。
请参阅发行说明 。

更新12-Nov-2013
Xcode 5.0.2已经发布,你可以从开发中心下载