title: iPhone simulators crash on app launch
body: <p>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 <code>EXC_BAD_ACCESS</code> error pretty much immediately on this:</p>
  
  <pre><code>0x003c23dc  &lt;+0012&gt;  call   0x3c23e1 &lt;__springboard_unimplemented+17&gt;
  </code></pre>
  
  <p>On 4.3, I also get an EXC_BAD_ACCESS error immediately, on <code>objc_msgSend</code>, and from what I can tell, it's happening before the application even launches. </p>
  
  <p>I've tried cleaning the targets to no avail, and NSZombieEnabled doesn't seem to help.</p>
  
  <p>The app runs perfectly on my iPhone.</p>
  
  <p><strong>EDIT</strong>: 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):</p>
  
  <pre><code>    int retVal = UIApplicationMain(argc, argv, nil, nil);
  </code></pre>
  
  <p><strong>EDIT</strong>: As requested, here's the thread apply all bt full:</p>
  
  <p>For the 4.2 simulator, this is repeated ~5800 times, with a different memory address each time:</p>
  
  <pre><code>#0  0x003c23dc in __springboard_unimplemented ()
  No symbol table info available.
  </code></pre>
  
  <p>which is followed by stuff like this:</p>
  
  <pre><code>#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.
  </code></pre>
  
  <p>Full output here: <a href="https://gist.github.com/b14502e1c6393d655653" rel="nofollow">https://gist.github.com/b14502e1c6393d655653</a></p>
  
  <p>For the 4.3 simulator, I get this:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p><strong>EDIT</strong>: Reinstalled the SDK, didn't fix anything.</p>
  
  <p><strong>EDIT</strong>: Here's the gcc command (with the app name changed)</p>
  
  <pre><code>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
  </code></pre>