iOS应用程序在每次启动时崩溃,都找不到错误

Bea*_*lle 81 crash xcode sigabrt ios ios-simulator

我第一次启动应用程序,一切似乎运行正常.我会点击停止按钮,做一些工作,当我再次启动时,它似乎在它甚至可以加载任何东西之前崩溃.按停止,再次点击运行,它工作正常.直到我重复这个过程.

这是xcode用"Thread 1:signal SIGABRT"突出显示错误的地方.显然这里没什么用.

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([PokerAppDelegate class]));
    }
}
Run Code Online (Sandbox Code Playgroud)

调试控制台除了(lldb)之外什么也没显示(所以我想它停止了,此时没有崩溃)所以,当我执行BT这个时,我得到的是:

(lldb) bt
* thread #1: tid = 0x1c03, 0x9a258a6a libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
    frame #0: 0x9a258a6a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x99ea1b2f libsystem_c.dylib`pthread_kill + 101
    frame #2: 0x04a7057b libsystem_sim_c.dylib`abort + 140
    frame #3: 0x01dc0b4e GraphicsServices`GSRegisterPurpleNamedPort + 348
    frame #4: 0x01dc069f GraphicsServices`_GSEventInitialize + 123
    frame #5: 0x01dc0c1f GraphicsServices`GSEventInitialize + 36
    frame #6: 0x000163f9 UIKit`UIApplicationMain + 600
    frame #7: 0x00001d0d Guitar Chord Poker HD`main(argc=1, argv=0xbffff32c) + 141 at main.m:16
    frame #8: 0x00001c35 Guitar Chord Poker HD`start + 53
(lldb) 
Run Code Online (Sandbox Code Playgroud)

这是我到目前为止所做的:

  • 执行'清洁'
  • 我重置了模拟器并重置了我的电脑
  • 我已经注释掉了视图控制器中的所有代码,仍然崩溃了
  • 我已经注释掉了app委托中的所有代码,但仍然崩溃了
  • 但是......我在Xcode以外的设备上运行应用程序,它似乎工作得非常好.
  • (编辑)我删除/重新安装了xcode,以及来自各种缓存文件夹的所有内容(模拟器,文档)(这会阻止xcode在新下载后自动重新安装旧版本).仍然无法找到保存命令行工具的位置.仍然崩溃.

尽管如此,应用程序仍然会在每秒/其他发布时崩溃.

在最近的Xcode更新之前,我没有遇到任何问题.它可能是一个Xcode错误吗?

(编辑)我也在运行最新的OSX开发者版本.这会干扰吗?

nev*_*ing 75

似乎是OS X 10.8.4和LLDB组合.正如肯斯特所说,切换到GDB会使问题消失.

Edit:
It's caused by a race condition in the debug server (I hear).

Here's a fix if you want to keep using LLDB: Instead of clicking Run while the app is already running in the simulator, kill it in Xcode (?-.), say "I love Xcode" 5 times and Run it again (?-R). It won't crash, I tested it.


Fixed in Xcode 4.6.3.

  • 你和提问者是我个人最喜欢的人.这让我疯了,到了我要将MBP送去修理的地方. (2认同)

ken*_*ter 11

我也有这个问题.看看这篇文章.Xcode 4.6.2应用程序每次运行都会崩溃

基本上将调试器从LLDB更改为GDB.我不敢相信这是因为LLDB有问题.

  • 感谢您提供的信息,昨天整天让我疯狂.为什么我一直等到我在搜索这里之前拔掉所有(剩下的)头发!大声笑. (2认同)