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

[ASSERT] Jumping to another sprite on Component.onCompleted asserts in QList

    XMLWordPrintable

Details

    Description

      Doing the following causes an assert - perhaps the sprite engine is not ready at the point Component.onCompleted is fired.
      Also tried with a running Timer that triggered on start, same result.

      Rectangle {
          width: 800
          height: 800
      
          SpriteSequence {
              id: mysprite
              sprites: [s1,s2]
              scale: 2
              height: 200
              width: 200
              anchors.centerIn: parent
          }
      
          Component.onCompleted: mysprite.jumpTo("running")
          Sprite {
              id: s1
              name: "standing"
              frameCount: 12
              frameDuration: 80
              source: "images/standing.png"
          }
      
          Sprite {
              id: s2
              name: "running"
              frameCount: 6
              frameDuration: 80
              source: "images/running.png"
          }
      }
      

      Backtrace:

      ASSERT failure in QList<T>::operator[]: "index out of range", file ../../../qtbase/include/QtCore/../../src/corelib/tools/qlist.h, line 459
      
      Program received signal SIGABRT, Aborted.
      0xb7fe3832 in ?? () from /lib/ld-linux.so.2
      (gdb) bt
      #0  0xb7fe3832 in ?? () from /lib/ld-linux.so.2
      #1  0xb56ff651 in raise () from /lib/tls/i686/cmov/libc.so.6
      #2  0xb5702a82 in abort () from /lib/tls/i686/cmov/libc.so.6
      #3  0xb5aea00a in qt_message_output (msgType=QtFatalMsg, context=..., 
          buf=0x80b0610 "ASSERT failure in QList<T>::operator[]: \"index out of range\", file ../../../qtbase/include/QtCore/../../src/corelib/tools/qlist.h, line 459") at global/qlogging.cpp:734
      #4  0xb5ae77c9 in qt_message (msgType=QtFatalMsg, context=..., msg=0xb5d6b204 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0xbfffe368 "\037~뷵}\353\267\340}\353\267\313\001")
          at global/qlogging.cpp:131
      #5  0xb5ae79e3 in QMessageLogger::fatal (this=0xbfffe380, msg=0xb5d6b204 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:334
      #6  0xb5ae3ff0 in qt_assert_x (where=0xb7eb7e1f "QList<T>::operator[]", what=0xb7eb7db5 "index out of range", file=0xb7eb7de0 "../../../qtbase/include/QtCore/../../src/corelib/tools/qlist.h", 
          line=459) at global/qglobal.cpp:1878
      #7  0xb7d9e0c8 in QList<QQuickSprite*>::operator[] (this=0x80c2818, i=2) at ../../../qtbase/include/QtCore/../../src/corelib/tools/qlist.h:459
      #8  0xb7d9c4a3 in QQuickSpriteEngine::restart (this=0x80c27e0, index=0) at items/qquickspriteengine.cpp:509
      #9  0xb7d9ae7c in QQuickStochasticEngine::setGoal (this=0x80c27e0, state=2, sprite=0, jump=true) at items/qquickspriteengine.cpp:304
      #10 0xb7da0cad in QQuickSpriteSequence::jumpTo (this=0x80ec4f8, sprite=...) at items/qquickspritesequence.cpp:285
      #11 0xb7e75856 in QQuickSpriteSequence::qt_static_metacall (_o=0x80ec4f8, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfffe670) at .moc/debug-shared/moc_qquickspritesequence_p.cpp:89
      #12 0xb7e75aad in QQuickSpriteSequence::qt_metacall (this=0x80ec4f8, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0xbfffe670) at .moc/debug-shared/moc_qquickspritesequence_p.cpp:155
      #13 0xb5ca9056 in QMetaObject::metacall (object=0x80ec4f8, cl=QMetaObject::InvokeMetaMethod, idx=38, argv=0xbfffe670) at kernel/qmetaobject.cpp:248
      #14 0xb7a0637b in CallMethod (object=0x80ec4f8, index=38, returnType=0, argCount=1, argTypes=0x80c2fc0, engine=0xb2300d70, callArgs=...) at qml/v8/qv8qobjectwrapper.cpp:1489
      #15 0xb7a06f0f in CallPrecise (object=0x80ec4f8, data=..., engine=0xb2300d70, callArgs=...) at qml/v8/qv8qobjectwrapper.cpp:1716
      #16 0xb7a07ebd in QV8QObjectWrapper::Invoke (args=...) at qml/v8/qv8qobjectwrapper.cpp:1922
      #17 0xb72bc0b3 in v8::internal::HandleApiCallHelper<false> (args=..., isolate=0x8074928) at ../3rdparty/v8/src/builtins.cc:1164
      #18 0xb72b699f in v8::internal::Builtin_Impl_HandleApiCall (args=..., isolate=0x8074928) at ../3rdparty/v8/src/builtins.cc:1181
      #19 0xb72b697a in v8::internal::Builtin_HandleApiCall (args=..., isolate=0x8074928) at ../3rdparty/v8/src/builtins.cc:1180
      #20 0x23a08716 in ?? ()
      #21 0x23a22303 in ?? ()
      #22 0x23a0ba61 in ?? ()
      #23 0x23a2b670 in ?? ()
      #24 0x23a1ed19 in ?? ()
      #25 0x23a0e7e5 in ?? ()
      #26 0xb72f8df9 in v8::internal::Invoke (is_construct=false, function=..., receiver=..., argc=0, args=0x0, has_pending_exception=0xbfffec4f, qml=...) at ../3rdparty/v8/src/execution.cc:125
      #27 0xb72f91f9 in v8::internal::Execution::Call (callable=..., receiver=..., argc=0, argv=0x0, pending_exception=0xbfffec4f, convert_receiver=false, qml=...)
          at ../3rdparty/v8/src/execution.cc:194
      #28 0xb72f8ff9 in v8::internal::Execution::Call (callable=..., receiver=..., argc=0, argv=0x0, pending_exception=0xbfffec4f, convert_receiver=false) at ../3rdparty/v8/src/execution.cc:161
      #29 0xb7273784 in v8::Function::Call (this=0xb23283f0, recv=..., argc=0, argv=0x0) at ../3rdparty/v8/src/api.cc:3655
      #30 0xb798b087 in QQmlJavaScriptExpression::evaluate (this=0x80b3604, context=0x80ec318, function=..., isUndefined=0x0) at qml/qqmljavascriptexpression.cpp:133
      #31 0xb78c5514 in QQmlExpressionPrivate::v8value (this=0x80b35b8, secondaryScope=0x0, isUndefined=0x0) at qml/qqmlexpression.cpp:520
      #32 0xb78c565d in QQmlExpressionPrivate::value (this=0x80b35b8, secondaryScope=0x0, isUndefined=0x0) at qml/qqmlexpression.cpp:541
      #33 0xb79158f2 in QQmlBoundSignal::qt_metacall (this=0x80c2ea0, c=QMetaObject::InvokeMetaMethod, id=5, a=0xbfffef98) at qml/qqmlboundsignal.cpp:194
      #34 0xb5ca9056 in QMetaObject::metacall (object=0x80c2ea0, cl=QMetaObject::InvokeMetaMethod, idx=5, argv=0xbfffef98) at kernel/qmetaobject.cpp:248
      #35 0xb5cd687a in QMetaObject::activate (sender=0x80b1a70, m=0xb7b3a47c, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3268
      #36 0xb7a4b0d5 in QQmlComponentAttached::completed (this=0x80b1a70) at .moc/debug-shared/moc_qqmlcomponentattached_p.cpp:112
      #37 0xb78ec8e6 in QQmlVME::complete (this=0x80adbc0, interrupt=...) at qml/qqmlvme.cpp:1288
      #38 0xb78d616a in QQmlComponentPrivate::complete (enginePriv=0x80ab178, state=0x80adbc0) at qml/qqmlcomponent.cpp:792
      #39 0xb78d6240 in QQmlComponentPrivate::completeCreate (this=0x80adb58) at qml/qqmlcomponent.cpp:825
      #40 0xb78d61ef in QQmlComponent::completeCreate (this=0x80ae578) at qml/qqmlcomponent.cpp:818
      #41 0xb78d5b4e in QQmlComponent::create (this=0x80ae578, context=0x80af7f0) at qml/qqmlcomponent.cpp:674
      #42 0xb7d88fa9 in QQuickView::continueExecute (this=0x80a9690) at items/qquickview.cpp:391
      #43 0xb7d88196 in QQuickViewPrivate::execute (this=0x80aad60) at items/qquickview.cpp:96
      #44 0xb7d88759 in QQuickView::setSource (this=0x80a9690, url=...) at items/qquickview.cpp:204
      #45 0x0804d8ce in main (argc=2, argv=0xbffff444) at main.cpp:419
      

      Attachments

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

        Activity

          People

            aalpert-nokia Alan Alpert (closed Nokia identity) (Inactive)
            dajansen Damian Jansen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes