MPAVController pauseWithFadeout causing app crash - ios

I have an application in which I have links for some videos and when requested by user I download the video files. The downloaded video files are listed in a UITableView. The app crashes occasionally with crash log similar to following.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x6000000c
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3a03fb26 objc_msgSend + 6
1 MediaPlayer 0x30ba3ff0 -[MPAVController _setState:] + 288
2 MediaPlayer 0x30b97f1a -[MPAVController pauseWithFadeout:] + 198
3 MediaPlayer 0x30b9cd22 -[MPAVController _itemPlaybackDidEndNotification:] + 786
4 CoreFoundation 0x2f90011e __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 10
5 CoreFoundation 0x2f874312 _CFXNotificationPost + 1714
6 AVFoundation 0x2e780b6e __avplayeritem_fpItemNotificationCallback_block_invoke + 4094
7 libdispatch.dylib 0x3a527d78 _dispatch_call_block_and_release + 8
8 libdispatch.dylib 0x3a527d64 _dispatch_client_callout + 20
9 libdispatch.dylib 0x3a52e7bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 264
10 CoreFoundation 0x2f90881c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
11 CoreFoundation 0x2f9070f0 __CFRunLoopRun + 1296
12 CoreFoundation 0x2f871ce2 CFRunLoopRunSpecific + 518
13 CoreFoundation 0x2f871ac6 CFRunLoopRunInMode + 102
14 GraphicsServices 0x3455f27e GSEventRunModal + 134
15 UIKit 0x32113a3c UIApplicationMain + 1132
16 MyApp 0x000e5884 main (main.m:30)
17 libdyld.dylib 0x3a54cab4 start + 0
The problem is that none of my own methods are shown to fail in the log. All calls seem to be library method calls. Also I wonder why _itemPlaybackDidEndNotification: was called as I encountered this when I was not even playing a video.
Can someone help?

I found the issue in my case. I was using thumbnailImageAtTime:timeOption: which seems to play/pause the video in the background(This is just my conjecture though) to get a thumbnail for it. That caused the itemPlaybackDidEndNotification to fire despite me not playing any video explicitly and cause further issues.
There are now a couple of alternatives if someone else is using same method for getting thumbnails. The methods are mentioned here. thumbnailImageAtTime: now deprecated - What's the alternative?

Related

StoreKit crash only ios 10

I got this crash from crashlytics. Do you know what is that mean? The crashlytics says; 100% crash from ios 10. I searched this bug, but I couldn't anything about it.
Edit: Crash Title
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
0 libobjc.A.dylib 0x186af6f30 objc_msgSend + 16
1 StoreKit 0x194ad1d0c <redacted> + 52
2 libdispatch.dylib 0x186f35200 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x186f351c0 _dispatch_client_callout + 16
4 libdispatch.dylib 0x186f39d6c _dispatch_main_queue_callback_4CF + 1000
5 CoreFoundation 0x188059f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6 CoreFoundation 0x188057b18 __CFRunLoopRun + 1660
7 CoreFoundation 0x187f86048 CFRunLoopRunSpecific + 444
8 GraphicsServices 0x189a09198 GSEventRunModal + 180
9 UIKit 0x18df60628 <redacted> + 684
10 UIKit 0x18df5b360 UIApplicationMain + 208
11 AppName 0x100126770 main (main.m:15)
12 libdispatch.dylib 0x186f685b8 (Missing)
EXC_BAD_ACCESS errors often occur when trying to send a message to an object that has been deallocated, or to nil.
In this case, the associated address 0x0000000000000000 and the top item objc_msgSend makes it pretty clear: a message was sent to a nil/null object.
If your code works on previous version of iOS, it may be because the object isn't being released at the same time, or because there is some new behavior of the APIs you are using that you aren't handling (for example: maybe an earlier function/API call now returns nil in iOS 10, but you just pass that through to somewhere else without checking it).

iPad Air Overheating for developer

Some of my application users are running iPad Air. I have had reports lately of the application crashing, but all the crash reports are just giving me the standard crashed in main method. After further investigation, I think the problem might be with the iPad overheating when they are taking photos.
Is there anything as a developer I can do to maybe save data before the application crashes from overheating?
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x180591b90 objc_msgSend + 16
1 Foundation 0x1818e2658 __NSFireDelayedPerform + 428
2 CoreFoundation 0x180ed1794 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
3 CoreFoundation 0x180ed1438 __CFRunLoopDoTimer + 884
4 CoreFoundation 0x180eceb4c __CFRunLoopRun + 1520
5 CoreFoundation 0x180df8c50 CFRunLoopRunSpecific + 384
6 GraphicsServices 0x1826e0088 GSEventRunModal + 180
7 UIKit 0x1860da088 UIApplicationMain + 204
8 intelliSPEC21 0x10009b56c main (AdvancedMain.m:10)
9 libdyld.dylib 0x1809968b8 start + 4

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000003

I have completed developing a Swift application using iOS SDK 8.1 and it is now being tested by external testers via TestFlight as beta. Recently, I have received a crash report via Crashlytics with the following stack trace:
0 libobjc.A.dylib objc_msgSend + 28 setRefreshControlState:
1 libdispatch.dylib _dispatch_call_block_and_release + 24
2 libdispatch.dylib _dispatch_client_callout + 16
3 libdispatch.dylib _dispatch_after_timer_callback + 92
4 libdispatch.dylib _dispatch_client_callout + 16
5 libdispatch.dylib _dispatch_source_latch_and_call + 792
6 libdispatch.dylib _dispatch_source_invoke + 288
7 libdispatch.dylib _dispatch_main_queue_callback_4CF + 424
8 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9 CoreFoundation __CFRunLoopRun + 1492
10 CoreFoundation CFRunLoopRunSpecific + 396
11 GraphicsServices GSEventRunModal + 168
12 UIKit UIApplicationMain + 1488
13 opsgenie AppDelegate.swift line 0 top_level_code
14 opsgenie AppDelegate.swift line 0 main
15 libdyld.dylib start + 4
I could not replicate the issue neither on my own device, nor on simulator and this crash has happened only once in three weeks. I have no idea about what may cause this crash and what this crash report means. I have also analysed my custom Crashlytics logs which are generated, however, everything seems normal and I still have no idea about the problem. I know it is nearly impossible to understand the problem by only having this stack trace on hand, but any recommendation/idea would be very useful.
you are using pull to refresh , while the content is loading user is going to another view hence the crash.try to replicate it on a slow connection while doing pull to refresh.you can make sure you handle startRefreshing, endRefreshing methods properly

Mysterious iOS crash with tiny stack trace

I have one user, and only one user, that regularly gets the following crash:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000192e7a984 objc_object::release() + 8
1 libobjc.A.dylib 0x0000000192e79474 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 524
2 CoreFoundation 0x0000000186855b38 _CFAutoreleasePoolPop + 28
3 CoreFoundation 0x0000000186915124 __CFRunLoopRun + 1460
4 CoreFoundation 0x0000000186855dd0 CFRunLoopRunSpecific + 452
5 GraphicsServices 0x000000018c53dc0c GSEventRunModal + 168
6 UIKit 0x0000000189986fc4 UIApplicationMain + 1156
7 MyApp 0x00000001001a92d0 main (main.m:17)
8 libdyld.dylib 0x0000000193453aa0 start + 4
This is the entire crash, and I have no clue what causes it.
The user has a pretty standard phone, but it only started happening when they got a replacement iPhone 5 earlier this year. Given that timeline and the fact they are the only one with the crash, might the phone itself be at fault?
Is there anywhere I could look for more information to default this information?

_UIDelayedPresentationContext beginDelayedPresentation causing crashes on iOS

I have been getting rather strange crash reports from my live app with stack traces like the following:
Thread 0: Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x38af7942 realizeClass(objc_class*) + 117
1 libsystem_malloc.dylib 0x390dbef5 szone_malloc_should_clear + 1376
2 libobjc.A.dylib 0x38af976f lookUpImpOrForward + 74
3 libobjc.A.dylib 0x38af1feb _class_lookupMethodAndLoadCache3 + 34
4 libobjc.A.dylib 0x38af1db9 _objc_msgSend_uncached + 24
5 UIKit 0x30e571bf __57-[_UIDelayedPresentationContext beginDelayedPresentation]_block_invoke + 26
6 libdispatch.dylib 0x38fd9d07 _dispatch_client_callout + 22
7 libdispatch.dylib 0x38fe2803 _dispatch_source_invoke$VARIANT$mp + 262
8 libdispatch.dylib 0x38fe073d _dispatch_main_queue_callback_4CF$VARIANT$mp + 188
9 CoreFoundation 0x2e3ef819 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x2e3ee0ed __CFRunLoopRun + 1300
11 CoreFoundation 0x2e358c27 CFRunLoopRunSpecific + 522
12 CoreFoundation 0x2e358a0b CFRunLoopRunInMode + 106
13 GraphicsServices 0x3302c283 GSEventRunModal + 138
14 UIKit 0x30bfc049 UIApplicationMain + 1136
This is rather mysterious because neither the main thread nor any of the other live threads in the reports seem to imply that this is caused by my code, though of course I am skeptical of this.
This seems to be a rather common crash according to the number of reports I receive from Crashlytics, yet I have not been able to reproduce it on my own devices. I suspect this is probably related to some memory management issues because the various crashes always end up being some bad pointers being sent messages.
This always happens on this thread and following the -[_UIDelayedPresentationContext beginDelayedPresentation]_block_invoke call. This is obviously a private class being referenced from within some Apple framework, however I am at a loss to figure out exactly which one could be calling this.
The app is an educational game and I suspect this could be related to the GameKit API (particularly the Game Center authentication dialogs).
All of these crashes have been happening exclusively on iOS 7 and on iPad only. The app is universal so it is interesting to see that iPhone users seem to be unaffected.
Does anybody have any previous experience with these private classes that could give me some hints?

Resources