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

qFatal() is called when dragging some elements in a treeview in certain circumstances

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.2, 5.0.0 Beta 1
    • 4.8.0
    • Widgets: Itemviews
    • None
    • * Windows Seven
      * Qt 4.8.0
      * Mingw (GCC 4.4) from Qt Creator 2.4.1

    Description

      Here is the way to crash Qt:

      • Unzip the attached project.
      • Run it in DEBUG mode.
      • Select the first cell of the first row
      • Drag the second cell of the first row anywhere, the crash appears at the beginning of the drag.
      • qFatal() is called from QVector. The last instruction of the method 'QTreeViewPrivate::adjustViewOptionsForIndex(..)' tries to access an nonexistent element: option->viewItemPosition = viewItemPosList.at(columnIndex);

      This is because 'd->leftAndRight' is miscalculated and contains (0,0). I didn't investigate more because the code of 'calcLogicalIndices(..)' is so weird...

      Here is the stack trace:

       
      0	qt_assert_x	qglobal.cpp	2008	0x6a10ebcc	
      1	QVector<QStyleOptionViewItemV4::ViewItemPosition>::at	qvector.h	351	0x118a55b	
      2	QTreeViewPrivate::adjustViewOptionsForIndex	qtreeview.cpp	1403	0xeed03d	
      3	QAbstractItemViewPrivate::renderToPixmap	qabstractitemview.cpp	4241	0xebf56b	
      4	QAbstractItemView::startDrag	qabstractitemview.cpp	3529	0xebc6f9	
      5	QAbstractItemView::mouseMoveEvent	qabstractitemview.cpp	1725	0xeb5367	
      6	QTreeView::mouseMoveEvent	qtreeview.cpp	1939	0xeefc2a	
      7	QWidget::event	qwidget.cpp	8346	0xa063a2	
      8	QFrame::event	qframe.cpp	557	0xd9a5b8	
      9	QAbstractScrollArea::viewportEvent	qabstractscrollarea.cpp	1043	0xe2950f	
      10	QAbstractItemView::viewportEvent	qabstractitemview.cpp	1644	0xeb4b6d	
      11	QTreeView::viewportEvent	qtreeview.cpp	1257	0xeec8f7	
      12	QAbstractScrollAreaPrivate::viewportEvent	qabstractscrollarea_p.h	100	0x108bd23	
      13	QAbstractScrollAreaFilter::eventFilter	qabstractscrollarea_p.h	116	0x108a0e4	
      14	QCoreApplicationPrivate::sendThroughObjectEventFilters	qcoreapplication.cpp	986	0x6a213483	
      15	QApplicationPrivate::notify_helper	qapplication.cpp	4546	0x9bbfff	
      16	QApplication::notify	qapplication.cpp	4093	0x9ba26a	
      17	QCoreApplication::notifyInternal	qcoreapplication.cpp	876	0x6a213252	
      18	QCoreApplication::sendSpontaneousEvent	qcoreapplication.h	234	0x1050246	
      19	QApplicationPrivate::sendMouseEvent	qapplication.cpp	3159	0x9b8ad6	
      20	QETWidget::translateMouseEvent	qapplication_win.cpp	3363	0xa23171	
      21	QtWndProc	qapplication_win.cpp	1696	0xa1df66	
      22	USER32!OffsetRect	C:\Windows\syswow64\user32.dll	0	0x74cf62fa	
      23	USER32!CreateWindowStationW	C:\Windows\syswow64\user32.dll	0	0x74cf80a9	
      24	USER32!IsWindow	C:\Windows\syswow64\user32.dll	0	0x74cf6d3a	
      25	USER32!AnyPopup	C:\Windows\syswow64\user32.dll	0	0x74cf77c4	
      26	USER32!IsDialogMessage	C:\Windows\syswow64\user32.dll	0	0x74cf788a	
      27	QEventDispatcherWin32::processEvents	qeventdispatcher_win.cpp	808	0x6a239cc6	
      28	QGuiEventDispatcherWin32::processEvents	qapplication_win.cpp	1202	0xa1ca06	
      29	QEventLoop::processEvents	qeventloop.cpp	149	0x6a210e76	
      30	QEventLoop::exec	qeventloop.cpp	204	0x6a210fcc	
      ...	<More>				
      

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            gburri Greg Burri
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes