2

I have a problem in my app. My app is using internet connection. When I run it in the device from the Xcode its running without crashing. But when I install it fisttime it runs, but if I close the app and then try to again run after loading the splash screen it crashes. Why is that? But this is working when I'm run the app through the xcode in the device.

But when I use 3G instead of wifi it goes beyond the splash screen

Updated

Incident Identifier: 5AAF8220-55D5-4011-B14A-F9A86C624F7C
CrashReporter Key:   f0828a82293c0951598f3501da6c4cc391e66276
Hardware Model:      iPad1,1
Process:         mMusic [303]
Path:            /var/mobile/Applications/6D985396-5C2A-430D-B605-617EFA46A470/mMusic.app/mMusic
Identifier:      mMusic
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-09-25 10:11:07.842 +0530
OS Version:      iPhone OS 5.1.1 (9B206)
Report Version:  104

Exception Type:  00000020
Exception Codes: 0x8badf00d
Highlighted Thread:  0

Application Specific Information:
com.microimage.mMusic failed to launch in time

Elapsed total CPU time (seconds): 1.050 (user 1.050, system 0.000), 5% CPU 
Elapsed application CPU time (seconds): 0.237, 1% CPU

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x357fb004 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x357fb1fa mach_msg + 50
2   CoreFoundation                  0x357693ec __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x35768124 __CFRunLoopRun + 876
4   CoreFoundation                  0x356eb49e CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x356eb366 CFRunLoopRunInMode + 98
6   CFNetwork                       0x314ade14 CFURLConnectionSendSynchronousRequest + 340
7   Foundation                      0x34b304a6 +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 242
8   Foundation                      0x34b54356 -[NSData(NSData) initWithContentsOfURL:] + 178
9   Foundation                      0x34b85174 +[NSData(NSData) dataWithContentsOfURL:] + 36
10  mMusic                          0x0013b2a4 0xa5000 + 615076
11  mMusic                          0x0012fc34 0xa5000 + 568372
12  mMusic                          0x000a6b96 0xa5000 + 7062
13  UIKit                           0x32ecdca4 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1176
14  UIKit                           0x32ec77d6 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 402
15  UIKit                           0x32e95abc -[UIApplication handleEvent:withNewEvent:] + 1004
16  UIKit                           0x32e95560 -[UIApplication sendEvent:] + 48
17  UIKit                           0x32e94f34 _UIApplicationHandleEvent + 5820
18  GraphicsServices                0x33487224 PurpleEventCallback + 876
19  CoreFoundation                  0x3576951c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
20  CoreFoundation                  0x357694be __CFRunLoopDoSource1 + 134
21  CoreFoundation                  0x3576830c __CFRunLoopRun + 1364
22  CoreFoundation                  0x356eb49e CFRunLoopRunSpecific + 294
23  CoreFoundation                  0x356eb366 CFRunLoopRunInMode + 98
24  UIKit                           0x32ec6864 -[UIApplication _run] + 544
25  UIKit                           0x32ec3cce UIApplicationMain + 1074
26  mMusic                          0x000a638c 0xa5000 + 5004
27  mMusic                          0x000a62e8 0xa5000 + 4840

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x357fb3a8 kevent + 24
1   libdispatch.dylib               0x33b2eea4 _dispatch_mgr_invoke + 708
2   libdispatch.dylib               0x33b2ebc2 _dispatch_mgr_thread + 30

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x357fb004 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x357fb1fa mach_msg + 50
2   CoreFoundation                  0x357693ec __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x35768124 __CFRunLoopRun + 876
4   CoreFoundation                  0x356eb49e CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x356eb366 CFRunLoopRunInMode + 98
6   WebCore                         0x37431c9c _ZL12RunWebThreadPv + 396
7   libsystem_c.dylib               0x349b472e _pthread_start + 314
8   libsystem_c.dylib               0x349b45e8 thread_start + 0

Thread 3 name:  com.apple.NSURLConnectionLoader
Thread 3:
0   libsystem_kernel.dylib          0x357fb004 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x357fb1fa mach_msg + 50
2   CoreFoundation                  0x357693ec __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x35768124 __CFRunLoopRun + 876
4   CoreFoundation                  0x356eb49e CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x356eb366 CFRunLoopRunInMode + 98
6   Foundation                      0x34b30bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7   Foundation                      0x34b30a7a -[NSThread main] + 66
8   Foundation                      0x34bc458a __NSThread__main__ + 1042
9   libsystem_c.dylib               0x349b472e _pthread_start + 314
10  libsystem_c.dylib               0x349b45e8 thread_start + 0

Thread 4 name:  com.apple.CFSocket.private
Thread 4:
0   libsystem_kernel.dylib          0x3580b570 __select + 20
1   CoreFoundation                  0x3576d63a __CFSocketManager + 726
2   libsystem_c.dylib               0x349b472e _pthread_start + 314
3   libsystem_c.dylib               0x349b45e8 thread_start + 0

Unknown thread crashed with unknown flavor: 5, state_count: 1
halfer
  • 19,824
  • 17
  • 99
  • 186
iDia
  • 1,397
  • 8
  • 25
  • 44

3 Answers3

17

Looks like your application was killed by the Springboard because it failed to launch before the watchdog timer expired.

Exception Codes: 0x8badf00d

Application Specific Information:
com.microimage.mMusic failed to launch in time

It looks like you are making a synchronous call to download data at application launch. This is blocking the main thread causing application to not launch in time. You should allow the application to launch completely first and then initiate the network call on background thread (not the main thread).

Read more from these links: Link1, Link2

The exception code 0x8badf00d indicates that an application has been terminated by iOS because a watchdog timeout occurred. The application took too long to launch, terminate, or respond to system events. One common cause of this is doing synchronous networking on the main thread. Whatever operation is on Thread 0: needs to be moved to a background thread, or processed differently, so that it does not block the main thread.

Hope that helps!

Amar
  • 13,202
  • 7
  • 53
  • 71
3

If you get Exception Type: 00000020 and Exception Codes: 0x8badf00d in your crash log then it is due to running synchronous task on main thread. Solution is to use asynchronous task on main thread.

It is referred to as watchdog timeout crash reports. You can check this Apple document for details.

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
0

Seeing a similar crash for our watchos 3 app.

Part of the problem was it was difficult to get a complete crash report. Only when I was able to reliably reproduce the crash and repeated it 20-30 times did I get a single coherent crash report with a stack trace. Saw many partial reports with some json including kernel, crashReporterKey, memoryPages etc. but only one complete report with a stack trace.

Another problem, xcode never connected to the device while debugging. Of course, the app was killed for taking to long to start, so the debugger is of no use. Same symptoms with simulator.

Solution: we were activating our wcsession in our extension delegate's applicationDidFinishLaunching. Activation is asynchronous, so I assumed this was ok. Moving session activation to applicationDidBecomeActive have fixed the issue.

druest
  • 21
  • 3