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

RunTimeHelpers:covertToObject() is asserting on Q_ASSERT(value.isString()) during a setSource on a QQuickWidget

    XMLWordPrintable

Details

    Description

          switch (value.type()) {
      ...
          <SNIP>
      ...
          case Value::Managed_Type:
              Q_ASSERT(value.isString());
              return engine->newStringObject(value);
      

      in qv4runtime.cpp.

      Our application is hitting this assert during a setSource() on a qquickwidget. Unfortunately it appears like the stack is being corrupted during this operation as seen below:

       	Qt5Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 1568	C++
       	Qt5Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 777	C++
       	Qt5Cored.dll!qt_assert(const char * assertion, const char * file, int line) Line 2895	C++
      >	Qt5Qmld.dll!QV4::RuntimeHelpers::convertToObject(QV4::ExecutionEngine * engine, const QV4::Value & value) Line 439	C++
       	Qt5Qmld.dll!QV4::Runtime::getProperty(QV4::ExecutionEngine * engine, const QV4::Value & object, int nameIndex) Line 679	C++
       	0000005d15700f4e()	Unknown
       	0000005d12c7b900()	Unknown
       	0000005d13da13c0()	Unknown
       	0000005d00000083()	Unknown
       	Qt5Qmld.dll!QV4::Debugging::DebuggerBreakPoint::~DebuggerBreakPoint(void)	Unknown
       	0000005d13da13a0()	Unknown
       	Qt5Qmld.dll!QV4::Scope::alloc(int nValues) Line 91	C++
      

      This was not happening in Qt 5.4. The qml behind this setsource is quite complicated, and has numerous context properties and enums registered to it. I attempted to reduce it to a minimal test case but haven't had any luck recreating the problem yet.

      Interestingly enough I can avoid the problem by changing to the following inside one of the dependent qml files:
      Original:

      ColumnLayout{
          Label {
          ...
          }
          TextField {
          ...
          }
      }
      

      to:

      ColumnLayout{
          Label {
          ...
          }
          TextInput {
          ...
          }
      }
      

      but I feel like this is a red herring and just avoiding the problem rather it being the problem (as I can't recreate this behaviour in a smaller example!).

      This happens in beta snapshot:
      qt-opensource-windows-x86-msvc2013_64-5.5.0-beta_2015-05-04_14-59-56-35.exe

      Attachments

        1. qtbug-46027-testcase.tar.gz
          0.5 kB
          Thomas McGuire
        2. stack.txt
          37 kB
          Alex Diev

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              lmv Luke
              Votes:
              11 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes