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

When connecting to the relevant state changed signals for a StateMachine then when running via Valgrind there is an invalid read on exit

    XMLWordPrintable

Details

    • 0e4c91654abff279b51238b46f880dd624ab9ec8 (qt/qtscxml/dev) 2951c124d3ff58abe1f84175e512ba26977f13d8 (qt/tqtc-qtscxml/tqtc/lts-5.15)

    Description

      When connecting to the relevant state changed signals for a StateMachine then when running via Valgrind there is an invalid read on exit

      ==3456== Invalid read of size 4
      ==3456==    at 0x3B5DEB872F: ??? (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E0AAE10: QQmlPropertyCache::~QQmlPropertyCache() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E0AB1C8: QQmlPropertyCache::~QQmlPropertyCache() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E084B84: QQmlMetaType::freeUnusedTypesAndCaches() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E059571: QQmlEnginePrivate::~QQmlEnginePrivate() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E059848: QQmlEnginePrivate::~QQmlEnginePrivate() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5CA8D10B: QObject::~QObject() (in /usr/lib/libQt5Core.so.5.12.8)
      ==3456==    by 0x3B5E05DB67: QQmlEngine::~QQmlEngine() (in /usr/lib/libQt5Qml.so.5.12.8)
      ==3456==    by 0x3B5E05DB88: QQmlEngine::~QQmlEngine() (in /usr/lib/libQt5Qml.so.5.12.8)
      

      This happens with the attached modified mediaplayer-qml-dynamic example (additionally it will crash on exit in 5.12.x, but this has been since fixed). The key part is the code in Mediaplayer.qml here:

      Component.onCompleted: {
                      scxmlLoader.stateMachine[name + "Changed"].connect( (active) => {
                                                                                      console.log("ACTIVE CHANGED FOR:", name, active)
                                                                                 } )
                  }
      

      if this is commented out then there is no problem.

      Attachments

        1. qtbug89521_valgrind_log.txt
          8 kB
          Friedemann Kleint
        2. qtbug89521.tar.gz
          4 kB
          Andy Shaw
        3. qtbug89521.zip
          8 kB
          Friedemann Kleint
        For Gerrit Dashboard: QTBUG-89521
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes