phawind111 / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

iOS Crash going to background #634

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Basically the same as 
https://code.google.com/p/google-cast-sdk/issues/detail?id=361, and 
https://code.google.com/p/google-cast-sdk/issues/detail?id=630. But those are 
closed.

What steps will reproduce the problem?
1. Connect iOS sender to remote Chromecast receiver.
2. Background the iOS sender app i.e. press the hardware Home button on the iOS 
device.
3. See crashlog generated on iOS device.

NOTE1: GCKDeviceManager 
initWithDevice:clientPackageName:ignoreAppStateNotifications:NO reproduces the 
bug, and changing to ignoreAppStateNotifications:YES makes it go away.
NOTE2: I swizzled NSNotificationCenter, and it appears to be that 
postNotificationName:object:userInfo is doing obj_msgSend to [nil 
notifyConnectionSuspendedWithReason:].
NOTE3: the notificationName is UIApplicationDidEnterBackgroundNotification.
NOTE4: I see what might be a possible race going on with GCKDeviceManager; the 
crash happens immediately after the GCKDeviceManager removes itself from 
NSNotificationCenter.

What version of the product are you using? On what operating system?
Mac OS X 10.10 / Xcode 6.4 / iPad Mini (MGNR2LL/A) / iOS 8.1.2 (12B440) / Cast 
SDK reports kGCKFrameworkVersion = 2.7.1.2664.

What is the expected output? What do you see instead?
Expected: no crash.
Actual:
Incident Identifier: A1E882F7-D18F-4848-955F-0BF2E971EB86
CrashReporter Key:   2ffca8715c57090d61aa95243f739aadabb2c175
Hardware Model:      iPad4,7
Process:             ChromecastSampleApp [5091]
Path:                
/private/var/mobile/Containers/Bundle/Application/63E50FBB-1420-4864-9468-733A5D
2F8C05/ChromecastSampleApp.app/ChromecastSampleApp
Identifier:          com.ooyala.ChromecastSampleApp
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2015-08-17 13:19:25.165 -0700
Launch Time:         2015-08-17 13:19:17.886 -0700
OS Version:          iOS 8.1.2 (12B440)
Report Version:      105

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x0000000197fbfbd0 objc_msgSend + 16
1   CoreFoundation                  0x000000018747cae0 
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 16
2   CoreFoundation                  0x00000001873bb21c _CFXNotificationPost + 
2056
3   Foundation                      0x00000001882bacbc -[NSNotificationCenter 
postNotificationName:object:userInfo:] + 68
4   UIKit                           0x000000018bf167e0 -[UIApplication 
_handleApplicationDectivationWithScene:shouldForceExit:transitionContext:complet
ion:] + 1128
5   UIKit                           0x000000018bf1ecb8 __88-[UIApplication 
_handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_i
nvoke + 88
6   UIKit                           0x000000018bf1ec40 -[UIApplication 
_handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 376
7   UIKit                           0x000000018bf12574 -[UIApplication 
scene:didUpdateWithDiff:transitionContext:completion:] + 508
8   FrontBoardServices              0x000000018f721628 __31-[FBSSerialQueue 
performAsync:]_block_invoke + 24
9   CoreFoundation                  0x000000018748ea24 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
10  CoreFoundation                  0x000000018748db2c __CFRunLoopDoBlocks + 308
11  CoreFoundation                  0x000000018748c150 __CFRunLoopRun + 1752
12  CoreFoundation                  0x00000001873b90a0 CFRunLoopRunSpecific + 392
13  GraphicsServices                0x00000001905375a0 GSEventRunModal + 164
14  UIKit                           0x000000018bcee3bc UIApplicationMain + 1484
15  ChromecastSampleApp             0x0000000100093384 main (main.m:14)
16  libdyld.dylib                   0x000000019861aa04 start + 0

Original issue reported on code.google.com by jonsl...@ooyala.com on 17 Aug 2015 at 8:19

GoogleCodeExporter commented 8 years ago
I have not been able to build a repro case using the Google sample 
sender+receivers. This crash is happening in our own paired sender & receiver 
testing.

Original comment by jonsl...@ooyala.com on 17 Aug 2015 at 8:21

GoogleCodeExporter commented 8 years ago
Please refrain from creating duplicates of already existing tickets. Any 
updates to this issue will be posted in Issue 630.

Original comment by jonathan...@google.com on 17 Aug 2015 at 8:40

GoogleCodeExporter commented 8 years ago
I think I've found where out code, not Google's, is causing the problem: 
"Unless indicated otherwise, the caller should not release the delegating 
GCKDeviceManager object from within a delegate method." I found where the rule 
was not being adhered to. A change to delay setting our reference to the 
GCKDeviceManager makes the crash go away. Please close this ticket, thank you.

Original comment by jonsl...@ooyala.com on 17 Aug 2015 at 8:43

GoogleCodeExporter commented 8 years ago
Apologies re: duplicates. It is unclear to me what the policy is for this 
project: are issues which are marked 'closed' ever reviewed? Hence opening a 
new one. Sorry for the thrashing, thanks for your support.

Original comment by jonsl...@ooyala.com on 17 Aug 2015 at 8:44

GoogleCodeExporter commented 8 years ago
Closed issues are still monitored for activity in case the issue comes up again 
or we decide to investigate further. Therefore, you should keep subsequent 
comments/questions restricted to the initial ticket instead of filing a new one 
each time.

Original comment by jonathan...@google.com on 17 Aug 2015 at 8:54

GoogleCodeExporter commented 8 years ago
Thanks, got it. I believe this one has been our fault all along. Please close.

Original comment by jonsl...@ooyala.com on 17 Aug 2015 at 8:56

GoogleCodeExporter commented 8 years ago

Original comment by jonathan...@google.com on 17 Aug 2015 at 9:19