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

QMetaObjectPublisher crash if same object is used on different transports

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.14.0 Alpha
    • 5.9.1, 5.9.2, 5.9.3, 5.10.0 RC2, 5.10.0 RC3, 5.10.0 Alpha, 5.10.0 Beta 1, 5.10.0 Beta 2, 5.10.0 Beta 3, 5.10.0 Beta 4, 5.10.0 RC, 5.10.0, 5.9.4, 5.9.5, 5.10.1, 5.11.0 RC2, 5.11.0 Alpha, 5.11.0 Beta 1, 5.11.0 Beta 2, 5.11.0 Beta 3, 5.11.0 Beta 4, 5.11.0 RC 1, 5.11.0, 5.11.1, 5.11.2, 5.11.3, 5.12.0 Alpha, 5.12.0 Beta 1, 5.12.0 Beta 2, 5.12.0 Beta 3, 5.12.0 Beta 4, 5.12.0 RC, 5.12.0 RC2, 5.12.0
    • WebChannel
    • None
    • 984c4e6b4dd05561bb39f6daf305e520dfa9f0e6 (qt/qtwebchannel/dev)

    Description

      If you create an application described in https://bugreports.qt.io/browse/QTBUG-50074 and call getA from another web client (other browser or other tab, ..) and then reload the webpage and try to change a property of the object that you get from getA the qt application crashes or the values are not updated anymore. Also when you call the getA from the other client you get wrong initial property values of that object if the values changed since the object was first requested with getA. My temporary solution would be to change in QJsonValue QMetaObjectPublisher::wrapResult(... starting from row 564

      Q_ASSERT(object == wrappedObjects.value(id).object);

      // check if this transport is already assigned to the object

      if (transport && !wrappedObjects.value(id).transports.contains(transport))         wrappedObjects[id].transports.append(transport);

      classInfo = wrappedObjects.value(id).classinfo;

      to

      Q_ASSERT(object == wrappedObjects.value(id).object);

      // check if this transport is already assigned to the object

      if (transport && !wrappedObjects.value(id).transports.contains(transport)) { wrappedObjects[id].transports.append(transport);

      transportedWrappedObjects.insert(transport, id);

      }

      classInfo = classInfoForObject(object, transport);

      I cannot trace the bug so I cannot tell you where it crashes exactly but it is easy to reproduce.

      Attachments

        1. webchcrash.zip
          16 kB
        2. wrapResult.patch
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            milianw Milian Wolff
            aljo666 Aljoša Merljak
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes