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

Accessing contentsSize too soon crashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.5
    • 5.9.3, 5.10.0
    • WebEngine
    • None
    • Qt 5.9.3 on KDE neon
    • ff1eb61ac5139f1760d35e884642c4b805b5e97c

    Description

      Accessing the contentsSize properties too soon after object creation, e.g. by assigning it to a property such as Layout.preferredWidth or accessing it in Component.onCompleted crashes.

      import QtQuick 2.8
      import QtQuick.Window 2.2
      import QtWebEngine 1.3
      
      Window {
          visible: true
          width: 640
          height: 480
      
          WebEngineView {
              Component.onCompleted: console.log("Boom!", contentsSize)
          }
      }
      

      Doing the same somewhat later (I tried a 1000ms Timer), I get a QSize returned as expected. It does not matter whether I actually set a URL or not.

      Backtrace:

      #0  0x00007fffca009354 in QtWebEngineCore::WebContentsAdapter::lastContentsSize() const () from /usr/lib/x86_64-linux-gnu/libQt5WebEngineCore.so.5
      #1  0x00007fffd5d3f771 in QQuickWebEngineView::contentsSize() const () from /usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5
      #2  0x00007fffd5d554f0 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5
      #3  0x00007fffd5d55f0b in QQuickWebEngineView::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5WebEngine.so.5
      #4  0x00007ffff7354d95 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #5  0x00007ffff7355ae8 in QV4::QQmlValueTypeWrapper::get(QV4::Managed const*, QV4::String*, bool*) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #6  0x00007ffff72b1431 in QV4::RuntimeHelpers::objectDefaultValue(QV4::Object const*, int) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #7  0x00007ffff72b5d6a in QV4::Value::toQStringNoThrow() const () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #8  0x00007ffff7376e24 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #9  0x00007ffff72b358e in QV4::Runtime::method_callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #10 0x00007ffff72a9c28 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #11 0x00007ffff72ab373 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #12 0x00007ffff7227e3c in QV4::ExecutionContext::call(QV4::Scope&, QV4::CallData*, QV4::Function*, QV4::FunctionObject const*) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #13 0x00007ffff73474f1 in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*, QV4::Scope&) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #14 0x00007ffff72e01bb in QQmlBoundSignalExpression::evaluate(void**) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #15 0x00007ffff72e161b in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #16 0x00007ffff73239c7 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #17 0x00007ffff72c31e4 in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #18 0x00007ffff6bfc97e in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #19 0x00007ffff735a960 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #20 0x00007ffff72d68ce in QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #21 0x00007ffff72d69e7 in QQmlComponentPrivate::completeCreate() () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      #22 0x00007ffff72d67ba in QQmlComponent::create(QQmlContext*) () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
      

      Attachments

        For Gerrit Dashboard: QTBUG-65942
        # Subject Branch Project Status CR V

        Activity

          People

            pvarga Peter Varga
            broulik Kai Uwe Broulik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes