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

Crash during QTableView::selectionChanged, QMacAccessibilityElement

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 6.5.2, 6.7.0
    • None
    • macOS Sonoma 14.3, Apple M2 Max (arm64)
    • macOS

    Description

      Crashing is occurring because of out of range index for during selection change on a table view.

       

      The model in use is a QAbstractItemModel. This wraps a QSqlQueryModel*, which is reloaded async on another thread and emits layoutChanged() when completed. Proper locking and bounds checking is in place with the model. An override of QTableView::selectionChanged() attempts to handle additional bounds checking which does not appear to make a difference.

       

      The crashing has occurred since 6.5.2 and the project was recently upgraded to 6.7 which seemed to improve the situation but it still occurs intermittently.

       

      Exception Type:        EXC_CRASH (SIGABRT)
      Exception Codes:       0x0000000000000000, 0x0000000000000000Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
      Terminating Process:   Logic Buddy [3140]Application Specific Information:
      abort() calledThread 0 Crashed::  Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib                   0x180c6e0dc __pthread_kill + 8
      1   libsystem_pthread.dylib                  0x180ca5cc0 pthread_kill + 288
      2   libsystem_c.dylib                        0x180bb1a40 abort + 180
      3   libc++abi.dylib                          0x180c5d070 abort_message + 132
      4   libc++abi.dylib                          0x180c4d12c demangling_terminate_handler() + 348
      5   libobjc.A.dylib                          0x1808f398c _objc_terminate() + 144
      6   libc++abi.dylib                          0x180c5c434 std::__terminate(void (*)()) + 16
      7   libc++abi.dylib                          0x180c5f520 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88
      8   libc++abi.dylib                          0x180c5f464 __cxa_throw + 308
      9   libobjc.A.dylib                          0x1808ea01c objc_exception_throw + 420
      10  CoreFoundation                           0x180d6eca0 -[__NSArrayM objectAtIndexedSubscript:] + 584
      11  libqcocoa.dylib                          0x1010e0624 -[QMacAccessibilityElement initWithId:role:] + 412 (qcocoaaccessibilityelement.mm:152)
      12  libqcocoa.dylib                          0x1010e0dfc +[QMacAccessibilityElement elementWithId:] + 68 (qcocoaaccessibilityelement.mm:190)
      13  libqcocoa.dylib                          0x1010deb54 QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent*) + 104 (qcocoaaccessibility.mm:32)
      14  QtWidgets                                0x10213a880 QTableView::selectionChanged(QItemSelection const&, QItemSelection const&) + 500 (qtableview.cpp:3532)
      15  Logic Buddy                              0x100670164 KeyEventTableView::selectionChanged(QItemSelection const&, QItemSelection const&) + 856
      16  QtCore                                   0x103063c9c QtPrivate::QSlotObjectBase::call(QObject*, void**) + 28 (qobjectdefs_impl.h:469) [inlined]
      17  QtCore                                   0x103063c9c void doActivate<false>(QObject*, int, void**) + 776 (qobject.cpp:4078)
      18  QtCore                                   0x103230ee4 QItemSelectionModel::selectionChanged(QItemSelection const&, QItemSelection const&) + 36 (moc_qitemselectionmodel.cpp:492) [inlined]
      19  QtCore                                   0x103230ee4 QItemSelectionModel::emitSelectionChanged(QItemSelection const&, QItemSelection const&) + 1536 (qitemselectionmodel.cpp:1965)
      20  QtCore                                   0x1032305a4 QItemSelectionModel::select(QItemSelection const&, QFlags<QItemSelectionModel::SelectionFlag>) + 636 (qitemselectionmodel.cpp:1327)
      21  QtWidgets                                0x1021370ac QTableView::setSelection(QRect const&, QFlags<QItemSelectionModel::SelectionFlag>) + 2592 (qtableview.cpp:2112)
      22  QtWidgets                                0x1020dfbec QAbstractItemView::mousePressEvent(QMouseEvent*) + 1112
      23  QtWidgets                                0x101eace5c QWidget::event(QEvent*) + 132
      24  QtWidgets                                0x101f2eb5c QFrame::event(QEvent*) + 56 (qframe.cpp:515)
      25  QtWidgets                                0x1020df71c QAbstractItemView::viewportEvent(QEvent*) + 1072 (qabstractitemview.cpp:1798)
      26  QtCore                                   0x103018d38 QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) + 272 (qcoreapplication.cpp:1273)
      27  QtWidgets                                0x101e615b4 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 240 (qapplication.cpp:3281)
      28  QtWidgets                                0x101e63614 QApplication::notify(QObject*, QEvent*) + 5092 (qapplication.cpp:2765)
      29  QtCore                                   0x103018a30 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212 (qcoreapplication.cpp:1134)
      30  QtWidgets                                0x101e61b74 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 808 (qapplication.cpp:2347)
      31  QtWidgets                                0x101ec2848 QWidgetWindow::handleMouseEvent(QMouseEvent*) + 1416 (qwidgetwindow.cpp:649)
      32  QtWidgets                                0x101ec1a54 QWidgetWindow::event(QEvent*) + 100 (qwidgetwindow.cpp:263)
      33  QtWidgets                                0x101e615d4 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272 (qapplication.cpp:3287)
      34  QtWidgets                                0x101e62428 QApplication::notify(QObject*, QEvent*) + 504 (qapplication.cpp:3238)
      35  QtCore                                   0x103018a30 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212 (qcoreapplication.cpp:1134)
      36  QtGui                                    0x1013e7eec QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 1760 (qguiapplication.cpp:2327)
      37  QtGui                                    0x101444c2c QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 408 (qwindowsysteminterface.cpp:1114)
      38  libqcocoa.dylib                          0x10108070c QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*) + 536 (qcocoaeventdispatcher.mm:922)
      39  CoreFoundation                           0x180d839dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
      40  CoreFoundation                           0x180d83970 __CFRunLoopDoSource0 + 176
      41  CoreFoundation                           0x180d836e0 __CFRunLoopDoSources0 + 244
      42  CoreFoundation                           0x180d822d0 __CFRunLoopRun + 828
      43  CoreFoundation                           0x180d8193c CFRunLoopRunSpecific + 608
      44  HIToolbox                                0x18b34a448 RunCurrentEventLoopInMode + 292
      45  HIToolbox                                0x18b34a0d8 ReceiveNextEventCommon + 220
      46  HIToolbox                                0x18b349fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
      47  AppKit                                   0x184560ed0 _DPSNextEvent + 660
      48  AppKit                                   0x184d4beec -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
      49  AppKit                                   0x18455437c -[NSApplication run] + 476
      50  libqcocoa.dylib                          0x10107e2a0 QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2128 (qcocoaeventdispatcher.mm:406)
      51  QtCore                                   0x10302258c QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 36 (qeventloop.cpp:100) [inlined]
      52  QtCore                                   0x10302258c QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 540 (qeventloop.cpp:182)
      53  QtCore                                   0x103019084 QCoreApplication::exec() + 112 (qcoreapplication.cpp:1478)
      54  Logic Buddy                              0x10046d7b4 main + 2204
      55  dyld                                     0x1809250e0 start + 2360 

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            jared-qt Charles Jetsel
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes