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

rootContext()->setContextProperty assertion with frozen `QQmlPropertyMap`

    XMLWordPrintable

    Details

    • Commits:
      f7f6e14094 (qt/qtdeclarative/dev) f7f6e14094 (qt/tqtc-qtdeclarative/dev) b5f9790b69 (qt/qtdeclarative/6.3) b5f9790b69 (qt/tqtc-qtdeclarative/6.3) ea442c62a2 (qt/tqtc-qtdeclarative/6.2)

      Description

      in my code i'm populating a `QQmlPropertyMap` with a number of entries, freeze it, and set it as context property.
      when doing so, the `rootContext()->setContextProperty` causes an assertion failure:

      [qqmlpropertycache_p.h:362] default: ASSERT: "rv->isSignal() || rv->coreIndex() == -1" in file /home/tim/dev/qt5/build-debug/qtbase/include/QtQml/6.2.4/QtQml/private/../../../../../../../qtdeclarative/src/qml/qml/qqmlpropertycache_p.h, line 362

      3  qt_message_fatal                                            qlogging.cpp                 1905 0x7ffff56532d0 
      4  QMessageLogger::fatal                                       qlogging.cpp                 890  0x7ffff564f40a 
      5  qt_assert                                                   qglobal.cpp                  3291 0x7ffff5642238 
      6  QQmlPropertyCache::signal                                   qqmlpropertycache_p.h        362  0x7ffff63657e8 
      7  flush_vme_signal                                            qqmlproperty.cpp             1759 0x7ffff6365107 
      8  QQmlPropertyPrivate::flushSignal                            qqmlproperty.cpp             1798 0x7ffff6365287 
      9  QQmlNotifierEndpoint::connect                               qqmlnotifier.cpp             138  0x7ffff631d9b3 
      10 QQmlPropertyCapture::captureNonBindableProperty             qqmljavascriptexpression.cpp 457  0x7ffff62dddf0 
      11 QQmlPropertyCapture::captureProperty                        qqmljavascriptexpression.cpp 371  0x7ffff62dd67c 
      12 QV4::QObjectWrapper::getProperty                            qv4qobjectwrapper.cpp        279  0x7ffff616a1cc 
      13 QV4::QObjectWrapper::lookupGetterImpl<QV4::Lookup::getterQObject(QV4::Lookup *, QV4::ExecutionEngine *, const QV4::Value&)::<lambda()>>(QV4::Lookup *, QV4::ExecutionEngine *, const QV4::Value &, bool, struct {...}) qv4qobjectwrapper_p.h        274  0x7ffff613572e 
      14 QV4::Lookup::getterQObject                                  qv4lookup.cpp                415  0x7ffff613492f 
      15 QV4::QObjectWrapper::virtualResolveLookupGetter             qv4qobjectwrapper.cpp        950  0x7ffff616e5e6 
      16 QV4::Object::resolveLookupGetter                            qv4object_p.h                379  0x7ffff6135a3c 
      17 QV4::Lookup::resolveGetter                                  qv4lookup.cpp                73   0x7ffff61332f5 
      18 QV4::Lookup::getterGeneric                                  qv4lookup.cpp                144  0x7ffff6133a82 
      19 QV4::Moth::VME::interpret                                   qv4vme_moth.cpp              744  0x7ffff61f81e6 
      20 QV4::Moth::VME::exec                                        qv4vme_moth.cpp              557  0x7ffff61f5d0c 
      21 QV4::Function::call                                         qv4function.cpp              100  0x7ffff610c96d 
      22 QQmlJavaScriptExpression::evaluate                          qqmljavascriptexpression.cpp 278  0x7ffff62dd052 
      23 QQmlBinding::evaluate                                       qqmlbinding.cpp              223  0x7ffff624cd77 
      24 QQmlNonbindingBinding::doUpdate                             qqmlbinding.cpp              283  0x7ffff625103c 
      25 QQmlBinding::update                                         qqmlbinding.cpp              199  0x7ffff624cbf0 
      26 QQmlBinding::expressionChanged                              qqmlbinding.cpp              651  0x7ffff624e51f 
      27 QQmlJavaScriptExpressionGuard_callback                      qqmljavascriptexpression.cpp 588  0x7ffff62de869 
      28 QQmlNotifier::emitNotify                                    qqmlnotifier.cpp             104  0x7ffff631d5d2 
      29 QQmlData::signalEmitted                                     qqmlengine.cpp               635  0x7ffff628e37b 
      30 doActivate<false>                                           qobject.cpp                  3804 0x7ffff57d710e 
      31 QMetaObject::activate                                       qobject.cpp                  3985 0x7ffff57cf205 
      32 QQmlContext::setContextProperty                             qqmlcontext.cpp              297  0x7ffff62762d1 
      33 QQmlContext::setContextProperty                             qqmlcontext.cpp              314  0x7ffff62763ed 
      

      it does not crash if (a) i don't freeze the `QQmlPropertyMap` or (b) if i `freeze` the map after `QQmlContext::setContextProperty`

      any idea what may go wrong here?

        Attachments

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

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            timblechmann tim blechmann
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes