Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-28593

If built against Qt 6.5, Qt Creator hangs when showing the Issues pane

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • Qt Creator 9.0.0
    • All Other Issues
    • None

    Description

      When switching to the issues view while it contains entries, a Qt 6.5-built Qt Creator hangs.

      TaskDelegate::sizeHint() is at some point called with a QStyleOptionViewItem that has a 0-sized rect. In that case, later on, QTextLine::setLineWidth() is called with a negative value. Perhaps also some other data is invalid in that call.

      Qt 6.4 tolerates that "weird" call. But Qt 6.5 hangs in the "while(true)" loop.

      Backtrace of odd TaskDelegate::sizeHint call
      ProjectExplorer!ProjectExplorer::Internal::TaskDelegate::sizeHint(class QStyleOptionViewItem * option = 0x0000007d`7f978530, class QModelIndex * index = 0x0000007d`7f9784f8)+0xa3 [qt-creator-qt6\src\plugins\projectexplorer\taskwindow.cpp @ 759]
      Qt6Widgetsd!QListViewPrivate::itemSize(class QStyleOptionViewItem * option = 0x0000007d`7f978530, class QModelIndex * index = 0x0000007d`7f9784f8)+0xce [qt6_desktop\qtbase\src\widgets\itemviews\qlistview.cpp @ 1905]
      Qt6Widgetsd!QListView::updateGeometries(void)+0x277 [qt6_desktop\qtbase\src\widgets\itemviews\qlistview.cpp @ 1575]
      Qt6Widgetsd!QAbstractItemView::doItemsLayout(void)+0x36 [qt6_desktop\qtbase\src\widgets\itemviews\qabstractitemview.cpp @ 1242]
      Qt6Widgetsd!QListView::doItemsLayout(void)+0x1a8 [qt6_desktop\qtbase\src\widgets\itemviews\qlistview.cpp @ 1558]
      Qt6Widgetsd!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,void (<function> * f = 0x0000007d`7f978880, class QAbstractItemView * o = 0x00000194`e606ff20, void ** arg = 0x00000194`e5c15c78)+0x46 [qt6_desktop\qtbase\src\corelib\kernel\qobjectdefs_impl.h @ 135]
      Qt6Widgetsd!QtPrivate::FunctionPointer<void (<function> * f = 0x0000007d`7f9788e0, class QAbstractItemView * o = 0x00000194`e606ff20, void ** arg = 0x00000194`e5c15c78)+0x3d [qt6_desktop\qtbase\src\corelib\kernel\qobjectdefs_impl.h @ 173]
      Qt6Widgetsd!QtPrivate::QSlotObject<void (int which = 0n1, class QtPrivate::QSlotObjectBase * this_ = 0x00000194`e938f6f0, class QObject * r = 0x00000194`e606ff20, void ** a = 0x00000194`e5c15c78, bool * ret = 0x00000000`00000000)+0xac [qt6_desktop\qtbase\src\corelib\kernel\qobjectdefs_impl.h @ 385]
      Qt6Cored!QtPrivate::QSlotObjectBase::call(class QObject * r = 0x00000194`e606ff20, void ** a = 0x00000194`e5c15c78)+0x43 [qt6_desktop\qtbase\src\corelib\kernel\qobjectdefs_impl.h @ 363]
      Qt6Cored!QMetaCallEvent::placeMetaCall(class QObject * object = 0x00000194`e606ff20)+0x41 [qt6_desktop\qtbase\src\corelib\kernel\qobject.cpp @ 608]
      Qt6Cored!QObject::event(class QEvent * e = 0x00000194`e5c15c30)+0x1cd [qt6_desktop\qtbase\src\corelib\kernel\qobject.cpp @ 1378]
      Qt6Widgetsd!QWidget::event(class QEvent * event = 0x00000194`e5c15c30)+0x1c8b [qt6_desktop\qtbase\src\widgets\kernel\qwidget.cpp @ 9285]
      Qt6Widgetsd!QFrame::event(class QEvent * e = 0x00000194`e5c15c30)+0x40 [qt6_desktop\qtbase\src\widgets\widgets\qframe.cpp @ 515]
      Qt6Widgetsd!QAbstractScrollArea::event(class QEvent * e = 0x00000194`e5c15c30)+0x896 [qt6_desktop\qtbase\src\widgets\widgets\qabstractscrollarea.cpp @ 1010]
      Qt6Widgetsd!QAbstractItemView::event(class QEvent * event = 0x00000194`e5c15c30)+0x1af [qt6_desktop\qtbase\src\widgets\itemviews\qabstractitemview.cpp @ 1695]
      Qt6Widgetsd!QListView::event(class QEvent * e = 0x00000194`e5c15c30)+0x1e [qt6_desktop\qtbase\src\widgets\itemviews\qlistview.cpp @ 1744]
      Qt6Widgetsd!QApplicationPrivate::notify_helper(class QObject * receiver = 0x00000194`e606ff20, class QEvent * e = 0x00000194`e5c15c30)+0x1ab [qt6_desktop\qtbase\src\widgets\kernel\qapplication.cpp @ 3278]
      Qt6Widgetsd!QApplication::notify(class QObject * receiver = 0x00000194`e606ff20, class QEvent * e = 0x00000194`e5c15c30)+0x3318 [qt6_desktop\qtbase\src\widgets\kernel\qapplication.cpp @ 3225]
      Qt6Cored!QCoreApplication::notifyInternal2(class QObject * receiver = 0x00000194`e606ff20, class QEvent * event = 0x00000194`e5c15c30)+0x157 [qt6_desktop\qtbase\src\corelib\kernel\qcoreapplication.cpp @ 1065]
      Qt6Cored!QCoreApplication::sendEvent(class QObject * receiver = 0x00000194`e606ff20, class QEvent * event = 0x00000194`e5c15c30)+0x7b [qt6_desktop\qtbase\src\corelib\kernel\qcoreapplication.cpp @ 1484]
      Qt6Cored!QCoreApplicationPrivate::sendPostedEvents(class QObject * receiver = 0x00000000`00000000, int event_type = 0n0, class QThreadData * data = 0x00000194`dbe4cfa0)+0x552 [qt6_desktop\qtbase\src\corelib\kernel\qcoreapplication.cpp @ 1845]
      Qt6Cored!QEventDispatcherWin32::sendPostedEvents(void)+0x8f [qt6_desktop\qtbase\src\corelib\kernel\qeventdispatcher_win.cpp @ 894]
      Qt6Guid!QWindowsGuiEventDispatcher::sendPostedEvents(void)+0x15 [qt6_desktop\qtbase\src\gui\platform\windows\qwindowsguieventdispatcher.cpp @ 44]
      Qt6Cored!QEventDispatcherWin32::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0xbf [qt6_desktop\qtbase\src\corelib\kernel\qeventdispatcher_win.cpp @ 464]
      Qt6Guid!QWindowsGuiEventDispatcher::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x4b [qt6_desktop\qtbase\src\gui\platform\windows\qwindowsguieventdispatcher.cpp @ 36]
      Qt6Cored!QEventLoop::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x7c [qt6_desktop\qtbase\src\corelib\kernel\qeventloop.cpp @ 101]
      Qt6Cored!QEventLoop::exec(class QFlags<enum QEventLoop::ProcessEventsFlag> flags = class QFlags<enum QEventLoop::ProcessEventsFlag>)+0x1f4 [qt6_desktop\qtbase\src\corelib\kernel\qeventloop.cpp @ 182]
      Qt6Cored!QCoreApplication::exec(void)+0x19a [qt6_desktop\qtbase\src\corelib\kernel\qcoreapplication.cpp @ 1386]
      Qt6Guid!QGuiApplication::exec(void)+0x1a [qt6_desktop\qtbase\src\gui\kernel\qguiapplication.cpp @ 1887]
      Qt6Widgetsd!QApplication::exec(void)+0xc [qt6_desktop\qtbase\src\widgets\kernel\qapplication.cpp @ 2559]
      qtcreator!main(int argc = 0n10, char ** argv = 0x00000194`dbde6e70)+0x4135 [qt-creator-qt6\src\app\main.cpp @ 765]
      
      Minimal reproducer (use in QtC with "New Project -> Other Project -> Code Snippet")
      #include <QApplication>
      #include <QTextLayout>
      
      int textHeightForWidth(int width)
      {
          int height = 0;
          QTextLayout tl("Foo bar und so");
          tl.beginLayout();
          while (true) {
              QTextLine line = tl.createLine();
              if (!line.isValid())
                  break;
              line.setLineWidth(width);
              height += line.height();
          }
          tl.endLayout();
          return height;
      }
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          qDebug() << textHeightForWidth(50);
          qDebug() << textHeightForWidth(-1); // Proceeds with Qt < 6.5, Freezes with Qt 6.5
          return 0;
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              con Eike Ziller
              portale Alessandro Portale
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes