iPhone模拟器在应用程序启动时崩溃

时间:2011-07-22 13:39:55

标签: iphone objective-c ios xcode ios-simulator

升级到Lion和XCode 4.1后,我遇到了一些iPhone模拟器问题。当我启动4.0,4.1或4.2(我从Time Machine恢复)的模拟器时,我立即得到EXC_BAD_ACCESS错误:

0x003c23dc  <+0012>  call   0x3c23e1 <__springboard_unimplemented+17>

在4.3上,我在objc_msgSend上立即收到EXC_BAD_ACCESS错误,据我所知,它在应用程序启动之前就已经发生了。

我尝试清理目标无济于事,NSZombieEnabled似乎没有帮助。

该应用程序在我的iPhone上完美运行。

编辑:卸载并重新安装Xcode,没有帮助。一个空白的新项目运行良好。在设置了一些断点后,看起来它在main.m中的这行上失败了(这不是很有帮助):

    int retVal = UIApplicationMain(argc, argv, nil, nil);

编辑:根据要求,这里的主题是全部申请bt:

对于4.2模拟器,重复约5800次,每次使用不同的存储器地址:

#0  0x003c23dc in __springboard_unimplemented ()
No symbol table info available.

后面是这样的东西:

#5817 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5818 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5819 0x90bdbc0c in abort ()
No symbol table info available.
#5820 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5821 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5822 0x90bdbc0c in abort ()
No symbol table info available.
#5823 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5824 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5825 0x90bdbc0c in abort ()
No symbol table info available.
#5826 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5827 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5828 0x90bdbc0c in abort ()
No symbol table info available.
#5829 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5830 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5831 0x90bdbc0c in abort ()
No symbol table info available.
#5832 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5833 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5834 0x90bdbc0c in abort ()
No symbol table info available.
#5835 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5836 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5837 0x90bdbc0c in abort ()
No symbol table info available.
#5838 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5839 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5840 0x90bdbc0c in abort ()
No symbol table info available.
#5841 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5842 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5843 0x90bdbc0c in abort ()
No symbol table info available.
#5844 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5845 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5846 0x90bdbc0c in abort ()
No symbol table info available.
#5847 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5848 0x003ca9c1 in getrlimit$UNIX2003 ()
No symbol table info available.
#5849 0x90bf564a in sysconf ()
No symbol table info available.
#5850 0x90be62a0 in __sinit ()
No symbol table info available.
#5851 0x90bdbdee in __swsetup ()
No symbol table info available.
#5852 0x90bdc1fa in vfprintf_l ()
No symbol table info available.
#5853 0x90be620e in fprintf ()
No symbol table info available.
#5854 0x003c2543 in __springboard_unimplemented ()
No symbol table info available.
#5855 0x003cacd1 in kill$UNIX2003 ()
No symbol table info available.
#5856 0x90bdbc0c in abort ()
No symbol table info available.
#5857 0x003c2548 in __springboard_unimplemented ()
No symbol table info available.
#5858 0x003ca9c1 in getrlimit$UNIX2003 ()
No symbol table info available.
#5859 0x90bf564a in sysconf ()
No symbol table info available.
#5860 0x90be62a0 in __sinit ()
No symbol table info available.
#5861 0x90bdbdee in __swsetup ()
No symbol table info available.
#5862 0x90bdc1fa in vfprintf_l ()
No symbol table info available.
#5863 0x90be620e in fprintf ()
No symbol table info available.
#5864 0x003c2543 in __springboard_unimplemented ()
No symbol table info available.
#5865 0x003ca9c1 in getrlimit$UNIX2003 ()
No symbol table info available.
#5866 0x90bf564a in sysconf ()
No symbol table info available.
#5867 0x90be62a0 in __sinit ()
No symbol table info available.
#5868 0x90bdbdee in __swsetup ()
No symbol table info available.
#5869 0x90bdc1fa in vfprintf_l ()
No symbol table info available.
#5870 0x90be620e in fprintf ()
No symbol table info available.
#5871 0x003c2543 in __springboard_unimplemented ()
No symbol table info available.
#5872 0x003cbbe9 in mmap$UNIX2003 ()
No symbol table info available.
#5873 0x90c01319 in allocate_pages ()
No symbol table info available.
#5874 0x90c08780 in create_scalable_zone ()
No symbol table info available.
#5875 0x90c3e48d in _malloc_initialize ()
No symbol table info available.
#5876 0x90c3e86b in malloc ()
No symbol table info available.
#5877 0x99aa8a62 in get_or_create_key_element ()
No symbol table info available.
#5878 0x99aa8c6b in _keymgr_get_and_lock_processwide_ptr_2 ()
No symbol table info available.
#5879 0x99aa8e4a in __keymgr_initializer ()
No symbol table info available.
#5880 0x9bed97b8 in libSystem_initializer ()
No symbol table info available.
#5881 0x8fe9415b in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
No symbol table info available.
#5882 0x8fe93cc0 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
No symbol table info available.
#5883 0x8fe91220 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
No symbol table info available.
#5884 0x8fe911b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
No symbol table info available.
#5885 0x8fe911b6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
No symbol table info available.
#5886 0x8fe921c0 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE ()
No symbol table info available.
#5887 0x8fe86656 in __dyld__ZN4dyld24initializeMainExecutableEv ()
No symbol table info available.
#5888 0x8fe8aef2 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
No symbol table info available.
#5889 0x8fe842ef in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKclS2_ ()
No symbol table info available.
#5890 0x8fe84063 in __dyld__dyld_start ()
No symbol table info available.

此处的完整输出:https://gist.github.com/b14502e1c6393d655653

对于4.3模拟器,我得到了这个:

Thread 4 (process 1938):
#0  0x905a6c22 in mach_msg_trap ()
No symbol table info available.
#1  0x905a61f6 in mach_msg ()
No symbol table info available.
#2  0x01bcad86 in __CFRunLoopServiceMachPort ()
No symbol table info available.
#3  0x01b27e74 in __CFRunLoopRun ()
No symbol table info available.
#4  0x01b27840 in CFRunLoopRunSpecific ()
No symbol table info available.
#5  0x01b27761 in CFRunLoopRunInMode ()
No symbol table info available.
#6  0x02db5903 in RunWebThread ()
No symbol table info available.
#7  0x90be8ed9 in _pthread_start ()
No symbol table info available.
#8  0x90bec6de in thread_start ()
No symbol table info available.

Thread 3 (process 1938):
#0  0x905a990a in kevent ()
No symbol table info available.
#1  0x03f28f36 in _dispatch_mgr_invoke ()
No symbol table info available.
#2  0x03f29333 in _dispatch_queue_invoke ()
No symbol table info available.
#3  0x03f29593 in _dispatch_worker_thread2 ()
No symbol table info available.
#4  0x90beab24 in _pthread_wqthread ()
No symbol table info available.
#5  0x90bec6fe in start_wqthread ()
No symbol table info available.

Thread 2 (process 1938):
#0  0x905a902e in __workq_kernreturn ()
No symbol table info available.
#1  0x90beaccf in _pthread_wqthread ()
No symbol table info available.
#2  0x90bec6fe in start_wqthread ()
No symbol table info available.

Thread 1 (process 1938):
#0  0x01d4f09f in objc_msgSend ()
No symbol table info available.
#1  0x00000000 in ?? ()
No symbol table info available.

编辑:重新安装了SDK,没有修复任何问题。

编辑:这是gcc命令(应用名称已更改)

CompileC /Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/Objects-normal/i386/SlideshowViewController.o Classes/SlideshowViewController.m normal i386 objective-c com.apple.compilers.llvmgcc42
cd /Users/kyle/dev/app/iphone
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DSTAGING_API=1 -DDEBUG=1 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility=hidden -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -iquote /Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/app-generated-files.hmap -I/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/app-own-target-headers.hmap -I/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/app-all-target-headers.hmap -iquote /Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/app-project-headers.hmap -I/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Products/Debug-iphonesimulator/include -IAirship/Library -IAirship/Library/AirshipLib -IAirship/Library/InboxLib -IAirship/Library/PushLib -IAirship/Library/StoreFrontLib -IAirship/Library/SubscriptionLib -IAirship/Common -I/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/DerivedSources/i386 -I/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/DerivedSources -F/Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Products/Debug-iphonesimulator -F/Users/kyle/dev/app/iphone -include /Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/PrecompiledHeaders/app_Prefix-gbcbcigtjfyhhsbcjwzscgyfdbfj/app_Prefix.pch -c /Users/kyle/dev/app/iphone/Classes/SlideshowViewController.m -o /Users/kyle/Library/Developer/Xcode/DerivedData/app-biyijbbdlfmlcihjougudvgjsxcd/Build/Intermediates/app.build/Debug-iphonesimulator/app.build/Objects-normal/i386/SlideshowViewController.o

7 个答案:

答案 0 :(得分:14)

好的,经过数周和数周之后,我终于找到了解决方案:根据此评论修复我的链接器标记:EXC_BAD_ACCESS when copying or retaining Block

基本上,您将-weak_library /usr/lib/libSystem.B.dylib更改为-weak-lSystem

我之前添加了这个,因为Urban Airship需要它。

答案 1 :(得分:4)

您缺少模拟器的一些核心功能。 Springboard是iOS的app-launcher“desktop”的名称,你的模拟器系统似乎认为它没有实现。

  

__springboard_unimplemented ()

这种差异可以解释为什么你在模拟器上遇到麻烦,而不是你的手机。

我建议完全删除Xcode和iOS SDK,然后从App Store重新安装。

编辑:我的一些谷歌搜索:

最后一个被深埋在Apple-Developer专属领域的范围内。这是一个来自论坛的文本转储,因此格式不是特别好,但它看起来是最有希望的。这看起来像底线:

  

您的应用程序因为名为abort()的内容而死亡,如应用程序特定信息中所示。回溯显示abort()由__springboard_unimplemented()调用,这意味着您正在调用模拟器中存在但可能不在设备上的函数。该函数是mcount_L1()。对mcount_L1()的调用来自分析工具。   要解决此问题,请确保在构建设置中未选中“生成配置文件代码”。

答案 2 :(得分:2)

你的问题的答案在于你写的:(我从Time Machine恢复)

您正在使用与Xcode 4.1安装不匹配的已恢复版本的模拟器。

使用不属于已安装SDK的任何模拟器,风险自负。

答案 3 :(得分:1)

我也碰到了这个。我通过删除我的/ Developer目录,安装Xcode 4.1,然后安装Xcode 4.2,然后安装最新的iTunes 10.5 beta来修复它。从那时起就没有问题。

答案 4 :(得分:1)

你说你升级到Lion。你安装了Xcode或Snow Leopard的Lion版本吗?在我看来,你需要在Lion上安装Lion的Xcode版本。

编辑: 修正案在评论中,放在这里。使用新的Lion安装重新创建项目文件并导入现有的源代码使事情再次发生。

答案 5 :(得分:0)

首先,你可以重置你的模拟器&amp;退出你的Xcode。之后,您可以删除iPhone模拟器中的应用程序文件夹。还从/ Library / Developer / Xcode / DerivedData中删除所有派生数据。然后打开你的项目&amp;根据您的应用功能检查是否缺少任何框架。

答案 6 :(得分:-1)

凯尔。我一直有一个非常相似的问题。在过去的几天里,我的应用程序在模拟器上崩溃,但在设备上工作正常。我一直很懒,只是在设备上进行测试。

但是当我今晚回到家时,我会尝试一些事情,看看能不能解决它。对我来说,崩溃不会在发射时发生。当我在textField中输入第二个字符时会发生这种情况。第一封信没有发生任何不好的事情。只在第二个。

崩溃发生在两个地方之一。一个与你的相同 - 在Main。第二个是文本字段的回调之一。它随机交替。调试窗口中没有堆栈跟踪。因为我面前没有电脑,所以我不记得所有的细节。

我们有一个共同点,就是我有狮子。我正在使用xcode 4.2

你知道赏金是否可以延长一两天吗?