-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 5.12.10, 5.15.2
-
Fix Version/s: 6.1.0 Alpha
-
Component/s: QML: Declarative and Javascript Engine, XML: SCXML
-
Labels:
-
Environment:Ubuntu 18.10
-
Commits:0e4c91654abff279b51238b46f880dd624ab9ec8 (qt/qtscxml/dev) 2951c124d3ff58abe1f84175e512ba26977f13d8 (qt/tqtc-qtscxml/tqtc/lts-5.15)
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.
For Gerrit Dashboard: QTBUG-89521 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
330082,2 | Mark dynamic state machines' metaobjects as fully dynamic | dev | qt/qtscxml | Status: MERGED | +2 | 0 |
331951,2 | Mark dynamic state machines' metaobjects as fully dynamic | tqtc/lts-5.15 | qt/tqtc-qtscxml | Status: MERGED | +2 | 0 |