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

Crash/race in destroying QSoundEffect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.5, 5.13.1, 5.14.0 Alpha
    • 5.12.3
    • Multimedia
    • None
    • Ubuntu 18.04
    • Linux/Wayland
    • 767a7e1c9e418545605f2828b7b0847ee650dea8 (qt/qtmultimedia/5.12)

    Description

      QSoundEffect has a race when an application is destroyed soon after its initialization (which can manifest in multiple different failures/crashes). Whilst not so much of a problem for a long running application, it manifests more frequently in qmlplugindump where it crashes in modules that use QSoundEffect (since object instances are short-lived there).

      The crux seems to be that QSample::load is queued for execution on its own thread, which conflicts with creating/using various networking classes which don't function when the application is shutting down.

      Attached is a small, artificial example, which manifests in a crash roughly 10% of the time.

      Some example results:

      for i in {1..10}; do ./test; done

      QObject::connect: Cannot connect (null)::configurationAdded(QNetworkConfiguration) to QNetworkConfigurationManager::configurationAdded(QNetworkConfiguration)
      QObject::connect: Cannot connect (null)::configurationRemoved(QNetworkConfiguration) to QNetworkConfigurationManager::configurationRemoved(QNetworkConfiguration)
      QObject::connect: Cannot connect (null)::configurationChanged(QNetworkConfiguration) to QNetworkConfigurationManager::configurationChanged(QNetworkConfiguration)
      QObject::connect: Cannot connect (null)::onlineStateChanged(bool) to QNetworkConfigurationManager::onlineStateChanged(bool)
      QObject::connect: Cannot connect (null)::configurationUpdateComplete() to QNetworkConfigurationManager::updateCompleted()
      Segmentation fault (core dumped)

       

      for i in {1..10}; do ./test; done

      QEventLoop: Cannot be used without QApplication
      Segmentation fault (core dumped)

       

      for i in {1..30}; do ./test; done

      QMutex: destroying locked mutex
      Segmentation fault (core dumped){{}}

       

      Attachments

        1. qsoundeffect-crash.txt
          4 kB
        2. test.tar.xz
          0.6 kB
        For Gerrit Dashboard: QTBUG-76090
        # Subject Branch Project Status CR V

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            molesmoke Jeremy Powell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes