是什么导致了iOS MediaPlayer崩溃?
我们收到了一些关于堆栈痕迹的崩溃报告,这些痕迹对我们来说很难破译。堆栈跟踪完全在MealApple、Boundation、CoundFoundation和LIB Stuly.C.DyLIB中。不幸的是,我们无法在任何开发设备上复制,因此故障排除被证明是有问题的 下面是堆栈跟踪的一个示例。有没有人看到过类似的情况,或者有任何迹象表明是什么导致了这次崩溃是什么导致了iOS MediaPlayer崩溃?,ios,objective-c,ios8,media-player,Ios,Objective C,Ios8,Media Player,我们收到了一些关于堆栈痕迹的崩溃报告,这些痕迹对我们来说很难破译。堆栈跟踪完全在MealApple、Boundation、CoundFoundation和LIB Stuly.C.DyLIB中。不幸的是,我们无法在任何开发设备上复制,因此故障排除被证明是有问题的 下面是堆栈跟踪的一个示例。有没有人看到过类似的情况,或者有任何迹象表明是什么导致了这次崩溃 EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x000000016fc47fe0 Thread : Cra
EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x000000016fc47fe0
Thread : Crashed: com.apple.main-thread
0 libsystem_c.dylib 0x0000000196a0624c localeconv_l
1 libsystem_c.dylib 0x0000000196a55d6c __vfprintf + 108
2 libsystem_c.dylib 0x0000000196a73680 __v2printf + 588
3 libsystem_c.dylib 0x0000000196a0620c _vsnprintf + 304
4 libsystem_c.dylib 0x0000000196a06c58 snprintf_l + 24
5 CoreFoundation 0x000000018462b01c __CFStringAppendFormatCore + 11584
6 CoreFoundation 0x00000001846282a4 _CFStringCreateWithFormatAndArgumentsAux2 + 248
7 Foundation 0x000000018546e448 -[NSPlaceholderString initWithFormat:locale:arguments:] + 172
8 Foundation 0x000000018546e308 +[NSString stringWithFormat:] + 76
9 MediaPlayer 0x00000001869bf524 -[NSObject(MPLogDescription) MP_shortDescription] + 96
10 MediaPlayer 0x00000001869bf598 -[AVPlayerItem(MPLogDescription) MP_shortDescription] + 72
11 MediaPlayer 0x00000001869bde2c -[MPAVQueueCoordinator _syncPlayerItems] + 1316
12 MediaPlayer 0x00000001869bd8a4 -[MPAVQueueCoordinator _syncItems] + 1452
13 MediaPlayer 0x00000001869becbc -[MPAVQueueCoordinator _updateCurrentItem] + 620
14 MediaPlayer 0x00000001869be61c -[MPAVQueueCoordinator _syncPlayerItems] + 3348
15 MediaPlayer 0x00000001869bd8a4 -[MPAVQueueCoordinator _syncItems] + 1452
16 MediaPlayer 0x00000001869becbc -[MPAVQueueCoordinator _updateCurrentItem] + 620
17 MediaPlayer 0x00000001869be61c -[MPAVQueueCoordinator _syncPlayerItems] + 3348
18 MediaPlayer 0x00000001869bd8a4 -[MPAVQueueCoordinator _syncItems] + 1452
19 MediaPlayer 0x00000001869becbc -[MPAVQueueCoordinator _updateCurrentItem] + 620
20 MediaPlayer 0x00000001869be61c -[MPAVQueueCoordinator _syncPlayerItems] + 3348
...
堆栈跟踪在上面的最后三行中又重复了几百次。根据您的描述,听起来播放器进入了一个无限循环,它要么分配内存,要么增加指针。这很可能是由于加载了格式错误的视频文件
当应用程序的可寻址空间用完和/或指针增大/减小到指向应用程序地址空间之外时,内核会因内存冲突而将其杀死。我的iOS 8.4应用程序上刚刚发生过这种情况。结果表明,该应用程序试图加载一个不存在的本地视频文件。当文件名为“Intro.mp4”时,它正试图加载“Animation.mp4”,而我没有错误捕获代码来检测这一点 最终的结果与上面的堆栈跟踪完全相同——跟踪的最后3行重复了几百次,出现了白色屏幕和应用程序崩溃
因此,可能值得检查一下这一点-它可能会帮助某些人,但希望您更明智一点,并且在加载代码时捕获代码时出现一些错误:)我昨天也遇到了同样的问题。我试图在MPMoviePlayerViewController中加载视频
//Streaming video plying on MPMoviePlayerViewController
NSString *fileURL = @"http://...../myvideo.mp4";
NSURL *url = [NSURL fileURLWithPath:fileURL];
MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
mpViewController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
// Present the movie player view controller
[self presentViewController:mpViewController animated:YES completion:nil];
// Start playback
[mpViewController.moviePlayer play];
运行此命令后,我发现以下错误
-[MPAVQueueCoordinator\u syncPlayerItems]
花了一个小时后,我发现了bug:)我的代码。我在“fileURLWithPath”中传递URL,因为它显示错误。为了解决这个问题,我只需更换
NSURL *url = [NSURL fileURLWithPath:fileURL];
与
嗨,格雷格,你能找到解决这个问题的办法吗?这个崩溃目前也发生在我身上,我正在尝试诊断。有更新吗?我也面临着同样的问题。我正在我们的应用程序中解决这个问题。要使其始终这样做,请尝试使用“睡眠”按钮使设备进入睡眠状态,然后将其唤醒,然后执行操作以播放视频。每次在这里都会发生这种情况。@greg我能够在插入开发时发生这种错误。它正在中断prepareToPlay方法,出现EXC\u BAD\u访问错误。当然,我用的视频相当大。
NSURL *url = [NSURL URLWithString:fileURL];