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

Freeze happens when Row is used without width/height set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.12.1
    • None
    • Linux/Wayland, Linux/X11, Linux/Yocto, Linux/Other display system, macOS
    • UI Bug Fixing Q1/2021

    Description

      Following code results in freeze at startup:

      import QtQuick 2.11
      import QtQuick.Window 2.11
      
      Window {
          id: root
          objectName: "MainWindow"
          visible: true
          width: 520
          height: 940    Rectangle {
              height: parent.height
              width: parent.width
              Row {
                  id: _row
                  onWidthChanged: {
                      console.log("onWidthChanged " + width)
                  }
                  height: parent.height
                  anchors.left: parent.left
                  Rectangle {color: "red"; height: parent.height; width: parent.width / 5}
                  Rectangle {color: "green"; height: parent.height; width: parent.width / 5}
                  Rectangle {visible: false; color: "red"; height: parent.height; width: parent.width / 5}
                  Rectangle {color: "blue"; height: parent.height; width: parent.width / 5}
                  Rectangle {visible: false; color: "red"; height: parent.height; width: parent.width / 5}
                  Rectangle {color: "cyan"; height: parent.height; width: parent.width / 5}
                  Rectangle {visible: false; color: "red"; height: parent.height; width: parent.width / 5}
                  Rectangle {color: "magenta"; height: parent.height; width: parent.width / 5}            ListView {
                      width: contentWidth
                      height: parent.height
                      model: 1
                      delegate: Image { source: "qt.jpeg" }
                  }
              }
          }
      }
       

       

      During freeze following backtrace reiterates:

      <64bt
      >&"bt\n"
      >~"#0  0x00007ffff5f132dd in write () at ../sysdeps/unix/syscall-template.S:84\n"
      >~"#1  0x00007ffff5e94bff in _IO_new_file_write (f=0x7ffff61e1540 <_IO_2_1_stderr_>, data=0x7fffffff8860, n=27) at fileops.c:1263\n"
      >~"#2  0x00007ffff5e9538a in new_do_write (to_do=27, data=0x7fffffff8860 \"qml: onWidthChanged -13384\\n\", fp=0x7ffff61e1540 <_IO_2_1_stderr_>) at fileops.c:518\n"
      >~"#3  _IO_new_file_xsputn (f=0x7ffff61e1540 <_IO_2_1_stderr_>, data=<optimized out>, n=27) at fileops.c:1342\n"
      >~"#4  0x00007ffff5e6bf94 in buffered_vfprintf (s=0x7ffff61e1540 <_IO_2_1_stderr_>, format=<optimized out>, args=<optimized out>) at vfprintf.c:2341\n"
      >~"#5  0x00007ffff5e6932d in _IO_vfprintf_internal (s=0x7ffff61e1540 <_IO_2_1_stderr_>, format=0x7ffff6b12506 \"%s\\n\", ap=ap@entry=0x7fffffffae18) at vfprintf.c:1293\n"
      >~"#6  0x00007ffff5e717f7 in __fprintf (stream=<optimized out>, format=<optimized out>) at fprintf.c:32\n"
      >~"#7  0x00007ffff681f135 in qDefaultMessageHandler(QtMsgType, QMessageLogContext const&, QString const&) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#8  0x00007fffd01fb73b in QDebugMessageServiceImpl::sendDebugMessage(QtMsgType, QMessageLogContext const&, QString const&) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/plugins/qmltooling/libqmldbg_messages.so\n"
      >~"#9  0x00007ffff681a25f in qt_message(QtMsgType, QMessageLogContext const&, char const*, __va_list_tag*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#10 0x00007ffff681a595 in QMessageLogger::debug(char const*, ...) const () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#11 0x00007ffff72292d6 in writeToConsole(QV4::FunctionObject const*, QV4::Value const*, QV4::Value const*, int, ConsoleLogTypes, bool) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#12 0x00007ffff714bdbd in QV4::Runtime::method_callProperty(QV4::ExecutionEngine*, QV4::Value*, int, QV4::Value*, int) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#13 0x00007ffff70e2088 in QV4::Moth::VME::interpret(QV4::CppStackFrame*, QV4::ExecutionEngine*, char const*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#14 0x00007ffff70e6ef4 in QV4::Moth::VME::exec(QV4::CppStackFrame*, QV4::ExecutionEngine*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#15 0x00007ffff707e4de in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext const*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#16 0x00007ffff71e7678 in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#17 0x00007ffff718a3b2 in QQmlBoundSignalExpression::evaluate(void**) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#18 0x00007ffff718b8b3 in QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#19 0x00007ffff71c7404 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#20 0x00007ffff716db64 in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Qml.so.5\n"
      >~"#21 0x00007ffff6a1cf12 in QMetaObject::activate(QObject*, int, int, void**) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#22 0x00007fffd05e644c in QQuickItem::geometryChanged(QRectF const&, QRectF const&) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#23 0x00007fffd05ed0b0 in QQuickItem::setImplicitSize(double, double) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#24 0x00007fffd070a4cc in QQuickBasePositioner::prePositioning() () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#25 0x00007fffd0608240 in QQuickWindowPrivate::polishItems() () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#26 0x00007fffd05b769b in QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*, bool) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#27 0x00007fffd05b9490 in QSGThreadedRenderLoop::handleExposure(QQuickWindow*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#28 0x00007fffd05b991b in QSGThreadedRenderLoop::exposureChanged(QQuickWindow*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#29 0x00007ffff7705a0b in QWindow::event(QEvent*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Gui.so.5\n"
      >~"#30 0x00007fffd0612885 in QQuickWindow::event(QEvent*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Quick.so.5\n"
      >~"#31 0x00007ffff69f0e28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#32 0x00007ffff76fbb72 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Gui.so.5\n"
      >~"#33 0x00007ffff76fbd9d in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Gui.so.5\n"
      >~"#34 0x00007ffff76d79fb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Gui.so.5\n"
      >~"#35 0x00007fffeec7481a in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5XcbQpa.so.5\n"
      >~"#36 0x00007ffff25b9197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0\n"
      >~"#37 0x00007ffff25b93f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0\n"
      >~"#38 0x00007ffff25b949c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0\n"
      >~"#39 0x00007ffff6a481ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#40 0x00007ffff69ef78a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#41 0x00007ffff69f8190 in QCoreApplication::exec() () from /home/diredko/Qt/5.12.1/5.12.1/gcc_64/lib/libQt5Core.so.5\n"
      >~"#42 0x0000000000400d06 in main (argv=1, argc=0x7fffffffdb48) at ../freeze/main.cpp:10\n"
      >64^done 

      Below is the output of application:

      qml: onWidthChanged -1
      qml: onWidthChanged -2
      qml: onWidthChanged -3
      qml: onWidthChanged -4
      qml: onWidthChanged -5
      qml: onWidthChanged -6
      
      ...
      
      qml: onWidthChanged -13380
      qml: onWidthChanged -13381
      qml: onWidthChanged -13382
      qml: onWidthChanged -13383

      Attachments

        1. main-layouts.qml
          1 kB
          Jan Arve
        2. row-freeze-sample.tar.gz
          7 kB
          diredko

        Issue Links

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

          Activity

            People

              smd Jan Arve
              diredko diredko
              Votes:
              17 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes