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

Qt crashes on determining sizeHints for strings ending in carriage return

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.11.1
    • 5.1.0
    • Widgets: Itemviews
    • None

    Description

      The following example creates a segfault:

      #include <QApplication>
      #include <QTreeWidget>
      
      int
      main(int argc, char **argv)
      {
          QApplication app(argc, argv);
      
          QTreeWidget tw;
          new QTreeWidgetItem(&tw, QStringList() << "Hello Worlt!\r");
          tw.show();
      
          return app.exec();
      }
      

      The backtrace is as follows:

      Backtrace (please include this in your support request):
      ./test-widgetfactory(_ZN2Ur11Application11catchSignalEi+0x2d)[0x43d303]
      /lib64/libpthread.so.0(+0xf1f0)[0x7ff7af6b61f0]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Gui.so.5(_ZNK11QTextEngine21shapeTextWithHarfbuzzEi+0x75b)[0x7ff7adbc1d9b]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Gui.so.5(_ZNK11QTextEngine9shapeTextEi+0xd3)[0x7ff7adbc2973]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Gui.so.5(_ZNK11QTextEngine5shapeEi+0xdb)[0x7ff7adbc2d5b]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Gui.so.5(_ZN9QTextLine13layout_helperEi+0xf18)[0x7ff7adbd4a08]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Gui.so.5(_ZN9QTextLine12setLineWidthEd+0xcd)[0x7ff7adbd5b9d]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(+0x19c3b6)[0x7ff7ae4763b6]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(+0x1a2f5b)[0x7ff7ae47cf5b]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(+0x1a39b8)[0x7ff7ae47d9b8]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZNK12QCommonStyle16sizeFromContentsEN6QStyle12ContentsTypeEPK12QStyleOptionRK5QSizePK7QWidget+0x1e5)[0x7ff7ae47e395]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(+0x20f257)[0x7ff7ae4e9257]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZNK19QStyledItemDelegate8sizeHintERK20QStyleOptionViewItemRK11QModelIndex+0x2d3)[0x7ff7ae6b05c3]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZNK9QTreeView16indexRowSizeHintERK11QModelIndex+0x388)[0x7ff7ae66b338]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZNK16QTreeViewPrivate10itemHeightEi+0x99)[0x7ff7ae66b4d9]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN16QTreeViewPrivate16updateScrollBarsEv+0x273)[0x7ff7ae66b7b3]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN9QTreeView16updateGeometriesEv+0x2bf)[0x7ff7ae66bb6f]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN7QWidget5eventEP6QEvent+0x41c)[0x7ff7ae44927c]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN6QFrame5eventEP6QEvent+0x26)[0x7ff7ae52ec46]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN17QAbstractItemView13viewportEventEP6QEvent+0x1fb)[0x7ff7ae62f77b]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN9QTreeView13viewportEventEP6QEvent+0x1ea)[0x7ff7ae66ca7a]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Core.so.5(_ZN23QCoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObjectP6QEvent+0xed)[0x7ff7af2759ed]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x7f)[0x7ff7ae412cef]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x456)[0x7ff7ae4161c6]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Core.so.5(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84)[0x7ff7af2757c4]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN14QWidgetPrivate30sendPendingMoveAndResizeEventsEbb+0x1c5)[0x7ff7ae445095]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN14QWidgetPrivate11show_helperEv+0x24)[0x7ff7ae44cff4]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN7QWidget10setVisibleEb+0x13d)[0x7ff7ae44d55d]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN14QWidgetPrivate12showChildrenEb+0x110)[0x7ff7ae44d3f0]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN14QWidgetPrivate11show_helperEv+0x40)[0x7ff7ae44d010]
      /local/mlangen/AbsInt/SVN/build/launcher.default/usr/lib/libQt5Widgets.so.5(_ZN7QWidget10setVisibleEb+0x13d)[0x7ff7ae44d55d]
      ./test-widgetfactory(main+0xb0)[0x41f56c]
      /lib64/libc.so.6(__libc_start_main+0xf5)[0x7ff7acc87a15]
      ./test-widgetfactory[0x41f3f9]
      

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            mlangen Marc Langenbach
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes