0

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?

zambrey
  • 1,452
  • 13
  • 21
  • At 16, it says MyApp. Is that your app? If so, you need to symbolicate that. – yeesterbunny Oct 21 '13 at 23:42
  • @yeesterbunny I re-symbolicated the log. The call you are referring to is a call to main. – zambrey Oct 22 '13 at 15:08
  • Have you tried playing the video file that causes the crash on your computer to see if it is corrupt? – RyanR Oct 22 '13 at 15:09
  • @RyanR That's what seems weird in here. I wasn't even trying to play the video when the crash happened as stated in the question. But yes the file is alright, I checked that. – zambrey Oct 22 '13 at 15:14
  • You may not have been intending to play the file, but MPAVController was definitely cleaning up after playback. Any chance you've got media methods being called on the wrong queue/thread? – RyanR Oct 22 '13 at 15:15
  • @RyanR I haven't created any of my own new threads in code, so the threads that I have are whatever runtime provides me with. – zambrey Oct 22 '13 at 15:37

1 Answers1

0

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?

Community
  • 1
  • 1
zambrey
  • 1,452
  • 13
  • 21