Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.10, 5.15.2
-
Ubuntu 18.10
-
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.