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

Mac OS App crashes on exit in QCompleter if close is triggered via taskbar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.9.0
    • Core: Item Models
    • None
    • macOS

    Description

      Whenever I close my application via CMD+Q (which calls QApplication::closeAllWindows()) the application shuts down as expected. But closing the application via the task bar (right mouse click and Close) the application crashes inside any QCompleter (I don't even construct the completers myself, they are installed by QComboBox itself).
      The crash happens here:

      void QCompletionModel::filter(const QStringList& parts)
      {
          Q_D(QCompletionModel);
          beginResetModel();
          engine->filter(parts);
          endResetModel();
          if (d->model->canFetchMore(engine->curParent))
              d->model->fetchMore(engine->curParent);
      }
      

      I could not construct a simple example, so there might be some other component required for the behaviour to occur. My application is fairly large, so a lot of code needs to be cleaned on shutdown.

      That's the call stack:
      1 QCompletionModel::filter(QList<QString> const&) qcompleter.cpp 391 0x1022ba825
      2 void doActivate<false>(QObject *, int, void * *) qobject.cpp 4150 0x1033d02b1
      3 QMetaObject::activate(QObject *, QMetaObject const *, int, void * *) qobject.cpp 4198 0x1033c69bb
      4 void QMetaObject::activate<void, QObject *>(QObject *, QMetaObject const *, int, void *, QObject * const&) qobjectdefs.h 306 0x1033c699d
      5 QObject::destroyed(QObject *) moc_qobject.cpp 186 0x1033c698d
      6 QObject::~QObject() qobject.cpp 1042 0x1033c698d
      7 QStandardItemModel::~QStandardItemModel() qstandarditemmodel.cpp 2242 0x1018d7eef
      8 QStandardItemModel::~QStandardItemModel() qstandarditemmodel.cpp 2236 0x1018d7e31
      9 QStandardItemModel::~QStandardItemModel() qstandarditemmodel.cpp 2236 0x1018d7e31
      10 QObjectPrivate::deleteChildren() qobject.cpp 2223 0x1033c7131
      11 QWidget::~QWidget() qwidget.cpp 1563 0x101ecbec9
      12 QComboBox::~QComboBox() qcombobox.cpp 1465 0x101fd49ee
      13 QComboBox::~QComboBox() qcombobox.cpp 1465 0x101fd49e9
      14 QWidgetAction::~QWidgetAction() qwidgetaction.cpp 93 0x101f884ef
      15 QWidgetAction::~QWidgetAction() qwidgetaction.cpp 85 0x101f8859e
      16 QWidgetAction::~QWidgetAction() qwidgetaction.cpp 85 0x101f88599
      17 QObjectPrivate::deleteChildren() qobject.cpp 2223 0x1033c7131
      18 QWidget::~QWidget() qwidget.cpp 1563 0x101ecbec9
      19 QToolBar::~QToolBar() qtoolbar.cpp 542 0x1020ceb5e
      20 QToolBar::~QToolBar() qtoolbar.cpp 541 0x1020ceb59
      21 QToolBar::~QToolBar() qtoolbar.cpp 541 0x1020ceb59
      22 QObjectPrivate::deleteChildren() qobject.cpp 2223 0x1033c7131
      23 QWidget::~QWidget() qwidget.cpp 1563 0x101ecbec9
      24 ToolMainWindow::~ToolMainWindow() toolmainwindow.h 10 0x100306935
      25 TextEdit::~TextEdit() textedit.cpp 139 0x1003d632c
      26 TextEdit::~TextEdit() textedit.cpp 135 0x1003d6355
      27 TextEdit::~TextEdit() textedit.cpp 135 0x1003d6399
      28 QObjectPrivate::deleteChildren() qobject.cpp 2223 0x1033c7131
      29 QWidget::~QWidget() qwidget.cpp 1563 0x101ecbec9
      30 DockWidgetEx::~DockWidgetEx() dockwidgetex.h 10 0x10041e5a5
      31 DockWidgetEx::~DockWidgetEx() dockwidgetex.h 10 0x10041e495
      32 DockWidgetEx::~DockWidgetEx() dockwidgetex.h 10 0x10041e4b9
      33 QObjectPrivate::deleteChildren() qobject.cpp 2223 0x1033c7131
      34 QWidget::~QWidget() qwidget.cpp 1563 0x101ecbec9
      35 MainWindow::~MainWindow() mainwindow.cpp 583 0x10032dc44
      36 MainWindow::~MainWindow() mainwindow.cpp 578 0x10032dc65
      37 MainWindow::~MainWindow() mainwindow.cpp 578 0x10032dca9
      38 QObject::event(QEvent *) qobject.cpp 1416 0x1033c80a8
      39 QWidget::event(QEvent *) qwidget.cpp 9413 0x101ee00f6
      40 QMainWindow::event(QEvent *) qmainwindow.cpp 1315 0x10203368c
      41 QApplicationPrivate::notify_helper(QObject *, QEvent *) qapplication.cpp 3301 0x101e850f4
      42 QApplication::notify(QObject *, QEvent *) qapplication.cpp 0x101e8608e
      43 QCoreApplication::notifyInternal2(QObject *, QEvent *) qcoreapplication.cpp 1106 0x10337bb83
      44 QCoreApplication::sendEvent(QObject *, QEvent *) qcoreapplication.cpp 1546 0x10337bb17
      45 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *) qcoreapplication.cpp 1879 0x10337c349
      46 QThreadPrivate::finish()::$_2::operator()() const qthread_unix.cpp 460 0x10352563f
      47 void (anonymous namespace)::terminate_on_exception<QThreadPrivate::finish()::$_2>(QThreadPrivate::finish()::$_2&&) qthread_unix.cpp 365 0x1035255dd
      48 QThreadPrivate::finish() qthread_unix.cpp 444 0x1035255dd
      49 destroy_current_thread_data(QThreadData *) qthread_unix.cpp 171 0x103526653
      50 (anonymous namespace)::QThreadDataDestroyer::EarlyMainThread::~EarlyMainThread() qthread_unix.cpp 230 0x103526637
      51 (anonymous namespace)::QThreadDataDestroyer::EarlyMainThread::~EarlyMainThread() qthread_unix.cpp 227 0x103526624
      52 __cxa_finalize_ranges (x86_64) /usr/lib/system/libsystem_c.dylib 0x7ff8091b8ea2
      53 exit (x86_64) /usr/lib/system/libsystem_c.dylib 0x7ff8091b8cbd
      54 -[NSApplication terminate:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cfe46a3
      55 -[NSApplication _terminateFromSender:askIfShouldTerminate:saveWindows:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80d1418c0
      56 -[NSApplication terminate:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cfe424d
      57 QCocoaIntegration::quit() const qcocoaintegration.mm 442 0x102a02815
      58 void doActivate<false>(QObject *, int, void * *) qobject.cpp 4150 0x1033d02b1
      59 QGuiApplication::lastWindowClosed() moc_qguiapplication.cpp 318 0x101575362
      60 QGuiApplicationPrivate::maybeLastWindowClosed() qguiapplication.cpp 3903 0x10157534f
      61 QWindow::event(QEvent *) qwindow.cpp 2709 0x1015cfbac
      62 QApplicationPrivate::notify_helper(QObject *, QEvent *) qapplication.cpp 3301 0x101e850f4
      63 QApplication::notify(QObject *, QEvent *) qapplication.cpp 0x101e8608e
      64 QCoreApplication::notifyInternal2(QObject *, QEvent *) qcoreapplication.cpp 1106 0x10337bc73
      65 QCoreApplication::sendSpontaneousEvent(QObject *, QEvent *) qcoreapplication.cpp 1560 0x10337bc07
      66 QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *) qguiapplication.cpp 2909 0x10156dfc2
      67 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *) qguiapplication.cpp 2257 0x10156dfba
      68 bool QWindowSystemHelper<QWindowSystemInterface::SynchronousDelivery>::handleEvent<QWindowSystemInterfacePrivate::CloseEvent, QWindow *>(QWindow *) qwindowsysteminterface.cpp 105 0x1015dd696
      69 QWindow::close() qwindow.cpp 2431 0x1015cee33
      70 QApplicationPrivate::tryCloseAllWidgetWindows(QList<QWindow *> *) qapplication.cpp 1606 0x101e82fef
      71 QApplication::closeAllWindows() qapplication.cpp 1635 0x101e833ac
      72 QApplication::event(QEvent *) qapplication.cpp 1681 0x101e83394
      73 QApplicationPrivate::notify_helper(QObject *, QEvent *) qapplication.cpp 3301 0x101e850f4
      74 QApplication::notify(QObject *, QEvent *) qapplication.cpp 0x101e8608e
      75 QCoreApplication::notifyInternal2(QObject *, QEvent *) qcoreapplication.cpp 1106 0x10337bc73
      76 QCoreApplication::sendSpontaneousEvent(QObject *, QEvent *) qcoreapplication.cpp 1560 0x10337bc07
      77 QGuiApplicationPrivate::processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *) qguiapplication.cpp 3961 0x10156d8b6
      78 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *) qguiapplication.cpp 2250 0x10156d880
      79 bool QWindowSystemHelper<QWindowSystemInterface::SynchronousDelivery>::handleEvent<QWindowSystemInterfacePrivate::WindowSystemEvent, QWindowSystemInterfacePrivate::EventType>(QWindowSystemInterfacePrivate::EventType) qwindowsysteminterface.cpp 105 0x1015d8d01
      80 bool handleWindowSystemEvent<QWindowSystemInterfacePrivate::WindowSystemEvent, QWindowSystemInterface::SynchronousDelivery, QWindowSystemInterfacePrivate::EventType>(QWindowSystemInterfacePrivate::EventType) qwindowsysteminterface.cpp 138 0x1015d8c86
      81 bool QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>() qwindowsysteminterface.cpp 281 0x1015d8c86
      82 -[QCocoaApplicationDelegate applicationShouldTerminate:] qcocoaapplicationdelegate.mm 103 0x1029e9b26
      83 -[NSApplication _docController:shouldTerminate:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cff46e0
      84 __91-[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:]_block_invoke (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cff44dd
      85 -[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cff3f83
      86 -[NSDocumentController(NSInternal) __closeAllDocumentsWithDelegate:shouldTerminateSelector:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cff3961
      87 -[NSApplication _shouldTerminate] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cff3411
      88 -[NSApplication(NSAppleEventHandling) _handleAEQuit] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80d141531
      89 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cd8edfe
      90 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] (x86_64) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 0x7ff80a41ec81
      91 _NSAppleEventManagerGenericHandler (x86_64) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 0x7ff80a41ea95
      92 ___lldb_unnamed_symbol873 (x86_64) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x7ff810ba7d8e
      93 ___lldb_unnamed_symbol872 (x86_64) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x7ff810ba75f1
      94 aeProcessAppleEvent (x86_64) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x7ff810ba0ee6
      95 AEProcessAppleEvent (x86_64) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 0x7ff814d5e095
      96 _DPSNextEvent (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cd8816a
      97 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80d815997
      98 -[NSApplication run] (x86_64) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x7ff80cd78f19
      99 QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) qcocoaeventdispatcher.mm 374 0x1029f80a9
      100 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) qeventloop.cpp 104 0x103385236
      101 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) qeventloop.cpp 186 0x103385218
      102 QCoreApplication::exec() qcoreapplication.cpp 1449 0x10337b8ad
      103 main main.cpp 214 0x1003100ee
      104 start (x86_64) /usr/lib/dyld 0x7ff808f4a530

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            frodo Jens
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes