I'm at my wits end, I'm getting a weird crash that only happens when the app is launched from Notification Center. Either tapping on a local notification (in the notification side) or a call to extensionContext:openURL:completionHandler (from my Today widget) will launch the app with a customURL scheme.
When the app is running (warm boot), no issues, works just as advertised. When I kill the app (in task switcher) and then try to launch it through Notification Center (cold boot), I get the below crash report.
I've search low and high for anything, can't find it. This only happens on iOS8 devices, iOS7 devices has no issue (with the notification launch, obviously no Today widget)
Has anyone seen this??
thanks!
Date/Time: 2014-10-14 18:16:39.924 -0400
Launch Time: 2014-10-14 18:16:38.667 -0400
OS Version: iOS 8.0.2 (12A405)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000016a4cbeb8
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000195ebbbd0 objc_msgSend + 16
1 UIKit 0x000000018a27d840 -[UIApplication workspaceDidEndTransaction:] + 216
2 FrontBoardServices 0x000000018da7563c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
3 CoreFoundation 0x000000018582a35c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
4 CoreFoundation 0x0000000185829464 __CFRunLoopDoBlocks + 308
5 CoreFoundation 0x0000000185827a88 __CFRunLoopRun + 1752
6 CoreFoundation 0x0000000185755660 CFRunLoopRunSpecific + 392
7 UIKit 0x000000018a05f4fc -[UIApplication _run] + 548
8 UIKit 0x000000018a05a4f4 UIApplicationMain + 1484
9 therichest 0x00000001001caa8c main (main.m:16)
10 libdyld.dylib 0x0000000196516a04 start + 0
Either your code or a third-party library you are using is manually spinning the runloop. This is causing -workspaceDidEndTransaction: to be called re-entrantly and triggers a use after free. If you set a breakpoint on -[NSRunLoop runMode:beforeDate:] and -[NSRunLoop runUntilDate:], it should hit with the guilty code being on the previous stack frame.
While manually spinning the run loop is never recommended, if you can delay doing it until your application finishes starting up (all the launch app delegate calls received) you should avoid hitting this crash.
Related
As I said in the title, I am writing an app for iPhone which runs perfectly in debug mode but when I build it as release and install it via TestFlight, it crashes at the first page
At my first page, it loads my in-app purchase record via cloud functions instead of raw api calling.
Would you please tell me how to obtain the logs from the release version of the app or testing the app via XCode which is under release mode ?
When I catch the crash log , that gives the following ;
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 bookledge 0x0000000104425398 0x1043f0000 + 218008
1 bookledge 0x000000010447f7b0 0x1043f0000 + 587696
2 libdispatch.dylib 0x00000001e8130a38 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x00000001e81317d4 _dispatch_client_callout + 16
4 libdispatch.dylib 0x00000001e81119e4 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 1008
5 CoreFoundation 0x00000001e868432c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6 CoreFoundation 0x00000001e867f264 __CFRunLoopRun + 1924
7 CoreFoundation 0x00000001e867e7c0 CFRunLoopRunSpecific + 436
8 GraphicsServices 0x00000001ea87f79c GSEventRunModal + 104
9 UIKitCore 0x000000021514fc38 UIApplicationMain + 212
10 bookledge 0x00000001043f7704 0x1043f0000 + 30468
11 libdyld.dylib 0x00000001e81428e0 start + 4
Extra: At the beginning, I create onBoard storyboard to put Main storyboard. Default starting point is Main. Given I have forced to turn users to redirect on OnBoard storyboard, somehow the view controller of the first page begins and calls viewDidLoad and viewWillAppear. When I finish scrolling to the end of the onBoard page and press the button, then ,
the first page begins and calls viewDidLoad and viewWillAppear again. Does this occurrence contribute to the crash log above?
Finally I finish my application so it is time to make some beta test. So I upload my application to itunes connect to test it out with test flight, but it keep crashing when I perform few task.
When I try to open the app from downloaded menu in test flight app.
When I try make a http request with AFnetworking
When I insert new record to CoreData
Sometime when i open the app from test flight it did not crash but show me a black screen after lauch screen.
I have been searching for 5 day without any clue. I been test it out with both release and debug mode running from xcode it doesn't crash at all. The problem only occur on if the app install from testflight. I think might be some memory allocated issues. It is a bug from testflight? How can I make the same behaviour happening at test flight happen in my xcode as well to know and fix the error.
I'm targeting ios 8.0 ++
Testing on iphone 7 plus(ios 10.2) and iphone 5s(ios 9.3).
Xcode 8.3.2
I get alot of difference crash report but most of it similiar to this one. Maybe I insert some nil value into dictionary? But why does it not happen when I build it from xcode.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x18319ee38 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x182803f80 objc_exception_throw + 56
2 CoreFoundation 0x183084554 -[__NSDictionaryM setObject:forKey:] + 924
3 Cellecter 0x1001db19c 0x100040000 + 1683868
4 Cellecter 0x1001dafe4 0x100040000 + 1683428
5 CoreFoundation 0x183140eac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
6 CoreFoundation 0x1831406cc _CFXRegistrationPost + 396
7 CoreFoundation 0x18314044c ___CFXNotificationPost_block_invoke + 60
8 CoreFoundation 0x1831a9494 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1532
9 CoreFoundation 0x18307e788 _CFXNotificationPost + 368
10 Foundation 0x183adfd1c postQueueNotifications + 684
11 CoreFoundation 0x1831547b0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
12 CoreFoundation 0x183152554 __CFRunLoopDoObservers + 372
13 CoreFoundation 0x183152884 __CFRunLoopRun + 672
14 CoreFoundation 0x18307cd10 CFRunLoopRunSpecific + 384
15 GraphicsServices 0x184964088 GSEventRunModal + 180
16 UIKit 0x188351f70 UIApplicationMain + 204
17 Cellecter 0x1001e8834 0x100040000 + 1738804
18 libdyld.dylib 0x182c1a8b8 start + 4
Updated: some how the my first and fourth question have been fix Now my question narrow it down to crashing when try to insert record into afnetworking.
This could be a lot of things.
It can be a migration issue with CoreData, a ManagedObjectContext issue.
The blackscreen could be a view issue.
Your question is too broad, we don't have code, we don't know your recent development.
Are you using real devices ? Emulators ? Which version of Xcode ? iOS deployment target ?
Please refer to this post next time you ask a question.
How to Ask
I finally manage to fix the issues. Actually the issues is quite simple, I will not be able to fix the issues if I don't symbolicate my crash report, actually the issues is on FCM, From here specifically say I need a production push certificate in order to receive the device token. Which the device token return nil every time and I attempt save the token to core data.
I am unable to find the reason of the crash. I know that the user was signing on to Game Centre. However, this was followed by the user starting to play 'MyApp'. I still can't find the error. I have read Apple tech doc and the 2010 video. Still unable to find the problem. Please help.
Incident Identifier: D3A80086-855D-400D-8102-7D08D04C2A4D
CrashReporter Key: 6b4377c06adbfe5d64bfb9dd348bd73e93859214
Hardware Model: iPhone5,4
Process: MyApp [280]
Path: /private/var/mobile/Containers/Bundle/Application/D5470DBE-1FF8-4E06-946B-910AD698DD2D/MyApp.app/MyApp
Identifier: MyApp
Version: 4 (4.86)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2015-12-26 01:10:15.15 +0400
Launch Time: 2015-12-26 01:06:30.30 +0400
OS Version: iOS 9.2 (13C75)
Report Version: 105
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread: 0
Filtered syslog:
None found
Breadcrumb Trail: (reverse chronological seconds)
6 logging-started
6 GC TBG: lookForEvent
224 GC Framework: startAuthenticationForExistingPrimaryPlayer
Global Trace Buffer (reverse chronological seconds):
6.978571 GameCenterFoundation 0x000000002eb776e1 callAuthHandlerWithError:Setting the Authentication Handler
6.989052 GameCenterFoundation 0x000000002eb886f5 GKMatchMaker: lookForInvite
6.989130 GameCenterFoundation 0x000000002ebb05d9 updateNearbyAdvertising
6.989130 GameCenterFoundation 0x000000002eb88485 finishedAuthenticating: Starting nearby Advertising and looking for invites
6.989724 GameCenterFoundation 0x000000002eb87f49 GKMatchmaker: loadConnectivitySettingsWithCompletionHandler
6.990383 GameCenterFoundation 0x000000002eb77663 Calling AuthenticationHandlerWithError: 0
7.056258 GameCenterUI 0x000000002f8067fd authenticationDidCompleteWithError:Local Player Authenticated, showing Welcome Banner
7.056258 GameCenterUI 0x000000002f8065f7 authenticationDidCompleteWithError being called
214.506726 GameCenterUI 0x000000002f8074e3 authenticationShowSignInUIForLocalPlayer:Showing sign in view controller
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp 0x000e8160 0xce000 + 106848
1 GameCenterFoundation 0x2ebc92c4 __39-[GKDispatchGroup notifyOnQueue:block:]_block_invoke53 + 12
2 libdispatch.dylib 0x228abdd6 _dispatch_call_block_and_release + 10
3 libdispatch.dylib 0x228abdc2 _dispatch_client_callout + 22
4 libdispatch.dylib 0x228b0670 _dispatch_main_queue_callback_4CF + 1532
5 CoreFoundation 0x22cd0fc4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
6 CoreFoundation 0x22ccf4be __CFRunLoopRun + 1590
7 CoreFoundation 0x22c21bb8 CFRunLoopRunSpecific + 516
8 CoreFoundation 0x22c219ac CFRunLoopRunInMode + 108
9 GraphicsServices 0x23e9baf8 GSEventRunModal + 160
10 UIKit 0x26f0dfb4 UIApplicationMain + 144
11 MyApp 0x000daa08 0xce000 + 51720
12 libdyld.dylib 0x228d4872 start + 2
I have this exactly same problem.
The apple reviewer report to check if my app is IPv6 compatible.
I reply him that my app use only Game Center to communicate, if this is a IPv6 problem, this should be a Game Center problem.
Anyway, in my experience, testing my app, this only happened when I change from Main Menu to Game Mode menu when the "Game Center Authentication Banner" is opened.
My game is developed in SceneKit and the menus are developed using SpriteKit inside the SceneView on Overlay layer.
To switch menus, I just change the SKScene in SceneView.
My iOS app keeps crashing. I found the way I could make it crash consistently. I repeated the operation multiple times and I get the same crash log every single time.
The crash happens if I do the following: launch the app, use it a bit (optional), go to the main screen, open a modal ViewController, dismiss it, keep using the app (optional), close the app (press home button, not kill the app), wait a bit (optional), re-open the app. When the app is re-opened, it crashes after 1 second. Note that where you are in the app when you leave it does not cause/prevent the crash. No matter where you are on the app, it crashes the same way. If I use the app and don't open the modal VC, I can send it in background and re-open it with no problem.
Here is some of the crash log I get every time (I took out what I thought was not related, I can provide the full log):
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x317d332c __pthread_kill + 8
1 libsystem_c.dylib 0x33ed0208 pthread_kill + 48
2 libsystem_c.dylib 0x33ec9298 abort + 88
3 libc++abi.dylib 0x36d56f64 abort_message + 40
4 libc++abi.dylib 0x36d54346 _ZL17default_terminatev + 18
5 libobjc.A.dylib 0x35321350 _objc_terminate + 140
6 libc++abi.dylib 0x36d543be _ZL19safe_handler_callerPFvvE + 70
7 libc++abi.dylib 0x36d5444a std::terminate() + 14
8 libc++abi.dylib 0x36d5581e __cxa_rethrow + 82
9 libobjc.A.dylib 0x353212a2 objc_exception_rethrow + 6
10 CoreFoundation 0x37572506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x37572366 CFRunLoopRunInMode + 98
12 GraphicsServices 0x33d31432 GSEventRunModal + 130
13 UIKit 0x3131ecce UIApplicationMain + 1074
14 ***my app name** 0x0006f140 0x6b000 + 16704
15 ***my app name** 0x0006d5f0 0x6b000 + 9712
It's hard to provide some code, and I don't even know what I could possibly give..
I'd love some help, I have no idea why this is happening..
Feels to me like some cleanup is happening whilst you're in the background. If it's not iOS 6 then check what you;re doing to handle viewDidUnload and in any version, check what you're doing in viewWillDisappear/viewDidDisappear and viewWillAppear/viewDidAppear.
I've been getting some low level crashes lately, and this one in particular is hard to determine the origin / state of the app. Has anyone seen this or know the problem? Thanks!
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x3dcccccd
Crashed Thread: 0
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x3dcccccd
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000025fa objc_msgSend + 18
1 UIKit 0x00162d1c -[UIAlertView(Private) _performPopup:] + 12
2 UIKit 0x001628de -[UIAlertView(Private) _repopup] + 10
3 UIKit 0x0016d196 -[UIAlertView(Private) _removeAlertWindowOrShowAnOldAlert] + 70
4 UIKit 0x00162afa -[UIAlertView(Private) _popoutAnimationDidStop:finished:] + 502
5 UIKit 0x00050ae4 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
6 UIKit 0x000509ee -[UIViewAnimationState animationDidStop:finished:] + 34
7 QuartzCore 0x0002ee8c run_animation_callbacks(double, void*) + 284
8 QuartzCore 0x0002ed2c CA::timer_callback(__CFRunLoopTimer*, void*) + 96
9 CoreFoundation 0x00022d1c CFRunLoopRunSpecific + 2092
10 CoreFoundation 0x000224da CFRunLoopRunInMode + 42
11 GraphicsServices 0x000030d4 GSEventRunModal + 108
12 GraphicsServices 0x00003180 GSEventRun + 56
13 UIKit 0x0000342a -[UIApplication _run] + 374
14 UIKit 0x00001954 UIApplicationMain + 636
15 iPadDrinkHub.1.0.7 0x00002f24 0x1000 + 7972
16 iPadDrinkHub.1.0.7 0x00002ed8 0x1000 + 7896
Weird crashes are sometimes a symptom of memory corruption and/or mismanagement. I just found and fixed a difficult-to-find bug in one of my apps a few days ago. The app had been working flawlessly for 6 months on iOS 3.2, but would crash instantly on iOS 4.2. The crash was happening while adding the main view to the window during applicationDidFinishLaunching. The stack trace showed 100% iOS code; there wasn't a single function of mine in there anywhere (except for applicationDidFinishLaunching). It turned out I was over-releasing a UIImage in code that had been called earlier while views were getting loaded. (I was mistakenly calling release on an autoreleased UIImage).
I haven't seen the specific crash that you're seeing, but here are a few things you can try that may shed some light:
(1) Run the app with NSZombieEnabled. This is an environment variable you set via Xcode that will often identify places where you may be referencing objects that have already been freed (e.g., like the over-release example I mentioned earlier). Additional details are here:
http://www.cocoadev.com/index.pl?NSZombieEnabled
(2) You can turn on logging that will log all messages sent to all objects. The log is a written to a text file in the tmp folder. If you inspect the log file leading up to the crash, you may gain some insight into what's happening right before the crash. This is actually the technique I used to solve my bug. You can either modify your code to enable/disable logging:
instrumentObjcMessageSends(YES);
// Do stuff...
instrumentObjcMessageSends(NO);
Or, you can call the function directly from the debugger. For example, set a breakpoint right before the crash, then drop into the debugger console and do this:
(gdb) call (void)instrumentObjcMessageSends(YES)
Additional details are here:
http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/