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

Crash when using QRemoteObjectDynamicReplica in QML

    XMLWordPrintable

Details

    Description

      Using any remote QObject as a dynamic replica in QML causes a crash.

      Server:

      QRemoteObjectHost host(QUrl(QStringLiteral("local:replica")));
      QObject obj;
      host.enableRemoting(&obj, "Test");
      

      Client
       

      QRemoteObjectNode node;
      bool connected = node.connectToNode(QUrl(QStringLiteral("local:replica")));
      if (connected) {
          auto replica = node.acquireDynamic("Test");
          connect(replica, &QRemoteObjectReplica::initialized, this, [replica, this] {
              engine->rootContext()->setContextProperty(QStringLiteral("replica"), replica);
          }
          replica->waitForSource(); // looks like this is needed to init the replica
      }
      

       

      Any access of "replica" in a QML file causes this crash.

      Trace:

      Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
      0   QtQml                                    0x1032c4f8a QMetaObject::SuperData::operator QMetaObject const*() const + 0 (qobjectdefs.h:585) [inlined]
      1   QtQml                                    0x1032c4f8a QMetaObject::superClass() const + 0 (qobjectdefs.h:676) [inlined]
      2   QtQml                                    0x1032c4f8a QQmlMetaTypeData::propertyCache(QMetaObject const*, QTypeRevision) + 330 (qqmlmetatypedata.cpp:119)
      3   QtQml                                    0x1032c4fa2 QQmlMetaTypeData::propertyCache(QMetaObject const*, QTypeRevision) + 354 (qqmlmetatypedata.cpp:120)
      4   QtQml                                    0x1032c4fa2 QQmlMetaTypeData::propertyCache(QMetaObject const*, QTypeRevision) + 354 (qqmlmetatypedata.cpp:120)
      5   QtQml                                    0x1032c4fa2 QQmlMetaTypeData::propertyCache(QMetaObject const*, QTypeRevision) + 354 (qqmlmetatypedata.cpp:120)
      6   QtQml                                    0x1032c4fa2 QQmlMetaTypeData::propertyCache(QMetaObject const*, QTypeRevision) + 354 (qqmlmetatypedata.cpp:120)
      7   QtQml                                    0x1032b177f QQmlMetaType::propertyCache(QMetaObject const*, QTypeRevision) + 23 (qqmlmetatype.cpp:1390) [inlined]
      8   QtQml                                    0x1032b177f QQmlMetaType::propertyCache(QObject*, QTypeRevision) + 79 (qqmlmetatype.cpp:1383)
      9   QtQml                                    0x1032781f1 QQmlData::createPropertyCache(QObject*) + 65 (qqmlengine.cpp:1466)
      10  QtQml                                    0x10319cf2a QQmlData::ensurePropertyCache(QObject*) + 8 (qqmldata_p.h:257) [inlined]
      11  QtQml                                    0x10319cf2a QV4::QObjectWrapper::create(QV4::ExecutionEngine*, QObject*) + 298 (qv4qobjectwrapper.cpp:898)
      12  QtQml                                    0x10319cb0b QV4::QObjectWrapper::wrap_slowPath(QV4::ExecutionEngine*, QObject*) + 139 (qv4qobjectwrapper.cpp:786)
      13  QtQml                                    0x103197d86 QV4::QObjectWrapper::wrap(QV4::ExecutionEngine*, QObject*) + 98 (qv4qobjectwrapper_p.h:242) [inlined]
      14  QtQml                                    0x103197d86 QV4::loadProperty(QV4::ExecutionEngine*, QV4::Heap::Object*, QObject*, QQmlPropertyData const&) + 186 (qv4qobjectwrapper.cpp:134) [inlined]
      15  QtQml                                    0x103197d86 QV4::QObjectWrapper::getProperty(QV4::ExecutionEngine*, QV4::Heap::Object*, QObject*, QQmlPropertyData const*, QFlags<QV4::QObjectWrapper::Flag>) + 1542 (qv4qobjectwrapper.cpp:391)
      16  QtQml                                    0x10319e9e4 QV4::QObjectWrapper::virtualResolveLookupGetter(QV4::Object const*, QV4::ExecutionEngine*, QV4::Lookup*) + 1764 (qv4qobjectwrapper.cpp:1120)
      17  QtQml                                    0x1031f539e QV4::Moth::VME::interpret(QV4::JSTypesStackFrame*, QV4::ExecutionEngine*, char const*) + 2526 (qv4vme_moth.cpp:674)
      18  QtQml                                    0x1031f494f QV4::Moth::VME::exec(QV4::JSTypesStackFrame*, QV4::ExecutionEngine*) + 383 (qv4vme_moth.cpp:487)
      19  QtQml                                    0x103158d50 QV4::doCall(QV4::Function*, QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext*) + 352 (qv4function.cpp:54)
      20  QtQml                                    0x1032a371f QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) + 559 (qqmljavascriptexpression.cpp:238)

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            flaviotordini Flavio Tordini
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes