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

[Reg 6.4.3->6.5] QTreeWidget crash inside QDialog on MacOS

    XMLWordPrintable

Details

    • macOS
    • c59b34b8c (dev), f326d50e7 (6.6), 25f92391a (6.5), a0b7eee6c (dev), 864544eb1 (6.6), 15d588e87 (6.5)

    Description

      Minimal example:

      TestDialog::TestDialog(QWidget * parent)
        : QDialog(parent)
      {
        m_tree = new QTreeWidget(this);
        m_tree->setColumnCount(2);
        QStringList labels;
        labels << "Column1" << "Column2";
        m_tree->setHeaderLabels(labels);
        QVBoxLayout * vLayout = new QVBoxLayout();
        vLayout->addWidget(m_tree);
        setLayout(vLayout);
      }
      
      void TestDialog::ShowModal()
      {
        QStringList labels;
        labels << "Column1" << "Column2";
        m_tree->addTopLevelItem(new QTreeWidgetItem(labels));
        m_tree->expandAll();
        exec();
      }
      
      void MainWindow::on_pushButton_clicked()
      {
        TestDialog dlg(this);
        dlg.ShowModal();
      } 

      Crash dump:

      2023-06-09 13:03:00.744 QtTest[95711:9112890] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array'
      *** First throw call stack:
      (
          0   CoreFoundation                      0x000000018729b154 __exceptionPreprocess + 176
          1   libobjc.A.dylib                     0x0000000186dba4d4 objc_exception_throw + 60
          2   CoreFoundation                      0x00000001873859b8 -[__NSCFString characterAtIndex:].cold.1 + 0
          3   CoreFoundation                      0x000000018720ebb8 -[__NSArrayM objectAtIndexedSubscript:] + 188
          4   libqcocoa.dylib                     0x00000001060f8124 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 269336
          5   libqcocoa.dylib                     0x00000001060f81a8 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 269468
          6   libqcocoa.dylib                     0x00000001060f677c _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 262768
          7   QtWidgets                           0x0000000105dc90b0 _ZN9QTreeView14currentChangedERK11QModelIndexS2_ + 452
          8   QtCore                              0x0000000106c49788 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3780
          9   QtCore                              0x0000000106e0e18c _ZN19QItemSelectionModel15setCurrentIndexERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 324
          10  QtWidgets                           0x0000000105d54980 _ZN17QAbstractItemView12focusInEventEP11QFocusEvent + 344
          11  QtWidgets                           0x0000000105b26688 _ZN7QWidget5eventEP6QEvent + 988
          12  QtWidgets                           0x0000000105baa060 _ZN6QFrame5eventEP6QEvent + 56
          13  QtWidgets                           0x0000000105d519d4 _ZN17QAbstractItemView5eventEP6QEvent + 484
          14  QtWidgets                           0x0000000105adcfec _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 272
          15  QtWidgets                           0x0000000105ade994 _ZN12QApplication6notifyEP7QObjectP6QEvent + 3396
          16  QtCore                              0x0000000106bfff88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
          17  QtWidgets                           0x0000000105adb26c _ZN19QApplicationPrivate14setFocusWidgetEP7QWidgetN2Qt11FocusReasonE + 396
          18  QtWidgets                           0x0000000105b221f8 _ZN7QWidget8setFocusEN2Qt11FocusReasonE + 580
          19  QtWidgets                           0x0000000105adc0c4 _ZN19QApplicationPrivate15setActiveWindowEP7QWidget + 1012
          20  QtWidgets                           0x0000000105adc4b8 _ZN19QApplicationPrivate24notifyActiveWindowChangeEP7QWindow + 52
          21  QtGui                               0x0000000104f90d80 _ZN22QGuiApplicationPrivate21processActivatedEventEPN29QWindowSystemInterfacePrivate20ActivatedWindowEventE + 612
          22  QtGui                               0x0000000104fe9b64 _ZN22QWindowSystemInterface17handleThemeChangeINS_20AsynchronousDeliveryEEEvP7QWindow + 3664
          23  QtCore                              0x0000000106c0b55c _ZN18QMetaMethodInvoker10invokeImplE11QMetaMethodPvN2Qt14ConnectionTypeExPKPKvPKPKcPKPKN9QtPrivate18QMetaTypeInterfaceE + 628
          24  QtCore                              0x0000000106c10110 _ZN11QMetaMethod10invokeImplES_PvN2Qt14ConnectionTypeExPKPKvPKPKcPKPKN9QtPrivate18QMetaTypeInterfaceE + 60
          25  libqcocoa.dylib                     0x00000001060c67b4 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 66216
          26  CoreFoundation                      0x000000018721716c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
          27  CoreFoundation                      0x00000001872b2eec ___CFXRegistrationPost_block_invoke + 88
          28  CoreFoundation                      0x00000001872b2e34 _CFXRegistrationPost + 440
          29  CoreFoundation                      0x00000001871e84cc _CFXNotificationPost + 704
          30  Foundation                          0x00000001881468f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
          31  AppKit                              0x000000018a596f1c -[NSWindow becomeKeyWindow] + 804
          32  AppKit                              0x000000018a53d578 -[NSWindow _changeKeyAndMainLimitedOK:] + 748
          33  AppKit                              0x000000018a53d24c -[NSWindow makeKeyWindow] + 172
          34  AppKit                              0x000000018a53d00c -[NSWindow _makeKeyRegardlessOfVisibility] + 56
          35  AppKit                              0x000000018a679700 -[NSApplication _orderFrontModalWindow:relativeToWindow:] + 400
          36  AppKit                              0x000000018a67939c -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:] + 1020
          37  libqcocoa.dylib                     0x000000010609aa48 qt_plugin_instance + 49884
          38  libqcocoa.dylib                     0x000000010609a510 qt_plugin_instance + 48548
          39  QtCore                              0x0000000106c098fc _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 532
          40  QtWidgets                           0x0000000105cf3ae8 _ZN7QDialog4execEv + 476
          41  QtTest                              0x0000000104ea7290 _ZN10TestDialog9ShowModalEv + 220
          42  QtTest                              0x0000000104ea7344 _ZN10MainWindow21on_pushButton_clickedEv + 40
          43  QtTest                              0x0000000104ea6204 _ZN10MainWindow18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv + 84
          44  QtTest                              0x0000000104ea63c0 _ZN10MainWindow11qt_metacallEN11QMetaObject4CallEiPPv + 148
          45  QtCore                              0x0000000106c494f4 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3120
          46  QtWidgets                           0x0000000105bd99e0 _ZNK15QAbstractButton11isCheckableEv + 816
          47  QtWidgets                           0x0000000105bd9860 _ZNK15QAbstractButton11isCheckableEv + 432
          48  QtWidgets                           0x0000000105bda764 _ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 172
          49  QtWidgets                           0x0000000105b26330 _ZN7QWidget5eventEP6QEvent + 132
          50  QtWidgets                           0x0000000105adcfec _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 272
          51  QtWidgets                           0x0000000105adf03c _ZN12QApplication6notifyEP7QObjectP6QEvent + 5100
          52  QtCore                              0x0000000106bfff88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
          53  QtWidgets                           0x0000000105add58c _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb + 808
          54  QtWidgets                           0x0000000105b3a9b0 _ZNK21QWidgetRepaintManager3rhiEv + 9912
          55  QtWidgets                           0x0000000105b39c68 _ZNK21QWidgetRepaintManager3rhiEv + 6512
          56  QtWidgets                           0x0000000105adcfec _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 272
          57  QtWidgets                           0x0000000105adde50 _ZN12QApplication6notifyEP7QObjectP6QEvent + 512
          58  QtCore                              0x0000000106bfff88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
          59  QtGui                               0x0000000104f8e794 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 1748
          60  QtGui                               0x0000000104fe5aa4 _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 396
          61  libqcocoa.dylib                     0x000000010609bd40 qt_plugin_instance + 54740
          62  CoreFoundation                      0x000000018722263c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
          63  CoreFoundation                      0x00000001872225d0 __CFRunLoopDoSource0 + 176
          64  CoreFoundation                      0x0000000187222340 __CFRunLoopDoSources0 + 244
          65  CoreFoundation                      0x0000000187220f48 __CFRunLoopRun + 828
          66  CoreFoundation                      0x00000001872204b8 CFRunLoopRunSpecific + 612
          67  HIToolbox                           0x0000000190a6ac40 RunCurrentEventLoopInMode + 292
          68  HIToolbox                           0x0000000190a6a8d0 ReceiveNextEventCommon + 220
          69  HIToolbox                           0x0000000190a6a7d4 _BlockUntilNextEventMatchingListInModeWithFilter + 76
          70  AppKit                              0x000000018a441d44 _DPSNextEvent + 636
          71  AppKit                              0x000000018a440ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
          72  AppKit                              0x000000018a435344 -[NSApplication run] + 464
          73  libqcocoa.dylib                     0x000000010609a644 qt_plugin_instance + 48856
          74  QtCore                              0x0000000106c098fc _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 532
          75  QtCore                              0x0000000106c00614 _ZN16QCoreApplication4execEv + 112
          76  QtTest                              0x0000000104ea6850 main + 84
          77  dyld                                0x0000000186debf28 start + 2236 

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              vng Viktor Govako
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: