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

[REG 6.7 → dev] Assert: start > 0 in QQmlComponentPrivate::beginCreate

    XMLWordPrintable

Details

    • 59bdfc6c5 (dev), 8281c94a5 (6.7)

    Description

      The following QML code triggers an assert

      var comp = Qt.createComponent("componenttest", "Test.qml")
      comp.createObject(null) 
      #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
      
      #1  0x00007ffff0694a73 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
      
      #2  0x00007ffff0641176 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      
      #3  0x00007ffff0628917 in __GI_abort () at abort.c:79
      
      #4  0x00007ffff0feb8f4 in qAbort() () at /home/nico/workspace/qt6-dev/qtbase/src/corelib/global/qassert.cpp:49
      
      #5  0x00007ffff0ffee4e in qt_message_fatal<QString&>(QtMsgType, QMessageLogContext const&, QString&) (context=..., message=...) at /home/nico/workspace/qt6-dev/qtbase/src/corelib/global/qlogging.cpp:2056
      
      #6  0x00007ffff1002430 in qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *)
      
          (msgType=msgType@entry=QtFatalMsg, context=..., msg=msg@entry=0x7ffff1b236e0 "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0x7fffed16de20) at /home/nico/workspace/qt6-dev/qtbase/src/corelib/global/qlogging.cpp:374
      
      #7  0x00007ffff100e5dc in QMessageLogger::fatal(char const*, ...) const (this=this@entry=0x7fffecf79420, msg=msg@entry=0x7ffff1b236e0 "ASSERT: \"%s\" in file %s, line %d") at /home/nico/workspace/qt6-dev/qtbase/src/corelib/global/qlogging.cpp:874
      
      #8  0x00007ffff0feba5a in qt_assert(char const*, char const*, int) (assertion=assertion@entry=0x7ffff5a29c80 "start > 0", file=file@entry=0x7ffff5a28b00 "/home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp", line=line@entry=1086)
      
          at /home/nico/workspace/qt6-dev/qtbase/src/corelib/global/qassert.cpp:105
      
      #9  0x00007ffff5220c34 in QQmlComponentPrivate::beginCreate(QQmlRefPointer<QQmlContextData>) (this=0x51100013fb40, context=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1086
      
      #10 0x00007ffff52213a7 in QQmlComponent::beginCreate(QQmlContext*) (this=0x502000013890, context=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1014
      
      #11 0x00007ffff520ee4c in QQmlComponentPrivate::doBeginCreate(QQmlComponent*, QQmlContext*) (this=this@entry=0x51100013fb40, q=q@entry=0x502000013890, context=context@entry=0x502000013a30) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:336
      
      #12 0x00007ffff521b246 in QQmlComponentPrivate::createWithProperties(QObject*, QMap<QString, QVariant> const&, QQmlContext*, QQmlComponentPrivate::CreateBehavior)
      
          (this=this@entry=0x51100013fb40, parent=parent@entry=0x0, properties=..., context=<optimized out>, behavior=behavior@entry=QQmlComponentPrivate::CreateWarnAboutRequiredProperties) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:942
      
      #13 0x00007ffff521b758 in QQmlComponent::createObject(QObject*, QMap<QString, QVariant> const&) (this=this@entry=0x502000013890, parent=0x0, properties=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1824
      
      #14 0x00007ffff5226336 in QQmlComponent::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=_o@entry=0x502000013890, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=10, _a=_a@entry=0x7fffed5025a8)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/moc_qqmlcomponent.cpp:232
      
      #15 0x00007ffff5226929 in QQmlComponent::qt_metacall(QMetaObject::Call, int, void**) (this=<optimized out>, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/moc_qqmlcomponent.cpp:292
      
      #16 0x00007ffff11e14d3 in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) (object=<optimized out>, cl=cl@entry=QMetaObject::InvokeMetaMethod, idx=idx@entry=14, argv=argv@entry=0x7fffed5025a8)
      
          at /home/nico/workspace/qt6-dev/qtbase/src/corelib/kernel/qmetaobject.cpp:334
      
      #17 0x00007ffff540677e in QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const (this=this@entry=0x7fffed25f120, type=type@entry=QMetaObject::InvokeMetaMethod, index=index@entry=14, argv=<optimized out>)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlobjectorgadget.cpp:14
      
      #18 0x00007ffff4f612e6 in QV4::CallMethod(QQmlObjectOrGadget const&, int, QMetaType, int, QMetaType const*, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call)
      
          (object=..., index=<optimized out>, returnType=..., argCount=<optimized out>, argTypes=<optimized out>, engine=<optimized out>, callArgs=<optimized out>, callType=<optimized out>)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1682
      
      #19 0x00007ffff4f63b0c in QV4::CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call)
      
          (object=<optimized out>, data=..., engine=<optimized out>, callArgs=<optimized out>, callType=callType@entry=QMetaObject::InvokeMetaMethod) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1991
      
      #20 0x00007ffff4f63dc9 in operator()() const (__closure=__closure@entry=0x7fffed25f2a0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2965
      
      #21 0x00007ffff4f640eb in operator()<QV4::QObjectMethod::callInternal(const QV4::Value*, const QV4::Value*, int) const::<lambda()> >(const struct {...} &) const (__closure=__closure@entry=0x7fffed25f1e0, call=...)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2942
      
      #22 0x00007ffff4f65386 in QV4::QObjectMethod::callInternal(QV4::Value const*, QV4::Value const*, int) const (this=0x7fffce3bf4f0, thisObject=<optimized out>, argv=<optimized out>, argc=argc@entry=1)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2965
      
      #23 0x00007ffff4f65e53 in operator() (argc=1, argv=<optimized out>, thisObject=<optimized out>, __closure=0x7fffed16ccc0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3042
      
      #24 QV4::convertAndCall<QV4::QObjectMethod::callInternalWithMetaTypes(QObject*, void**, const QMetaType*, int) const::<lambda(const QV4::Value*, const QV4::Value*, int)> >(QV4::ExecutionEngine *, QObject *, void **, const QMetaType *, int, struct {...})
      
          (engine=0x51700000af80, thisObject=<optimized out>, a=a@entry=0x7fffed222ca0, types=types@entry=0x7fffed222cc0, argc=<optimized out>, call=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4jscall_p.h:194
      
      #25 0x00007ffff4f66fa1 in QV4::QObjectMethod::callInternalWithMetaTypes(QObject*, void**, QMetaType const*, int) const (this=0x7fffce3bf4f0, thisObject=<optimized out>, argv=<optimized out>, types=<optimized out>, argc=<optimized out>)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:3039
      
      #26 0x00007ffff4f67055 in QV4::QObjectMethod::virtualCallWithMetaTypes(QV4::FunctionObject const*, QObject*, void**, QMetaType const*, int) (m=<optimized out>, thisObject=<optimized out>, argv=<optimized out>, types=<optimized out>, argc=<optimized out>)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:2854
      
      #27 0x00007ffff4e36b19 in QV4::FunctionObject::call(QObject*, void**, QMetaType const*, int) (this=0x7fffce3bf4f0, thisObject=thisObject@entry=0x502000013890, a=a@entry=0x7fffed222ca0, types=types@entry=0x7fffed222cc0, argc=argc@entry=1)
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4functionobject.cpp:127
      
      #28 0x00007ffff5173f6b in QQmlPrivate::AOTCompiledContext::callObjectPropertyLookup(unsigned int, QObject*, void**, QMetaType const*, int) const
      
          (this=0x7fffecf73720, index=<optimized out>, object=<optimized out>, args=<optimized out>, types=<optimized out>, argc=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqml.cpp:1835
      
      #29 0x000000000040d1ec in QmlCacheGeneratedCode::_qt_qml_componenttest_Main_qml::aotBuiltFunctions::{lambda(QQmlPrivate::AOTCompiledContext const*, void*, QQmlPrivate::AOTCompiledContext const**)#1}::operator()(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTComp
      iledContext const*, void*) const::{lambda(QQmlPrivate::AOTCompiledContext const, void*)#1}::operator()(QQmlPrivate::AOTCompiledContext const, void*) const (__closure=0x7fffece1e060, aotContext=0x7fffecf73720, argumentsPtr=0x7fffed145ac8)
      
          at /home/nico/workspace/componenttest/build/Qt6_dev-Debug/.rcc/qmlcache/appcomponenttest_Main_qml.cpp:299
      
      #30 0x000000000040df07 in QmlCacheGeneratedCode::_qt_qml_componenttest_Main_qml::wrapCall<QmlCacheGeneratedCode::_qt_qml_componenttest_Main_qml::aotBuiltFunctions::{lambda(QQmlPrivate::AOTCompiledContext const*, void*, QQmlPrivate::AOTCompiledContext const**)#1}::operat
      or()(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTCompiledContext const*, void*) const::{lambda(QQmlPrivate::AOTCompiledContext const, void*)#1}>(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTCompiledContext const*, void*, QmlCacheGeneratedCode::_qt_q
      ml_componenttest_Main_qml::aotBuiltFunctions::{lambda(QQmlPrivate::AOTCompiledContext const*, void*, QQmlPrivate::AOTCompiledContext const**)#1}::operator()(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTCompiledContext const*, void*) const::{lambda(QQmlPrivate:
      :AOTCompiledContext const, void*)#1}&&) (aotContext=0x7fffecf73720, dataPtr=0x0, argumentsPtr=0x7fffed145ac8, binding=...) at /home/nico/workspace/componenttest/build/Qt6_dev-Debug/.rcc/qmlcache/appcomponenttest_Main_qml.cpp:202
      
      #31 0x000000000040d673 in QmlCacheGeneratedCode::_qt_qml_componenttest_Main_qml::aotBuiltFunctions::{lambda(QQmlPrivate::AOTCompiledContext const*, void*, QQmlPrivate::AOTCompiledContext const**)#1}::operator()(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTComp
      iledContext const*, void*) const (__closure=0x0, context=0x7fffecf73720, data=0x0, argv=0x7fffed145ac8) at /home/nico/workspace/componenttest/build/Qt6_dev-Debug/.rcc/qmlcache/appcomponenttest_Main_qml.cpp:215
      
      #32 0x000000000040d6df in QmlCacheGeneratedCode::_qt_qml_componenttest_Main_qml::aotBuiltFunctions::{lambda(QQmlPrivate::AOTCompiledContext const*, void*, QQmlPrivate::AOTCompiledContext const**)#1}::_FUN(QQmlPrivate::AOTCompiledContext const, QQmlPrivate::AOTCompiledCo
      ntext const*, void*) () at /home/nico/workspace/componenttest/build/Qt6_dev-Debug/.rcc/qmlcache/appcomponenttest_Main_qml.cpp:321
      
      #33 0x00007ffff50a6291 in operator()(void**, int) const (__closure=__closure@entry=0x7fffed222a40, argv=argv@entry=0x7fffed145ac0, argc=argc@entry=0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:446
      
      #34 0x00007ffff50a8aa7 in QV4::coerceAndCall<AOTCompiledMetaMethod, QV4::Moth::VME::exec(QV4::MetaTypesStackFrame*, QV4::ExecutionEngine*)::<lambda(void**, int)> >(QV4::ExecutionEngine *, const AOTCompiledMetaMethod *, void **, const QMetaType *, int, struct {...})
      
          (engine=engine@entry=0x51700000af80, typedFunction=typedFunction@entry=0x7fffed07d740, argv=<optimized out>, types=<optimized out>, argc=<optimized out>, call=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4jscall_p.h:548
      
      #35 0x00007ffff50c2199 in QV4::Moth::VME::exec(QV4::MetaTypesStackFrame*, QV4::ExecutionEngine*) (frame=frame@entry=0x7fffed07d620, engine=engine@entry=0x51700000af80) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4vme_moth.cpp:431
      
      #36 0x00007ffff4e21094 in QV4::Function::call(QObject*, void**, QMetaType const*, int, QV4::ExecutionContext*)
      
          (this=this@entry=0x5060000a63a0, thisObject=<optimized out>, a=a@entry=0x7fffed145ac0, types=types@entry=0x7fffed145ae0, argc=argc@entry=0, context=context@entry=0x7fffeba9d038) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/jsruntime/qv4function.cpp:38
      
      #37 0x00007ffff531bcfe in QQmlJavaScriptExpression::evaluate(void**, QMetaType const*, int) (this=this@entry=0x50b000058d50, a=a@entry=0x7fffed145ac0, types=types@entry=0x7fffed145ae0, argc=argc@entry=0)
      
      --Type <RET> for more, q to quit, c to continue without paging--c
      
          at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmljavascriptexpression.cpp:270
      
      #38 0x00007ffff51d4222 in QQmlBoundSignalExpression::evaluate(void**) (this=0x50b000058d50, a=a@entry=0x0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlboundsignal.cpp:199
      
      #39 0x00007ffff51d57ba in QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) (e=0x5060000a6a00, a=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlboundsignal.cpp:314
      
      #40 0x00007ffff53b5066 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) (endpoint=<optimized out>, a=a@entry=0x0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlnotifier.cpp:70
      
      #41 0x00007ffff526ef3c in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) (object=<optimized out>, index=<optimized out>, a=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlengine.cpp:352
      
      #42 0x00007ffff12d9716 in doActivate<false>(QObject*, int, void**) (sender=sender@entry=0x503000099310, signal_index=signal_index@entry=3, argv=argv@entry=0x0) at /home/nico/workspace/qt6-dev/qtbase/src/corelib/kernel/qobject.cpp:4001
      
      #43 0x00007ffff12c4319 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x503000099310, m=m@entry=0x7ffff5c0caa0 <QQmlComponentAttached::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
      
          at /home/nico/workspace/qt6-dev/qtbase/src/corelib/kernel/qobject.cpp:4171
      
      #44 0x00007ffff520e8a0 in QQmlComponentAttached::completed() (this=this@entry=0x503000099310) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/moc_qqmlcomponentattached_p.cpp:153
      
      #45 0x00007ffff53bc5dc in QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&) (this=0x512000113140, interrupt=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlobjectcreator.cpp:1602
      
      #46 0x00007ffff520fbbb in QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) (enginePriv=0x51800000d480, state=state@entry=0x511000127878) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1171
      
      #47 0x00007ffff5222197 in QQmlComponentPrivate::completeCreate() (this=0x5110001277c0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1276
      
      #48 0x00007ffff5222dc9 in QQmlComponent::completeCreate() (this=<optimized out>) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1254
      
      #49 0x00007ffff521b2b4 in QQmlComponentPrivate::createWithProperties(QObject*, QMap<QString, QVariant> const&, QQmlContext*, QQmlComponentPrivate::CreateBehavior)
      
          (this=0x5110001277c0, parent=parent@entry=0x0, properties=..., context=context@entry=0x0, behavior=behavior@entry=QQmlComponentPrivate::CreateDefault) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:958
      
      #50 0x00007ffff521dcc5 in QQmlComponent::create(QQmlContext*) (this=<optimized out>, context=0x0) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:909
      
      #51 0x00007ffff51a2018 in QQmlApplicationEnginePrivate::finishLoad(QQmlComponent*) (this=this@entry=0x51800000d480, c=c@entry=0x502000012d90) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:156
      
      #52 0x00007ffff51a26f3 in QQmlApplicationEnginePrivate::ensureLoadingFinishes(QQmlComponent*) (this=this@entry=0x51800000d480, c=c@entry=0x502000012d90) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:183
      
      #53 0x00007ffff51a3d90 in QQmlApplicationEnginePrivate::startLoad(QAnyStringView, QAnyStringView) (this=<optimized out>, uri=..., typeName=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:142
      
      #54 0x00007ffff51a47d1 in QQmlApplicationEngine::loadFromModule(QAnyStringView, QAnyStringView) (this=<optimized out>, uri=..., typeName=...) at /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:389
      

      ASSERT: "start > 0" in file /home/nico/workspace/qt6-dev/qtdeclarative/src/qml/qml/qqmlcomponent.cpp, line 1086

      I understand that I should be passing "Test" instead of "Test.qml", and when I do that it does not assert. However "Test.qml" seems to work fine at least in 6.7, and other invalid names trigger a proper error when creating, not an assert.

      Tested with current dev branch (qtdeclarative db112ff02952437544dad9503b22785b3ff24e99)

      Attachments

        Issue Links

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

          Activity

            People

              fabiankosmale Fabian Kosmale
              nicolasfella Nicolas Fella
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes