tvOS - freezes and thread leakage

This forum is about all development around libVLC.
ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

tvOS - freezes and thread leakage

Postby ssbmaccom » 21 Feb 2016 10:56

Hi,

I prepare an App for tvOS using VLCKit. During testflight beta (about 30 people testing) I often get reports about poor playback performance, jittering video and audio and in worst case playback freezes.
What I found while inspecting the issues was:

Live-TV stream URL is reported as libvlc_media_type_file, not as libvlc_media_type_stream
This is not as expected, as the URL is looking like http://192.168.0.11:8001/1:0:19:283D:3FB:1:C00000:0:0:0:
This does not look like a file to me. VLCKit is just forwarding the media type info it receives from libVLC. Not sure, whether this could make a difference in playback performance and position changes are not available as expected, but this simply does not look correct.

several threads created through playback don't get released/joined
With the Debug navigator in Xcode I saw, that when I open a video for playback, I wait until playback has been started, then I stop playback and close the stream, the instance - whatever I can manually close and also I make sure the dealloc method of the mediaplayer gets invoked (setting myviewcontroller.mediaplayer to nil), some threads do not get released. Performing this multiple times (like zapping through the stations) more and more threads get into a deadlock state.
Research results are, that threads are waiting at _pthread_cond_wait(...), which in this case is called in vlc/src/playlist/thread.c Line 497. I took many stack backtraces (lldb: bt all) and at least one threads is getting locked there, sometimes multiple ones.
Another thread is deadlocked in [VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154, even the event manager should already have been released. (This might be VLCKit specific but not sure, VLCKit is just a wrapper around libVLC).

I finally was able to catch a stack backtraces during playback freeze
During these freezes, sometimes I can still close the player. For clsoing I stop playback, poll up to 1000 times with usleep(1000) waits, until the media property is changing to stopped before I actually try to release all items (media = nil, mediaplayer = nil, etc...). In case of freezes, I run into a timeout and try to close the player anyway. Unfortunately this leaves the stream open (which stops my STB to go to deep sleep power mode). When I then open a new player it works, often with jitters. But sometimes playback of the stream does not start or the App is not responsive at alland requires to a force quit.

Now just let me share the stack backtraces - Xcode is a bit buggy there.

1st backtrace before any player has been created. I use several threads to receive the XML information about Bouquets, TV stations, EPG Info etc. but all of these tasks should be completed already.

Code: Select all

(lldb) bt all * thread #1: tid = 0x1c0b13, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x00000001000f19b4 vuplusTV`main(argc=1, argv=0x000000016fd37a70) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #3: tid = 0x1c0b29, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #4: tid = 0x1c0b2a, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #5: tid = 0x1c0b2c, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x0000000101ef2270 libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x0000000101edfe2c libdispatch.dylib`_dispatch_mgr_thread + 52 thread #6: tid = 0x1c0b2d, 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x14d642b60' frame #0: 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8 frame #1: 0x000000018581d5cc libsystem_c.dylib`nanosleep + 212 frame #2: 0x000000018581d4ec libsystem_c.dylib`usleep + 68 frame #3: 0x0000000101f4c9f0 GPUToolsCore`smt_poll_thread_entry(void*) + 140 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x1c0b3b, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #13: tid = 0x1c0b3c, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #10: tid = 0x1c0b3d, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #11: tid = 0x1c0b3e, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #12: tid = 0x1c0b3f, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 (lldb)
2nd backtrace after creating one player, watched playback for a few seconds, then close the player:

Code: Select all

2016-02-20 15:15:08.884 vuplusTV[2325:1837843] creating player instance using shared library shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader 2016-02-20 15:15:28.809 vuplusTV[2325:1837843] stopped (lldb) bt all warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available. * thread #1: tid = 0x1c0b13, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x00000001000f19b4 vuplusTV`main(argc=1, argv=0x000000016fd37a70) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #5: tid = 0x1c0b2c, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x0000000101ef2270 libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x0000000101edfe2c libdispatch.dylib`_dispatch_mgr_thread + 52 thread #6: tid = 0x1c0b2d, 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x14d642b60' frame #0: 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8 frame #1: 0x000000018581d5cc libsystem_c.dylib`nanosleep + 212 frame #2: 0x000000018581d4ec libsystem_c.dylib`usleep + 68 frame #3: 0x0000000101f4c9f0 GPUToolsCore`smt_poll_thread_entry(void*) + 140 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x1c0b3b, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #10: tid = 0x1c0b3d, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #14: tid = 0x1c0b96, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #22: tid = 0x1c0bb7, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100119eac vuplusTV`Thread(data=0x000000014d7d8c90) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #17: tid = 0x1c0bb8, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000f9818 vuplusTV`-[VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154 frame #3: 0x00000001000f9680 vuplusTV`EventDispatcherMainLoop(user_data=<unavailable>) + 20 at VLCEventManager.m:94 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #19: tid = 0x1c0bc1, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #20: tid = 0x1c0bc2, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #28: tid = 0x1c0bd6, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018bd7e208 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164 frame #6: 0x000000018bd5319c libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 84 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156
3rd backtrace later after multiple creations and releasings of media player, current playback freezing:

Code: Select all

2016-02-21 01:39:22.799 vuplusTV[2492:1877076] Failed to load DataDetectorsUI.framework () 2016-02-21 01:39:28.347 vuplusTV[2492:1877076] creating player instance with private library as options were given 2016-02-21 01:39:28.359 vuplusTV[2492:1877076] mediaplayer madie type: 1 shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader 2016-02-21 01:39:41.478 vuplusTV[2492:1877076] stopped 2016-02-21 01:39:44.491 vuplusTV[2492:1877076] creating player instance with private library as options were given 2016-02-21 01:39:44.505 vuplusTV[2492:1877076] mediaplayer madie type: 1 shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader 2016-02-21 01:42:42.156 vuplusTV[2492:1877076] stopped 2016-02-21 01:42:56.909 vuplusTV[2492:1877076] creating player instance with private library as options were given 2016-02-21 01:42:56.922 vuplusTV[2492:1877076] mediaplayer madie type: 1 shader program 1: WARNING: Output of vertex shader 'TexCoord1' not read by fragment shader WARNING: Output of vertex shader 'TexCoord2' not read by fragment shader (lldb) bt all warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available. * thread #1: tid = 0x1ca454, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x0000000100075964 vuplusTV`main(argc=1, argv=0x000000016fdb3a70) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #5: tid = 0x1ca467, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x0000000101e82270 libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x0000000101e6fe2c libdispatch.dylib`_dispatch_mgr_thread + 52 thread #6: tid = 0x1ca468, 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x144537180' frame #0: 0x0000000185900440 libsystem_kernel.dylib`__semwait_signal + 8 frame #1: 0x000000018581d5cc libsystem_c.dylib`nanosleep + 212 frame #2: 0x000000018581d4ec libsystem_c.dylib`usleep + 68 frame #3: 0x0000000101edc9f0 GPUToolsCore`smt_poll_thread_entry(void*) + 140 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x1ca475, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #11: tid = 0x1ca47a, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #15: tid = 0x1ca48b, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de5c vuplusTV`Thread(data=0x0000000145872a70) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #16: tid = 0x1ca48c, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de5c vuplusTV`Thread(data=0x0000000145880780) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #13: tid = 0x1ca48d, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010007d7c8 vuplusTV`-[VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154 frame #3: 0x000000010007d630 vuplusTV`EventDispatcherMainLoop(user_data=<unavailable>) + 20 at VLCEventManager.m:94 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #23: tid = 0x1ca4b9, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018bd7e208 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164 frame #6: 0x000000018bd5319c libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 84 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #61: tid = 0x1ca4e2, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de5c vuplusTV`Thread(data=0x00000001447e6880) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #62: tid = 0x1ca65b, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de5c vuplusTV`Thread(data=0x0000000145843410) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #47: tid = 0x1ca661, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000a971c vuplusTV`input_DecoderWait(p_dec=0x000000014a9b0cf0) + 104 at decoder.c:2175 frame #3: 0x00000001000b26ac vuplusTV`EsOutDecodersStopBuffering(out=<unavailable>, b_forced=<unavailable>) + 348 at es_out.c:665 frame #4: 0x00000001000b163c vuplusTV`EsOutControlLocked(out=0x0000000145b399e0, i_query=<unavailable>, args=<unavailable>) + 5280 at es_out.c:2354 frame #5: 0x00000001000adeb0 vuplusTV`EsOutControl(out=0x0000000145b399e0, i_query=<unavailable>, args=<unavailable>) + 60 at es_out.c:2722 frame #6: 0x00000001000b4424 vuplusTV`es_out_Control [inlined] es_out_vaControl(out=<unavailable>, i_query=<unavailable>) + 32 at vlc_es_out.h:125 frame #7: 0x00000001000b4418 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #8: 0x00000001000b4318 vuplusTV`CmdExecuteControl(p_out=<unavailable>, p_cmd=<unavailable>) + 204 at es_out_timeshift.c:1535 frame #9: 0x00000001000b3114 vuplusTV`Control + 12 at es_out_timeshift.c:650 frame #10: 0x00000001000b3108 vuplusTV`Control(p_out=<unavailable>, i_query=<unavailable>, args=<unavailable>) + 548 at es_out_timeshift.c:755 frame #11: 0x000000010086571c vuplusTV`es_out_Control [inlined] es_out_vaControl + 12 at vlc_es_out.h:125 frame #12: 0x0000000100865710 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #13: 0x00000001008658a4 vuplusTV`ProgramSetPCR(p_demux=<unavailable>, p_pmt=<unavailable>, i_pcr=<unavailable>) + 380 at ts.c:3103 frame #14: 0x00000001008653e8 vuplusTV`PCRHandle(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 716 at ts.c:3187 frame #15: 0x0000000100862d6c vuplusTV`Demux [inlined] GatherData(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 12 at ts.c:3363 frame #16: 0x0000000100862d60 vuplusTV`Demux(p_demux=0x0000000145802e70) + 2816 at ts.c:1330 frame #17: 0x00000001000b72fc vuplusTV`MainLoop [inlined] demux_Demux(p_demux=0x0000000145802e70) + 16 at vlc_demux.h:302 frame #18: 0x00000001000b72ec vuplusTV`MainLoop [inlined] MainLoopDemux(p_input=<unavailable>, pb_changed=0x0000000000000000) + 28 at input.c:538 frame #19: 0x00000001000b72d0 vuplusTV`MainLoop(p_input=0x000000014466d480, b_interactive=<unavailable>) + 412 at input.c:683 frame #20: 0x00000001000b82e0 vuplusTV`Run(obj=0x000000014466d480) + 52 at input.c:475 frame #21: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #22: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #49: tid = 0x1ca66b, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000a99c4 vuplusTV`DecoderThread(p_data=0x000000014a9b0cf0) + 192 at decoder.c:1488 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #50: tid = 0x1ca66c, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000a99c4 vuplusTV`DecoderThread(p_data=0x000000014489cef0) + 192 at decoder.c:1488 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #52: tid = 0x1ca675, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AURemoteIO::IOThread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x00000001882e718c AudioToolbox`AURemoteIO::IOThread::Run() + 112 frame #3: 0x00000001882eacbc AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 12 frame #4: 0x00000001881f4a70 AudioToolbox`CAPThread::Entry(CAPThread*) + 124 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #51: tid = 0x1ca67c, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #53: tid = 0x1ca67d, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #54: tid = 0x1ca67e, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #55: tid = 0x1ca680, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6d20 libsystem_pthread.dylib`_pthread_cond_wait + 704 frame #2: 0x00000001000ea654 vuplusTV`vlc_cond_timedwait(p_condvar=<unavailable>, p_mutex=<unavailable>, deadline=<unavailable>) + 216 at thread.c:291 frame #3: 0x00000001000c0dc8 vuplusTV`vout_control_Pop(ctrl=0x000000014508baa0, cmd=0x000000016ee92de8, deadline=<unavailable>) + 88 at control.c:189 frame #4: 0x00000001000c5478 vuplusTV`Thread(object=0x000000014508b8f0) + 136 at video_output.c:1583 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #56: tid = 0x1ca689, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #58: tid = 0x1ca6bc, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #59: tid = 0x1ca6bf, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284
I wanted to add a screenshot, but this is not available in this forum. The screenshot shows the numerous threads still opened. A few are really busy with stream decoding and playback, but more and more a idling. I once have seen, the app has created about 60 threads, and only 15 got released. Overall about 20 idling threads created by libVLC- after just 3 mediaplayer open & close cycles. Imagine to zap through 20 TV stations... would result in about 50+ idling threads that do not get stopped/joined.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 22 Feb 2016 17:28

Now I just was able to catch a backtrace while the playback freezed.

Code: Select all

(lldb) bt all warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available. * thread #1: tid = 0x1e92b0, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e53b0 libsystem_kernel.dylib`mach_msg + 192 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x0000000100049964 vuplusTV`main(argc=1, argv=0x000000016fddfc10) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #2: tid = 0x1e92b8, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x00000001857c494c libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x00000001857b37bc libdispatch.dylib`_dispatch_mgr_thread + 52 thread #3: tid = 0x1e92d2, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #4: tid = 0x1e92d7, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #5: tid = 0x1e92f6, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100071e5c vuplusTV`Thread(data=0x0000000156856c10) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #6: tid = 0x1e92f7, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100071e5c vuplusTV`Thread(data=0x0000000155783210) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #7: tid = 0x1e92f8, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000517c8 vuplusTV`-[VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154 frame #3: 0x0000000100051630 vuplusTV`EventDispatcherMainLoop(user_data=<unavailable>) + 20 at VLCEventManager.m:94 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #8: tid = 0x1e92fd, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010007d71c vuplusTV`input_DecoderWait(p_dec=0x00000001560400f0) + 104 at decoder.c:2175 frame #3: 0x00000001000866ac vuplusTV`EsOutDecodersStopBuffering(out=<unavailable>, b_forced=<unavailable>) + 348 at es_out.c:665 frame #4: 0x000000010008563c vuplusTV`EsOutControlLocked(out=0x0000000156836fe0, i_query=<unavailable>, args=<unavailable>) + 5280 at es_out.c:2354 frame #5: 0x0000000100081eb0 vuplusTV`EsOutControl(out=0x0000000156836fe0, i_query=<unavailable>, args=<unavailable>) + 60 at es_out.c:2722 frame #6: 0x0000000100088424 vuplusTV`es_out_Control [inlined] es_out_vaControl(out=<unavailable>, i_query=<unavailable>) + 32 at vlc_es_out.h:125 frame #7: 0x0000000100088418 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #8: 0x0000000100088318 vuplusTV`CmdExecuteControl(p_out=<unavailable>, p_cmd=<unavailable>) + 204 at es_out_timeshift.c:1535 frame #9: 0x0000000100087114 vuplusTV`Control + 12 at es_out_timeshift.c:650 frame #10: 0x0000000100087108 vuplusTV`Control(p_out=<unavailable>, i_query=<unavailable>, args=<unavailable>) + 548 at es_out_timeshift.c:755 frame #11: 0x000000010083971c vuplusTV`es_out_Control [inlined] es_out_vaControl + 12 at vlc_es_out.h:125 frame #12: 0x0000000100839710 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #13: 0x00000001008398a4 vuplusTV`ProgramSetPCR(p_demux=<unavailable>, p_pmt=<unavailable>, i_pcr=<unavailable>) + 380 at ts.c:3103 frame #14: 0x00000001008393e8 vuplusTV`PCRHandle(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 716 at ts.c:3187 frame #15: 0x0000000100836d6c vuplusTV`Demux [inlined] GatherData(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 12 at ts.c:3363 frame #16: 0x0000000100836d60 vuplusTV`Demux(p_demux=0x000000015577dcc0) + 2816 at ts.c:1330 frame #17: 0x000000010008b2fc vuplusTV`MainLoop [inlined] demux_Demux(p_demux=0x000000015577dcc0) + 16 at vlc_demux.h:302 frame #18: 0x000000010008b2ec vuplusTV`MainLoop [inlined] MainLoopDemux(p_input=<unavailable>, pb_changed=0x0000000000000000) + 28 at input.c:538 frame #19: 0x000000010008b2d0 vuplusTV`MainLoop(p_input=0x00000001568716a0, b_interactive=<unavailable>) + 412 at input.c:683 frame #20: 0x000000010008c2e0 vuplusTV`Run(obj=0x00000001568716a0) + 52 at input.c:475 frame #21: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #22: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x1e9302, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010007d9c4 vuplusTV`DecoderThread(p_data=0x00000001560400f0) + 192 at decoder.c:1488 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #10: tid = 0x1e9303, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010007ff4c vuplusTV`DecoderPlayAudio [inlined] DecoderWaitUnblock + 36 at decoder.c:616 frame #3: 0x000000010007ff28 vuplusTV`DecoderPlayAudio(p_dec=0x00000001560272f0, p_audio=0x000000015a212200, pi_played_sum=0x000000016e9b2eb0, pi_lost_sum=0x000000016e9b2eb4) + 116 at decoder.c:1073 frame #4: 0x000000010007e408 vuplusTV`DecoderThread [inlined] DecoderDecodeAudio(p_block=0x0000000000000000) + 124 at decoder.c:1172 frame #5: 0x000000010007e38c vuplusTV`DecoderThread + 16 at decoder.c:1214 frame #6: 0x000000010007e37c vuplusTV`DecoderThread [inlined] DecoderProcess(p_block=<unavailable>) + 2140 at decoder.c:1360 frame #7: 0x000000010007db20 vuplusTV`DecoderThread(p_data=0x00000001560272f0) + 540 at decoder.c:1514 frame #8: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #9: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #11: tid = 0x1e930d, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018bd7e208 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164 frame #6: 0x000000018bd5319c libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 84 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #12: tid = 0x1e9311, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AURemoteIO::IOThread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x00000001882e718c AudioToolbox`AURemoteIO::IOThread::Run() + 112 frame #3: 0x00000001882eacbc AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 12 frame #4: 0x00000001881f4a70 AudioToolbox`CAPThread::Entry(CAPThread*) + 124 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #13: tid = 0x1e9313, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6d20 libsystem_pthread.dylib`_pthread_cond_wait + 704 frame #2: 0x00000001000be654 vuplusTV`vlc_cond_timedwait(p_condvar=<unavailable>, p_mutex=<unavailable>, deadline=<unavailable>) + 216 at thread.c:291 frame #3: 0x0000000100094dc8 vuplusTV`vout_control_Pop(ctrl=0x0000000156115ea0, cmd=0x000000016eabede8, deadline=<unavailable>) + 88 at control.c:189 frame #4: 0x0000000100099478 vuplusTV`Thread(object=0x0000000156115cf0) + 136 at video_output.c:1583 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156
I hope this helps to spot the deadlock.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 22 Feb 2016 17:40

Just for reference: I have created a ticket in trac: https://trac.videolan.org/vlc/ticket/16663

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 24 Feb 2016 18:45

I just have seen the dead lock again.
Aside to the stack backtrace I inspect the locations, where the threads are waiting:

--> Thread 6 and Thread 7: thread.c:497

Code: Select all

vlc_cond_wait( &p_sys->signal, &p_sys->lock );
with p_sys = (playlist_private_t *)NULL

--> Thread 8: decoder.c:2175

Code: Select all

vlc_cond_wait( &p_owner->wait_acknowledge, &p_owner->lock );
with p_owner = (input_thread_t *)0x00000001247c37c0
p_owner->lock = (vlc_mutex_t) Dump:

Code: Select all

5A 54 55 4D 00 00 00 00 00 00 00 00 60 20 00 00 00 00 00 00 5A 54 55 4D 00 00 00 00 00 00 00 00 00 19 35 06 00 19 35 06 FF FF FF FF FF FF FF FF 57 C6 83 DB FE FF FF FF 5A 54 55 4D 5A 54 55 4D 44 4E 4F 43 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 0B 00 A0 25 7C 24 01 00 00 00 00 00 00 00 01 00 00 00 44 4E 4F 43 00 00 00 00 00 00 00 00 00 00 00 80 A8 39 7C 24 01 00 00 00 00 09 00 00 00 08 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 A1 01 00 00 44 4E 4F 43 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 69 6E 67 73 43 68 61 6E 67 65 64 45 00 00 00 00 00 00 00 00 44 4E 4F 43 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 65 64 45 76 65 6E 74 00 00 00 03 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 F0 EA 96 24 01 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 01 00 00 00 01 00 00 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 64 4F 62 6A 65 63 74 6E 05 5A 12 00 00 00 00 0E 25 47 12 00 00 00 70 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
--> Thread 9: decoder.c:1488

Code: Select all

vlc_fifo_Wait( p_owner->p_fifo );
with p_owner = (input_thread_t *)0x00000001247c37c0 (same as in Thread 8 )

--> Thread 10: decoder.c:816

Code: Select all

vlc_cond_wait( &p_owner->wait_request, &p_owner->lock );
with p_owner = (input_thread_t *)0x00000001247c5020


--> Thread 13: control.c:189

Code: Select all

vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline);
with ctrl->lock could be the same as in Thread 10.
Actually - this thread hangs in vlc_cond_timedwait:291

Code: Select all

val = pthread_cond_timedwait_relative_np(&p_condvar->cond, p_mutex, &ts);
with p_condvar = (vlc_cond_t *)NULL and p_mutex = (vlc_mutex_t *)NULL,

I don't know, what the problem is, but at least it looks like a problem to me, that pointers passed as arguments or returned by external call are not checked for NULL. This usually is a flaw, considering, this value is never NULL - but in my case it is.

I hope this helps.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 28 Feb 2016 15:10

One more stack backtrace all during a freeze of playback:

Code: Select all

lldb bt all (lldb) bt all warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available. * thread #1: tid = 0x24a86b, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x000000010007594c vuplusTV`main(argc=1, argv=0x000000016fdb3c10) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #2: tid = 0x24a872, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x00000001857c494c libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x00000001857b37bc libdispatch.dylib`_dispatch_mgr_thread + 52 thread #3: tid = 0x24a879, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #4: tid = 0x24a87a, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #5: tid = 0x24a898, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de44 vuplusTV`Thread(data=0x000000015e06a5b0) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #6: tid = 0x24a899, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010009de44 vuplusTV`Thread(data=0x000000015e0762e0) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #7: tid = 0x24a89a, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010007d7b0 vuplusTV`-[VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154 frame #3: 0x000000010007d618 vuplusTV`EventDispatcherMainLoop(user_data=<unavailable>) + 20 at VLCEventManager.m:94 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #8: tid = 0x24a89e, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000a9704 vuplusTV`input_DecoderWait(p_dec=0x000000015d8afaf0) + 104 at decoder.c:2175 frame #3: 0x00000001000b2694 vuplusTV`EsOutDecodersStopBuffering(out=<unavailable>, b_forced=<unavailable>) + 348 at es_out.c:665 frame #4: 0x00000001000b1624 vuplusTV`EsOutControlLocked(out=0x000000015e07dac0, i_query=<unavailable>, args=<unavailable>) + 5280 at es_out.c:2354 frame #5: 0x00000001000ade98 vuplusTV`EsOutControl(out=0x000000015e07dac0, i_query=<unavailable>, args=<unavailable>) + 60 at es_out.c:2722 frame #6: 0x00000001000b440c vuplusTV`es_out_Control [inlined] es_out_vaControl(out=<unavailable>, i_query=<unavailable>) + 32 at vlc_es_out.h:125 frame #7: 0x00000001000b4400 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #8: 0x00000001000b4300 vuplusTV`CmdExecuteControl(p_out=<unavailable>, p_cmd=<unavailable>) + 204 at es_out_timeshift.c:1535 frame #9: 0x00000001000b30fc vuplusTV`Control + 12 at es_out_timeshift.c:650 frame #10: 0x00000001000b30f0 vuplusTV`Control(p_out=<unavailable>, i_query=<unavailable>, args=<unavailable>) + 548 at es_out_timeshift.c:755 frame #11: 0x000000010086571c vuplusTV`es_out_Control [inlined] es_out_vaControl + 12 at vlc_es_out.h:125 frame #12: 0x0000000100865710 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #13: 0x00000001008658a4 vuplusTV`ProgramSetPCR(p_demux=<unavailable>, p_pmt=<unavailable>, i_pcr=<unavailable>) + 380 at ts.c:3103 frame #14: 0x00000001008653e8 vuplusTV`PCRHandle(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 716 at ts.c:3187 frame #15: 0x0000000100862d6c vuplusTV`Demux [inlined] GatherData(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 12 at ts.c:3363 frame #16: 0x0000000100862d60 vuplusTV`Demux(p_demux=0x000000015e087830) + 2816 at ts.c:1330 frame #17: 0x00000001000b72e4 vuplusTV`MainLoop [inlined] demux_Demux(p_demux=0x000000015e087830) + 16 at vlc_demux.h:302 frame #18: 0x00000001000b72d4 vuplusTV`MainLoop [inlined] MainLoopDemux(p_input=<unavailable>, pb_changed=0x0000000000000000) + 28 at input.c:538 frame #19: 0x00000001000b72b8 vuplusTV`MainLoop(p_input=0x000000015e0391d0, b_interactive=<unavailable>) + 412 at input.c:683 frame #20: 0x00000001000b82c8 vuplusTV`Run(obj=0x000000015e0391d0) + 52 at input.c:475 frame #21: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #22: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x24a8a6, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000a99ac vuplusTV`DecoderThread(p_data=0x000000015d8afaf0) + 192 at decoder.c:1488 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #10: tid = 0x24a8a7, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001000abf34 vuplusTV`DecoderPlayAudio [inlined] DecoderWaitUnblock + 36 at decoder.c:616 frame #3: 0x00000001000abf10 vuplusTV`DecoderPlayAudio(p_dec=0x000000015d0a6cf0, p_audio=0x0000000161abe600, pi_played_sum=0x000000016ea4aeb0, pi_lost_sum=0x000000016ea4aeb4) + 116 at decoder.c:1073 frame #4: 0x00000001000aa3f0 vuplusTV`DecoderThread [inlined] DecoderDecodeAudio(p_block=0x0000000000000000) + 124 at decoder.c:1172 frame #5: 0x00000001000aa374 vuplusTV`DecoderThread + 16 at decoder.c:1214 frame #6: 0x00000001000aa364 vuplusTV`DecoderThread [inlined] DecoderProcess(p_block=<unavailable>) + 2140 at decoder.c:1360 frame #7: 0x00000001000a9b08 vuplusTV`DecoderThread(p_data=0x000000015d0a6cf0) + 540 at decoder.c:1514 frame #8: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #9: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #11: tid = 0x24a8b1, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018bd7e208 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164 frame #6: 0x000000018bd5319c libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 84 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #12: tid = 0x24a8b4, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AURemoteIO::IOThread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x00000001882e718c AudioToolbox`AURemoteIO::IOThread::Run() + 112 frame #3: 0x00000001882eacbc AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 12 frame #4: 0x00000001881f4a70 AudioToolbox`CAPThread::Entry(CAPThread*) + 124 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #13: tid = 0x24a8b6, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #14: tid = 0x24a8b7, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #15: tid = 0x24a8b8, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x000000010071c2b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #16: tid = 0x24a8b9, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6d20 libsystem_pthread.dylib`_pthread_cond_wait + 704 frame #2: 0x00000001000ea63c vuplusTV`vlc_cond_timedwait(p_condvar=<unavailable>, p_mutex=<unavailable>, deadline=<unavailable>) + 216 at thread.c:291 frame #3: 0x00000001000c0db0 vuplusTV`vout_control_Pop(ctrl=0x000000015d9f7ea0, cmd=0x000000016ec6ede8, deadline=<unavailable>) + 88 at control.c:189 frame #4: 0x00000001000c5460 vuplusTV`Thread(object=0x000000015d9f7cf0) + 136 at video_output.c:1583 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #17: tid = 0x24ae03, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #18: tid = 0x24afc0, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #19: tid = 0x24afc1, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #20: tid = 0x24afc2, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #21: tid = 0x24afc3, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 thread #22: tid = 0x24afc4, 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #0: 0x0000000185900b6c libsystem_kernel.dylib`__workq_kernreturn + 8 frame #1: 0x00000001859c5530 libsystem_pthread.dylib`_pthread_wqthread + 1284 (lldb)

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 28 Feb 2016 15:13

one more

Code: Select all

(lldb) bt all warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available. * thread #1: tid = 0x24b094, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e53b0 libsystem_kernel.dylib`mach_msg + 192 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018714c088 GraphicsServices`GSEventRunModal + 180 frame #6: 0x000000018a9edd38 UIKit`UIApplicationMain + 204 frame #7: 0x000000010011194c vuplusTV`main(argc=1, argv=0x000000016fd17c10) + 124 at main.m:14 frame #8: 0x00000001857e2974 libdyld.dylib`start + 4 thread #2: tid = 0x24b098, 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x00000001859014fc libsystem_kernel.dylib`kevent_qos + 8 frame #1: 0x00000001857c494c libdispatch.dylib`_dispatch_mgr_invoke + 232 frame #2: 0x00000001857b37bc libdispatch.dylib`_dispatch_mgr_thread + 52 thread #3: tid = 0x24b09f, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x00000001863b094c CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412 frame #6: 0x000000018671bd80 Foundation`__NSThread__start__ + 1000 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #4: tid = 0x24b0a1, 0x0000000185900368 libsystem_kernel.dylib`__select + 8, name = 'com.apple.CFSocket.private' frame #0: 0x0000000185900368 libsystem_kernel.dylib`__select + 8 frame #1: 0x0000000185d1b010 CoreFoundation`__CFSocketManager + 648 frame #2: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #3: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #5: tid = 0x24b0b3, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100139e44 vuplusTV`Thread(data=0x0000000134f6b930) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #6: tid = 0x24b0b4, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100139e44 vuplusTV`Thread(data=0x0000000134f74c60) + 156 at thread.c:497 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #7: tid = 0x24b0b5, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001001197b0 vuplusTV`-[VLCEventManager startEventLoop](self=<unavailable>, _cmd=<unavailable>) + 296 at VLCEventManager.m:154 frame #3: 0x0000000100119618 vuplusTV`EventDispatcherMainLoop(user_data=<unavailable>) + 20 at VLCEventManager.m:94 frame #4: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #5: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #8: tid = 0x24b0bb, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100145704 vuplusTV`input_DecoderWait(p_dec=0x0000000135939ef0) + 104 at decoder.c:2175 frame #3: 0x000000010014e694 vuplusTV`EsOutDecodersStopBuffering(out=<unavailable>, b_forced=<unavailable>) + 348 at es_out.c:665 frame #4: 0x000000010014d624 vuplusTV`EsOutControlLocked(out=0x0000000134f8afb0, i_query=<unavailable>, args=<unavailable>) + 5280 at es_out.c:2354 frame #5: 0x0000000100149e98 vuplusTV`EsOutControl(out=0x0000000134f8afb0, i_query=<unavailable>, args=<unavailable>) + 60 at es_out.c:2722 frame #6: 0x000000010015040c vuplusTV`es_out_Control [inlined] es_out_vaControl(out=<unavailable>, i_query=<unavailable>) + 32 at vlc_es_out.h:125 frame #7: 0x0000000100150400 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #8: 0x0000000100150300 vuplusTV`CmdExecuteControl(p_out=<unavailable>, p_cmd=<unavailable>) + 204 at es_out_timeshift.c:1535 frame #9: 0x000000010014f0fc vuplusTV`Control + 12 at es_out_timeshift.c:650 frame #10: 0x000000010014f0f0 vuplusTV`Control(p_out=<unavailable>, i_query=<unavailable>, args=<unavailable>) + 548 at es_out_timeshift.c:755 frame #11: 0x000000010090171c vuplusTV`es_out_Control [inlined] es_out_vaControl + 12 at vlc_es_out.h:125 frame #12: 0x0000000100901710 vuplusTV`es_out_Control(out=<unavailable>, i_query=<unavailable>) + 20 at vlc_es_out.h:134 frame #13: 0x00000001009018a4 vuplusTV`ProgramSetPCR(p_demux=<unavailable>, p_pmt=<unavailable>, i_pcr=<unavailable>) + 380 at ts.c:3103 frame #14: 0x00000001009013e8 vuplusTV`PCRHandle(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 716 at ts.c:3187 frame #15: 0x00000001008fed6c vuplusTV`Demux [inlined] GatherData(p_demux=<unavailable>, pid=<unavailable>, p_bk=<unavailable>) + 12 at ts.c:3363 frame #16: 0x00000001008fed60 vuplusTV`Demux(p_demux=0x0000000134f8c560) + 2816 at ts.c:1330 frame #17: 0x00000001001532e4 vuplusTV`MainLoop [inlined] demux_Demux(p_demux=0x0000000134f8c560) + 16 at vlc_demux.h:302 frame #18: 0x00000001001532d4 vuplusTV`MainLoop [inlined] MainLoopDemux(p_input=<unavailable>, pb_changed=0x0000000000000000) + 28 at input.c:538 frame #19: 0x00000001001532b8 vuplusTV`MainLoop(p_input=0x0000000134f31620, b_interactive=<unavailable>) + 412 at input.c:683 frame #20: 0x00000001001542c8 vuplusTV`Run(obj=0x0000000134f31620) + 52 at input.c:475 frame #21: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #22: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #9: tid = 0x24b0c3, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001001459ac vuplusTV`DecoderThread(p_data=0x0000000135939ef0) + 192 at decoder.c:1488 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #10: tid = 0x24b0c4, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x0000000100147f34 vuplusTV`DecoderPlayAudio [inlined] DecoderWaitUnblock + 36 at decoder.c:616 frame #3: 0x0000000100147f10 vuplusTV`DecoderPlayAudio(p_dec=0x00000001350912f0, p_audio=0x000000013b13e000, pi_played_sum=0x000000016eb56eb0, pi_lost_sum=0x000000016eb56eb4) + 116 at decoder.c:1073 frame #4: 0x00000001001463f0 vuplusTV`DecoderThread [inlined] DecoderDecodeAudio(p_block=0x0000000000000000) + 124 at decoder.c:1172 frame #5: 0x0000000100146374 vuplusTV`DecoderThread + 16 at decoder.c:1214 frame #6: 0x0000000100146364 vuplusTV`DecoderThread [inlined] DecoderProcess(p_block=<unavailable>) + 2140 at decoder.c:1360 frame #7: 0x0000000100145b08 vuplusTV`DecoderThread(p_data=0x00000001350912f0) + 540 at decoder.c:1514 frame #8: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #9: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #11: tid = 0x24b0c9, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x0000000185d14aa8 CoreFoundation`__CFRunLoopServiceMachPort + 196 frame #3: 0x0000000185d127ac CoreFoundation`__CFRunLoopRun + 1032 frame #4: 0x0000000185c416c0 CoreFoundation`CFRunLoopRunSpecific + 384 frame #5: 0x000000018bd7e208 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164 frame #6: 0x000000018bd5319c libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 84 frame #7: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #8: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #12: tid = 0x24b0cc, 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AURemoteIO::IOThread' frame #0: 0x00000001858e54bc libsystem_kernel.dylib`mach_msg_trap + 8 frame #1: 0x00000001858e5338 libsystem_kernel.dylib`mach_msg + 72 frame #2: 0x00000001882e718c AudioToolbox`AURemoteIO::IOThread::Run() + 112 frame #3: 0x00000001882eacbc AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 12 frame #4: 0x00000001881f4a70 AudioToolbox`CAPThread::Entry(CAPThread*) + 124 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #13: tid = 0x24b0ce, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001007b82b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #14: tid = 0x24b0cf, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001007b82b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #15: tid = 0x24b0d0, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6ce8 libsystem_pthread.dylib`_pthread_cond_wait + 648 frame #2: 0x00000001007b82b8 vuplusTV`frame_worker_thread(arg=<unavailable>) + 160 at pthread_frame.c:133 frame #3: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #4: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 thread #16: tid = 0x24b0d1, 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #0: 0x00000001858fff48 libsystem_kernel.dylib`__psynch_cvwait + 8 frame #1: 0x00000001859c6d20 libsystem_pthread.dylib`_pthread_cond_wait + 704 frame #2: 0x000000010018663c vuplusTV`vlc_cond_timedwait(p_condvar=<unavailable>, p_mutex=<unavailable>, deadline=<unavailable>) + 216 at thread.c:291 frame #3: 0x000000010015cdb0 vuplusTV`vout_control_Pop(ctrl=0x00000001352392a0, cmd=0x000000016ed7ade8, deadline=<unavailable>) + 88 at control.c:189 frame #4: 0x0000000100161460 vuplusTV`Thread(object=0x00000001352390f0) + 136 at video_output.c:1583 frame #5: 0x00000001859c7b28 libsystem_pthread.dylib`_pthread_body + 156 frame #6: 0x00000001859c7a8c libsystem_pthread.dylib`_pthread_start + 156 (lldb)

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: tvOS - freezes and thread leakage

Postby ssbmaccom » 04 Mar 2016 17:47

Well, I just built TVVLCKit with the sources from Dec 28th 2015.
It uses libVLC commit from Dec. 8th
I had to fix some issues in VLCKit and vlc, but at the end it works and the result is much better than building from HEAD.
I will keep it this build at a safe place ;-)

But maybe this can help you to find the cause for the issues, since it has been introduced since then.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests