sage444
sage444

Reputation: 5684

ios app strange crash on start

My project, called OBI, works fine when launched from Xcode, but when I create .ipa file its crashes with provided log. In project no classes with names: Mutex, DelayedPointerDeletionManager or MemoryManager, so I can't understood from where this exception.

Thread 0 Crashed:
0   libsystem_pthread.dylib         0x396b7046 _pthread_mutex_check_init + 14
1   libsystem_pthread.dylib         0x396b6e32 _pthread_mutex_lock + 22
2   OBI                             0x02a74f20 Mutex::Lock() (Mutex.cpp:152)
3   OBI                             0x02838930 DelayedPointerDeletionManager::AddPointerToMainThreadDealloc(void*, MemLabelId) (Mutex.h:32)
4   OBI                             0x028384a4 MemoryManager::Deallocate(void*, MemLabelId) (MemoryManager.cpp:1082)
5   OBI                             0x028384e4 operator delete[](void*) (MemoryManager.cpp:114)
6   OBI                             0x01d28010 std::locale::locale<boost::filesystem::detail::utf8_codecvt_facet>(std::locale const&, boost::filesystem::detail::utf8_codecvt_facet*) (locale_classes.h:581)
7   OBI                             0x01d281c4 ___lldb_unnamed_function148423$$OBI + 232
8   dyld                            0x2be5b59e ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 174
9   dyld                            0x2be5b6ac ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 16
10  dyld                            0x2be58d34 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 356
11  dyld                            0x2be58b88 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 36
12  dyld                            0x2be4fd38 dyld::initializeMainExecutable() + 164
13  dyld                            0x2be52ab4 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 1748
14  dyld                            0x2be4f22a dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 346
15  dyld                            0x2be4f064 _dyld_start + 60

Edit, few lines from console.

Oct 16 14:43:18 Sergiys-iPad kernel[0] <Debug>: launchd[9526] Container: /private/var/mobile/Applications/AA46736B-6348-42BA-A8F0-DD63DC535AF6 (sandbox)
Oct 16 14:43:19 Sergiys-iPad ReportCrash[9527] <Notice>: ReportCrash acting against PID 9526
Oct 16 14:43:19 Sergiys-iPad ReportCrash[9527] <Notice>: Formulating crash report for process OBI[9526]
Oct 16 14:43:19 Sergiys-iPad com.apple.launchd[1] (UIKitApplication:com.mycompany.OBIQA[0x14dc][9526]) <Warning>: (UIKitApplication:com.mycompany.OBIQA[0x14dc]) Job appears to have crashed: Segmentation fault: 11
Oct 16 14:43:19 Sergiys-iPad com.apple.launchd[1] (UIKitApplication:com.mycompany.OBIQA[0x14dc]) <Notice>: (UIKitApplication:com.mycompany.OBIQA[0x14dc]) Throttling respawn: Will start in 2147483647 seconds
Oct 16 14:43:19 Sergiys-iPad backboardd[28] <Warning>: Application 'UIKitApplication:com.mycompany.OBIQA[0x14dc]' exited abnormally with signal 11: Segmentation fault: 11
Oct 16 14:43:19 Sergiys-iPad SpringBoard[33] <Warning>: Application 'com.mycompany.OBIQA' has failed to launch too many times. Not relaunching.
Oct 16 14:43:19 Sergiys-iPad ReportCrash[9527] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/OBI_2013-10-16-144319_Sergiys-iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

I will be very pleased for any help, or direction to dig

EDIT Finally I found what causes this exception. Is symbol striping option in build setting, after I changed it from all symbols to debug symbols everything become fine.

Upvotes: 5

Views: 7228

Answers (3)

Keith Kowalczykowski
Keith Kowalczykowski

Reputation: 41

This is crashing in the dynamic loader as iOS loads your classes into memory. Part of this process is calling +load on any classes that implement the method.

One possibility is that you are doing too much work in +load, and are being killed with a "Failed to launch in time". Providing the full crash log would show whether this is the case.

Upvotes: 4

wattson12
wattson12

Reputation: 11174

From what I can see (it would help if you show some code, especially your applicationDidFinishLaunching method) it looks like your app is taking too long to launch and is being killed by the OS.

An app has a certain time limit to set up a root view controller and do any basic set up. if it takes too long, the OS considers it non responsive and kills it. You won't notice this problem when launching from Xcode because the time limit is disabled when launching with a debugger attached: see here https://developer.apple.com/library/ios/qa/qa1592/_index.html

If you are downloading an image in your app delegate I would suggest switching to an asynchronous approach, and also probably handling the image loading from the view controller which will use the image

edit: it looks like you get a different error from the console than the Q&A describes, but without any code I can't help much more than that

Upvotes: 0

Laurent Cerveau
Laurent Cerveau

Reputation: 152

ImageLoader is linked to the loading of code pieces (external framework, libraries). You should make sure you all those are "see-able" by your binary. Building in XCode can put all in the same folder so you have no path issue but, an din particularly if you are referencing third parties framework you need to make sure they can be "seen" by the main executable. Does the console spit anything?

Upvotes: 0

Related Questions