Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130299

[windows] Sporadic ASSERT on QMediaPlayer destruction

    XMLWordPrintable

Details

    • Windows
    • 693aa2c4f (dev), c9cef61e1 (6.9), 2de987c02 (6.8)
    • Multimedia wk 51-2, Multimedia wk 5-6

    Description

      Here is sporadic ASSERT on QMediaPlayer destruction in DEBUG. Most likely due to a race condition.
      Found this while investigating QTBUG-128369
       

      ASSERT: "m_initialized" in file E:\Qt5\qtmultimedia\src\plugins\multimedia\windows\evr\evrcustompresenter.cpp, line 407
      

      Some WMF internal thread:

                                                                                         
      1  qt_message_fatal<QString &>           qlogging.cpp           2107 0x7ffb0cc2ce04 
      2  qt_message                            qlogging.cpp           382  0x7ffb0cc2ccd9 
      3  QMessageLogger::fatal                 qlogging.cpp           885  0x7ffb0cc2a004 
      4  qt_assert                             qassert.cpp            104  0x7ffb0cbe5d99 
      5  SamplePool::takeSample                evrcustompresenter.cpp 407  0x7ffb5fd80f2c 
      6  EVRCustomPresenter::processOutput     evrcustompresenter.cpp 1478 0x7ffb5fd849ae 
      7  EVRCustomPresenter::processOutputLoop evrcustompresenter.cpp 1454 0x7ffb5fd848dd 
      8  EVRCustomPresenter::OnClockStart      evrcustompresenter.cpp 767  0x7ffb5fd82161 
      9  MF                                                                0x7ffc0d57edaf 
      10 MFShutdownObject                      MFCORE                      0x7ffc0ceb310e 
      11 MFShutdownObject                      MFCORE                      0x7ffc0ceb0a0a 
      12 RtwqShutdown                          RTWorkQ                     0x7ffc0c81c02b 
      13 RtwqShutdown                          RTWorkQ                     0x7ffc0c81bc70 
      14 RtwqPutWaitingWorkItem                RTWorkQ                     0x7ffc0c819b01 
      15 RtlHashUnicodeString                  ntdll                       0x7ffc1749287a 
      16 RtlClearThreadWorkOnBehalfTicket      ntdll                       0x7ffc17465e46 
      17 BaseThreadInitThunk                   KERNEL32                    0x7ffc162f257d 
      18 RtlUserThreadStart                    ntdll                       0x7ffc1748af08 
      

      Main thread:

                                                                                                                                         
                                                                                                                                         
      1  ZwWaitForAlertByThreadId                                                     ntdll                               0x7ffc174d3cc4 
      2  RtlAcquireSRWLockExclusive                                                   ntdll                               0x7ffc17467e35 
      3  MF                                                                                                               0x7ffc0d581cd4 
      4  MF                                                                                                               0x7ffc0d57b155 
      5  MF                                                                                                               0x7ffc0d57b939 
      6  MFCreateMediaProcessor                                                       MFCORE                              0x7ffc0cf394f5 
      7  MFCreateMediaProcessor                                                       MFCORE                              0x7ffc0cf2cea0 
      8  MFCreateMediaProcessor                                                       MFCORE                              0x7ffc0cf393ab 
      9  MFPlayerSession::close                                                       mfplayersession.cpp            117  0x7ffb5fd9f7fd 
      10 MFPlayerControl::~MFPlayerControl                                            mfplayercontrol.cpp            26   0x7ffb5fd9c6e7 
      11 MFPlayerControl::`scalar deleting destructor'                                windowsmediaplugind                 0x7ffb5fd9d598 
      12 QMediaPlayer::~QMediaPlayer                                                  qmediaplayer.cpp               256  0x7ffb09205079 
      13 QQuickMediaPlayer::~QQuickMediaPlayer                                        Qt6MultimediaQuickd                 0x7ffb95bd9cc7 
      14 QQmlPrivate::QQmlElement<QQuickMediaPlayer>::~QQmlElement<QQuickMediaPlayer> qqmlprivate.h                  104  0x7ffb95c2386f 
      15 QQmlPrivate::QQmlElement<QQuickMediaPlayer>::`scalar deleting destructor'    Qt6MultimediaQuickd                 0x7ffb95c2e8f8 
      16 QObject::event                                                               qobject.cpp                    1404 0x7ffb0ce0629c 
      17 QCoreApplicationPrivate::notify_helper                                       qcoreapplication.cpp           1298 0x7ffb0cd4d362 
      18 doNotify                                                                     qcoreapplication.cpp           1225 0x7ffb0cd507b5 
      19 QCoreApplication::notify                                                     qcoreapplication.cpp           1209 0x7ffb0cd499ba 
      20 QGuiApplication::notify                                                      qguiapplication.cpp            2059 0x7ffb09ff89f6 
      21 QCoreApplication::notifyInternal2                                            qcoreapplication.cpp           1124 0x7ffb0cd4bbd7 
      22 QCoreApplication::sendEvent                                                  qcoreapplication.cpp           1569 0x7ffb0cd490dd 
      23 QCoreApplicationPrivate::sendPostedEvents                                    qcoreapplication.cpp           1923 0x7ffb0cd4e9f8 
      24 QEventDispatcherWin32::sendPostedEvents                                      qeventdispatcher_win.cpp       899  0x7ffb0d1a83a0 
      25 QWindowsGuiEventDispatcher::sendPostedEvents                                 qwindowsguieventdispatcher.cpp 44   0x7ffb0a8266a5 
      26 QEventDispatcherWin32::processEvents                                         qeventdispatcher_win.cpp       468  0x7ffb0d1a667f 
      27 QWindowsGuiEventDispatcher::processEvents                                    qwindowsguieventdispatcher.cpp 36   0x7ffb0a82665b 
      28 QEventLoop::processEvents                                                    qeventloop.cpp                 104  0x7ffb0cd6af4c 
      29 QEventLoop::exec                                                             qeventloop.cpp                 194  0x7ffb0cd6b256 
      30 QCoreApplication::exec                                                       qcoreapplication.cpp           1469 0x7ffb0cd48e6c 
      31 QGuiApplication::exec                                                        qguiapplication.cpp            1976 0x7ffb09ff894a 
      32 main                                                                         main.cpp                       20   0x7ff70848344c 
      33 qtEntryPoint                                                                 qtentrypoint_win.cpp           45   0x7ff70848eeda 
      34 WinMain                                                                      qtentrypoint_win.cpp           64   0x7ff70848ed8e 
      35 invoke_main                                                                  exe_common.inl                 107  0x7ff70848b732 
      36 __scrt_common_main_seh                                                       exe_common.inl                 288  0x7ff70848b622 
      37 __scrt_common_main                                                           exe_common.inl                 331  0x7ff70848b4de 
      38 WinMainCRTStartup                                                            exe_winmain.cpp                17   0x7ff70848b7ce 
      39 BaseThreadInitThunk                                                          KERNEL32                            0x7ffc162f257d 
      40 RtlUserThreadStart                                                           ntdll                               0x7ffc1748af08 
      

      Can be reproduce with the following code sample in DEBUG:

      import QtQuick
      import QtMultimedia
      
      Window {
          width: 640
          height: 480
          visible: true
      
          VideoOutput {
              id: output
              anchors.fill: parent
          }
      
          Loader {
              id: loader
              sourceComponent: MediaPlayer {
                  videoOutput: output
                  audioOutput: AudioOutput {}
                  autoPlay: true
                  source: 'https://raw.githubusercontent.com/mediaelement/mediaelement-files/refs/heads/master/echo-hereweare.mp4'
              }
          }
      
          Timer {
              id: timer
              repeat: true
              interval: 300
              running: true
              onTriggered: {
                  loader.active = false
                  loader.active = true
              }
          }
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              johanseg Jøger Hansegård
              studiosus Vladimir Belyavsky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes