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

Crash in QQmlBinding::slowWrite in states/PropertyChanges

    XMLWordPrintable

Details

    • Android

    Description

      Built with Clang Qt for Android 5.9.3 (armv7a ABI), our client's app works on the hardware.

      Built with Clang Qt for Android 5.13.2 (arm64 ABI), our client's app crashes on the hardware, with the following (minimal) stack trace:

      #00 QQmlBinding::slowWrite(QQmlPropertyData const &, QQmlPropertyData const &, QV4Value const &, bool, QFlags<QQmlPropertyData::WriteFlag>)
      #01 GenericBinding<0>::write(QV4::Value const &, bool, QFlags<QQmlPropertyData::WriteFlag>) ?? 0:0 

      The hardware is an Android tablet, allwinner quadcore a64 p1, Android 6.0.1 Marshmallow, API 23, ART 2.1.0, Android Runtime 0.9, kernel 3.10.65 armv8l.

      I guess the stack trace is minimal because the stack frame information isn't available, since dynamically generated code won't have debug symbols associated with it?

       

      I don't have a proper minimal repro, but this is roughly what the code looks like:

      // Base.qml
      import QtQuick 2.2
      
      Item {
          property alias signaller: timer
      
          // in reality, this was an object connected to
          // some hardware which signalled when appropriate.
          Timer {
              id: timer
              signal statusChanged(string newStatus)
              running: true
              repeat: true
              interval: 5000
              property int triggerCount: 0
              onTriggered: {
                  triggerCount++
                  if (triggerCount == 1) {
                      timer.statusChanged("Connecting")
                  } else if (triggerCount == 2) {
                      timer.statusChanged("Connected")
                  }
              }
          }
      }
      
      // Derived.qml
      import QtQuick 2.2
      Base {
          id: derived
      
          property string textValue
      
          function resetState() {
              textValue = "Resetting State"
              state = signaller.status == "Connecting" ? "first" : "second"
          }
      
          states: [
              State {
                  name: "first"
                  PropertyChanges {
                      target: derived
                      textValue: "In First State"
                      signaller.onStatusChanged: derived.resetState()
                  }
              },
              State {
                  name: "second"
                  PropertyChanges {
                      target: derived
                      textValue: "In Second State"
                  }
              }
          ]
      } 

      Note that if the line:

       signaller.onStatusChanged: derived.resetState()

      is removed or commented out, the crash no longer occurs.

       

      I haven't tested other versions or other platforms, the problem may be Qt version rather than ABI specific...

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            chrisadams Christopher Adams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes