Closed varumugam123 closed 8 months ago
I was able to reproduce the issue (delayed dispatch of async task post MediaPlayer destruction) with a test page. I confirmed it through custom logs as this simple test doesn't trigger crash. I suppose that is because even though the AbortableTaskQueue is destructed its remnants are still in memory for a period or atleast until the dispatch is done.
delayed-async-task-dispatch-simple.html.txt
Logs
Nov 11 04:36:14 hisense-a6gp WPEFramework[14507]: HTML5 video: Player constructed [0x9c661600]
Nov 11 04:36:14 hisense-a6gp WPEFramework[14507]: HTML5 video: Loading [http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4]
Nov 11 04:36:14 hisense-a6gp WPEFramework[14507]: HTML5 video: Pause [http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4]
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: AbortableTaskQueue::postTask, enqueuing task 0x9aad2000
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x9aad2000
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: AbortableTaskQueue::postTask, enqueuing task 0x9aad2010
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x9aad2010
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: AbortableTaskQueue::postTask, enqueuing task 0x9aad2020
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x9aad2020
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: AbortableTaskQueue::postTask, enqueuing task 0x9aad2030
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23508]: AbortableTaskQueue::postTask, enqueuing task 0x9aad2040
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x9aad2030
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x9aad2040
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: HTML5 video: Play [http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4]
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: HTML5 video: Playback started [http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4]
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07000
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07010
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07020
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07000
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07010
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07020
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07030
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07040
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07030
Nov 11 04:36:16 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07040
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07050
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07060
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07070
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07050
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07060
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07070
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07080
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07080
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::tags
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,23507]: AbortableTaskQueue::postTask, enqueuing task 0x98f07090
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x98f07090
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: [HtmlApp]:67 VIVEK-DBG: clearing video.src, to force media player destruction
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: HTML5 video: Playback terminated [http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4]
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: TrackPrivateBaseGStreamer::operator() (0x9fca7304), pad notify::caps
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::postTask, enqueuing task 0x933e6010
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: TrackPrivateBaseGStreamer::operator() (0x9f624684), pad notify::caps
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::postTask, enqueuing task 0x933e6020
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: HTML5 video: Player Destroyed [0x9c661600]
Nov 11 04:36:17 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: HTMLMediaElement::invalidateCachedTime (0xa2f6dea0), cachedTime is being invalidated here
Nov 11 04:36:24 hisense-a6gp WPEFramework[14507]: [HtmlApp]:74 VIVEK-DBG: cleared video.src, to force media player destruction
Nov 11 04:36:24 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x933e6010
Nov 11 04:36:24 hisense-a6gp WPEFramework[14507]: VIVEK-DBG [14974,14974]: AbortableTaskQueue::Task::dispatch, dispatched 0x933e6020
Submitted this PR upstream for review as https://bugs.webkit.org/show_bug.cgi?id=266715 / https://github.com/WebKit/WebKit/pull/22120.
Patch landed upstream as https://github.com/WebKit/WebKit/commit/b1393655168baaef5595d59edb774c0ba12bc8cd, backported to wpe-2.38 as https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/88486196bd1e3513e117e192d659e6c73f750643 and to wpe-2.42 as https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/5e9ca95e070484d95671990153de40473ac45ca6. Closing PR.
New upstream PR https://github.com/WebKit/WebKit/pull/22253 submitted for review.
Upstream commits https://github.com/WebKit/WebKit/commit/6248d02aae449c5c3986d13e9b252d56e4cd8a92 (revert) and https://github.com/WebKit/WebKit/commit/bda86858ca813149fbfc74acc73169ce0ac7c30b (fixed commit) backported to wpe-2.38 as https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/15f95679a4515ae54c7b7397940eae3dcb7fb227 and https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/7f261cd5c650b0a333f74eea38dcacc10830e0cc and to wpe-2.42 as https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/cc83845e8205532d48667849cb767cc7cd341288 and https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/ebf5645dd7ebaa6712a88bb7a6798e265fe41e89.
Problem: On launching HBOMax app on Comcast STBs (user is already logged into the app) app plays a ~4 second video and on completion destructs the pipeline. Soon after that there is a crash with below signature
Version : wpe-2.38 (39d3d180b2)
It looks like the async task posted by MediaPlayerPrivateGStreamer->TrackPrivateBaseGStreamer on AbortableTaskQueue is dispatched after the Player is destructed. AbortableTaskQueue is composited inside TrackPrivateBaseGStreamer and gets destructed along with Player & TrackPrivateBase.