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

State machine ends up in invalid state after entering a deep history state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.4.1
    • Core: State Machine
    • None
    • Any
    • e616bd2641b9cf6a18cabeae3f9c425f91bfc4b3

    Description

      Consider this state machine:

          <parallel id="a">
              <history id="ha" type="deep"/>
      
              <parallel id="b">
                  <parallel id="c">
                      <parallel id="d">
                          <parallel id="e">
      
                              <state id="i" initial="i1">
                                  <state id="i1">
                                      <transition target="i2" event="t1"/>
                                  </state>
      
                                  <state id="i2">
                                      <transition target="l" event="t2"/>
                                  </state>
                              </state>
      
                              <state id="j"/>
                          </parallel>
      
                          <state id="h"/>
                      </parallel>
      
                      <state id="g"/>
                  </parallel>
              </parallel>
      
              <state id="k"/>
          </parallel>
      
          <state id="l">
              <transition target="ha" event="t3"/>
          </state>
      

      Then send it the events t1, t2, and t3. The following happens:

      initial configuration: i1, j, h, g, k
      send event t1
      next configuration: i2, j, h, g, k
      send event t2
      next configuration: l
      send event t3
      expected configuration: i2, j, h, g, k
      actual configuration: g, h, i1, i2, j, k
      

      The history state will restore i2, then see that it has to activate compound state i and enters those too. The problem is that it then decides that it needs to activate the default sub state for the compound state, which results in a conflict: both i1 and i2 are active.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            erikv Erik Verbruggen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes