开发者

iPhone simulators crash on app launch

I'm having some issues with the iPhone simulators after upgrading to Lion and XCode 4.1. When I launch the simulator for 4.0, 4.1 or 4.2 (which I restored from Time Machine), I get an EXC_BAD_ACCESS error pretty much immediately on this:

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

On 4.3, I also get an EXC_BAD_ACCESS error immediately, on objc_msgSend, and from what I can tell, it's happening before the application even launches.

I've tried cleaning the targets to no avail, and NSZombieEnabled doesn't seem to help.

The app runs perfectly on my iPhone.

EDIT: Uninstalled and reinstalled Xcode, didn't help. A blank new project runs fine. After setting some breakpoints, it looks like it's failing on this line in main.m (which isn't very helpful):

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

EDIT: As requested, here's the thread apply all bt full:

For the 4.2 simulator, this is repeated ~5800 times, with a different memory address each time:

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

which is followed by stuff like this:

#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.

Full output here: https://gist.github.com/b14502e1c6393d655653

For the 4.3 simulator, I get this:

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.

EDIT: Reinstalled the SDK, didn't fix anything.

EDIT: Here's the gcc command (with the app name changed)

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


Ok, so after weeks and weeks, I finally found the solution: fixing my linker flags according to this comment: EXC_BAD_ACCESS when copying or retaining Block

Essentially you change -weak_library /usr/lib/libSystem.B.dylib to -weak-lSystem.

I had originally added this because Urban Airship required it.


You're missing some core functionality for the simulator. Springboard is the name of the app-launcher "desktop" for iOS, and your simulator system seems to think it's unimplemented.

__springboard_unimplemented ()

This discrepency would explain why you're having trouble on the simulator, and not your phone.

I would suggest a full removal of Xcode and the iOS SDK, then reinstall fresh from the App Store.

EDIT: Some of my Googlings:

  • https://discussions.apple.com/thread/3028002?start=0&tstart=0
  • http://twitter.com/#!/gparker/status/16728366321
  • http://pastie.org/2271247

The last one was buried deep within the confines of Apple-Developer-only territory. It's a text-dump from a forum, so it's not formatted particularly well, but it looks to be the most promising. This looks like the bottom line:

Your app died because something called abort(), as shown in the Application Specific Information. The backtrace shows that abort() was called by __springboard_unimplemented(), which means you're calling a function that is present in the simulator but may not be on the device. That function is mcount_L1(). Calls to mcount_L1() come from profiling tools. To fix this, make sure you have "Generate Profile Code" unchecked in your build settings.


The answer to your problem lies in what you have written: (which I restored from Time Machine).

You are using a restored version of the Simulator that do not match your Xcode 4.1 installation.

Using any Simulator not part of the installed SDK is done at your own risk.


I ran into this as well. I fixed it by removing my /Developer dir, installing Xcode 4.1, then installing Xcode 4.2, THEN installing the latest iTunes 10.5 beta. Haven't had issues since.


You said you upgraded to Lion. Did you install the Lion build of Xcode or the Snow Leopard one? This looks to me like you need to install the Lion build of Xcode on Lion.

edit: The fix is in the comments, putting it here. Recreating the project file using the fresh lion installation and importing the existing source code got things going again.


Firstly you can reset your simulator & quit your Xcode. After that you can delete the Application Folder in iPhone Simulator & also delete all derived data from /Library/Developer/Xcode/DerivedData. Then open your project & check whether any framework is missing or not according to your app functionality.


Kyle. I have been having a hugely similar problem. For the last few days my app crashes on the simulator but works fine on the device. I have been lazy and just testing on the device.

But when I get home tonight, I will try out some things and see if I can resolve it. For me the crash does not happen right upon launch. It happens when I type in the second character in a textField. Nothing bad happens on the first letter. Only on the second.

The crash occurs in one of two places. One is just the same as in yours - in Main. The second is in one of the textfield's callbacks. It randomly alternates. There is no stack trace in the debug window. Because I dont have the computer in front of me, I cannot remember all the details.

One thing we have in common is that I have lion. I am using xcode 4.2

Do you know if the bounty can be extended for a day or two?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜