Crash when setting media in libvlc_MetadataRequest
Just happened to me while setting the media on 3.0.0a42:
; libvlc_media_player_set_media at media_player.c:863
; <+196> at media_player.c:876
; libvlc_MetadataCancel at libvlc.c:539
app`libvlc_MetadataCancel:
-> 0x1000c5260 <+0>: ldr x0, [x0, #0x58]
0x1000c5264 <+4>: cbz x0, 0x1000c526c ; <+12> at libvlc.c:543
0x1000c5268 <+8>: b 0x1000dea38 ; playlist_preparser_Cancel at preparser.c:191
0x1000c526c <+12>: ret
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Muhammet Ilendemli changed the description
changed the description
I can confirm that I has the same trouble
So I've spent A TON of time trying to fix a very similar issue. You guys might be hitting the same thing...
The bottom line is that there's some internal mutexes in VLCLibrary that clash when there's 2 VLCLibraries in play. I can get vlc to crash more or less consistently by opening one stream, closing, opening the second stream and then on close this crash happens.
But there shouldn't be 2 of those in play, right? Well I though so, but then I figured out that I was initing VLCMediaListPlayer with
_listPlayer = [[VLCMediaListPlayer alloc] initWithOptions:options andDrawable:_actualVideoOutputView];
and withinitWithOptions:
somehow causes this to init new VLCLibrary every time thus causing the issue.Swapping that init with
_listPlayer = [[VLCMediaListPlayer alloc] initWithDrawable:_actualVideoOutputView];
magically made the problem disappear, because now there's only one VLCLibrary in play.Although this does not fix the underlying mutex issue (which I could not trace back, it's way above my pay grade), it did fix the crash that plagued me for the past 3 months.
Edited by Luis- Author
Exactly, I have been using a singleton instance of VLCMediaPlayer as a workaround:
extension VLCMediaPlayer { public static let shared: VLCMediaPlayer = { let options: [String] = [ "--no-audio", "--avcodec-hurry-up", "--avcodec-fast", "--avcodec-dr" ] let player: VLCMediaPlayer = VLCMediaPlayer(options: options) #if DEBUG player.libraryInstance.debugLogging = true #endif return player }() } class PlayerViewController: UIViewController { let player: VLCMediaPlayer = VLCMediaPlayer.shared }
Edited by Muhammet Ilendemli - Luis mentioned in issue vlc-ios#132 (closed)
mentioned in issue vlc-ios#132 (closed)
- Luis mentioned in issue #167 (closed)
mentioned in issue #167 (closed)
- Owner
See #167 (closed), same crash.
- Owner
Please provide a full backtrace.
@jbk you want a full backtrace of this issue happening?
I can try to replicate this later today, but you can also easily replicate this - in VLC, open VLCPlaybackController and in line 192 add
initWithOptions:@[]
The line becomes something like
_listPlayer = [[VLCMediaListPlayer alloc] initWithOptions:@[] andDrawable:_actualVideoOutputView];
(you can also trigger this in VLC if you can trigger the "external subtitle file", which is rare - this is what I reported in vlc-ios#132 (closed) )
Then you just need to start vlc and open at least 2 files, at the end of closing the second one you should get the crash.
Edited by LuisThis is a stack trace from the simulator (which also crashes like on a real device), done using the instructions above.
(lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT) * frame #0: 0x000000011054ad62 VLC for iOS`background_worker_Push(worker=0x0103840fdb854808, entity=0x00007f9d1d21d830, id=0x00007f9d1d219a60, timeout=-1) at background_worker.c:218 [opt] frame #1: 0x00000001105008a9 VLC for iOS`playlist_preparser_Push(preparser=0x000000011c7ee795, item=0x00007f9d1d21d830, i_options=META_REQUEST_OPTION_SCOPE_LOCAL, timeout=-1, id=0x00007f9d1d219a60) at preparser.c:178 [opt] frame #2: 0x00000001104e468d VLC for iOS`libvlc_MetadataRequest(libvlc=0x000000011c8412e0, item=0x00007f9d1d21d830, i_options=META_REQUEST_OPTION_SCOPE_LOCAL, timeout=-1, id=0x00007f9d1d219a60) at libvlc.c:509 [opt] frame #3: 0x00000001104dbf49 VLC for iOS`media_parse(media=0x00007f9d1d219a60, b_async=<unavailable>, parse_flag=<unavailable>, timeout=-1) at media.c:811 [opt] frame #4: 0x00000001104dc023 VLC for iOS`libvlc_media_parse_with_options(media=<unavailable>, parse_flag=<unavailable>, timeout=<unavailable>) at media.c:854 [opt] frame #5: 0x000000010fd63bd9 VLC for iOS`-[VLCPlaybackController startPlayback](self=0x000060c00019c630, _cmd="startPlayback") at VLCPlaybackController.m:213 frame #6: 0x000000010fd633ae VLC for iOS`-[VLCPlaybackController playMediaList:firstIndex:subtitlesFilePath:](self=0x000060c00019c630, _cmd="playMediaList:firstIndex:subtitlesFilePath:", mediaList=0x000060c000444860, index=0, subsFilePath=0x0000000000000000) at VLCPlaybackController.m:154 frame #7: 0x000000010fd90a90 VLC for iOS`-[VLCPlaybackController(self=0x000060c00019c630, _cmd="configureMediaList:atIndex:", list=0x000060c000444860, index=0) configureMediaList:atIndex:] at VLCPlaybackController+MediaLibrary.m:135 frame #8: 0x000000010fd909e2 VLC for iOS`-[VLCPlaybackController(self=0x000060c00019c630, _cmd="configureMediaListWithFiles:indexToPlay:", files=@"1 element", index=0) configureMediaListWithFiles:indexToPlay:] at VLCPlaybackController+MediaLibrary.m:130 frame #9: 0x000000010fd8fc4c VLC for iOS`-[VLCPlaybackController(self=0x000060c00019c630, _cmd="configureWithFile:", file=0x0000604000293470) configureWithFile:] at VLCPlaybackController+MediaLibrary.m:74 frame #10: 0x000000010fd8f76f VLC for iOS`-[VLCPlaybackController(self=0x000060c00019c630, _cmd="playMediaLibraryObject:", mediaObject=0x0000604000293470) playMediaLibraryObject:] at VLCPlaybackController+MediaLibrary.m:29 frame #11: 0x000000010fe7d1ef VLC for iOS`VLCTabbarCooordinator.playMedia(media=0x0000604000293470, self=0x0000608000051280) at VLCTabBarCoordinator.swift:108 frame #12: 0x000000010fe7d13e VLC for iOS`VLCTabbarCooordinator.mediaViewControllerDidSelectMediaObject(viewcontroller=0x00007f9d1d215fb0, mediaObject=0x0000604000293470, self=0x0000608000051280) at VLCTabBarCoordinator.swift:102 frame #13: 0x000000010fe7d43e VLC for iOS`protocol witness for VLCMediaViewControllerDelegate.mediaViewControllerDidSelectMediaObject(_:mediaObject:) in conformance VLCTabbarCooordinator at VLCTabBarCoordinator.swift:0 frame #14: 0x000000010fe616d2 VLC for iOS`VLCMediaViewController.collectionView(collectionView=0x00007f9d1e059200, indexPath=2 indices, self=0x00007f9d1d215fb0) at MediaViewController.swift:179 frame #15: 0x000000010fe6179c VLC for iOS`@objc VLCMediaViewController.collectionView(_:didSelectItemAt:) at MediaViewController.swift:0 frame #16: 0x00000001180331fa UIKit`-[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:] + 702 frame #17: 0x000000011805f3a9 UIKit`-[UICollectionView touchesEnded:withEvent:] + 594 frame #18: 0x00000001177a2767 UIKit`forwardTouchMethod + 340 frame #19: 0x00000001177a2831 UIKit`-[UIResponder touchesEnded:withEvent:] + 49 frame #20: 0x00000001177a2767 UIKit`forwardTouchMethod + 340 frame #21: 0x00000001177a2831 UIKit`-[UIResponder touchesEnded:withEvent:] + 49 frame #22: 0x0000000117b5dfbc UIKit`_UIGestureEnvironmentSortAndSendDelayedTouches + 5525 frame #23: 0x0000000117b57ed5 UIKit`_UIGestureEnvironmentUpdate + 1506 frame #24: 0x0000000117b578a7 UIKit`-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 484 frame #25: 0x0000000117b569a9 UIKit`-[UIGestureEnvironment _updateGesturesForEvent:window:] + 281 frame #26: 0x00000001175ec7ab UIKit`-[UIWindow sendEvent:] + 4064 frame #27: 0x0000000117590310 UIKit`-[UIApplication sendEvent:] + 352 frame #28: 0x0000000117ed16af UIKit`__dispatchPreprocessedEventFromEventQueue + 2796 frame #29: 0x0000000117ed42c4 UIKit`__handleEventQueueInternal + 5949 frame #30: 0x000000011b10abb1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 frame #31: 0x000000011b0ef4af CoreFoundation`__CFRunLoopDoSources0 + 271 frame #32: 0x000000011b0eea6f CoreFoundation`__CFRunLoopRun + 1263 frame #33: 0x000000011b0ee30b CoreFoundation`CFRunLoopRunSpecific + 635 frame #34: 0x000000011df0fa73 GraphicsServices`GSEventRunModal + 62 frame #35: 0x0000000117575057 UIKit`UIApplicationMain + 159 frame #36: 0x000000010fdca5ef VLC for iOS`main(argc=1, argv=0x00007ffedfebf098) at main.m:20 frame #37: 0x000000011c868955 libdyld.dylib`start + 1 frame #38: 0x000000011c868955 libdyld.dylib`start + 1
- Owner
Weird
- Jean-Baptiste Kempf added Blocker label
added Blocker label
- Felix Paul Kühne changed milestone to %Future
changed milestone to %Future
- Maintainer
Post-poned as 3.1.4 is out.
- Owner
Please send a new backtrace with 3.3.0.