Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.4.0, 5.5.0 Alpha
-
None
Description
QState machine uses QSet internally in several places, whereas the standard uses an ordered set everywhere.
This leads to several places where the order is given by the hash order of the QSet (randomized by default).
This introduces non-deterministic behavoiur for example if one has i+=1 and i*=2 as code that is executed.
For example in the attached sample where the order of execution of the code in the transitions changes from run to run, thus storing different values in i at the end of the transitions.
To fix this one should order all code execution.
Ordering is trivial when the state machine is serialized, but to be efficiently computable in dynamically created state machines requires something like an explicit counter.
This also affects QTBUG-44783 and (partially) QTBUG-44963