lxqt / qterminal

A lightweight Qt-based terminal emulator
https://lxqt.github.io
GNU General Public License v2.0
586 stars 150 forks source link

Crash on entering `exit` with bookmark dock shown #1135

Closed tsujan closed 2 weeks ago

tsujan commented 1 month ago

When the bookmark dock is shown, if exit is entered inside a single-tabbed window of QTerminal, it crashes instead of exiting.

Steps to Reproduce (for bugs)
  1. Open QTerminal and show the bookmark dock.
  2. Enter exit in QTerminal.

Then, QTerminal crashes here, with this backtrace:

#0  0x00007f214493991c in QWidgetPrivate::deepestFocusProxy() const () at /usr/lib/libQt6Widgets.so.6
#1  0x00007f21449588a3 in ??? () at /usr/lib/libQt6Widgets.so.6
#2  0x00007f21437a17b7 in ??? () at /usr/lib/libQt6Core.so.6
#3  0x00007f2144a6b242 in QDockWidget::event(QEvent*) () at /usr/lib/libQt6Widgets.so.6
#4  0x00007f21448fc55c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#5  0x00007f2143744e08 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#6  0x00007f2144945951 in QWidgetPrivate::hideChildren(bool) () at /usr/lib/libQt6Widgets.so.6
#7  0x00007f2144945f02 in QWidgetPrivate::hide_helper() () at /usr/lib/libQt6Widgets.so.6
#8  0x00007f2144949a0a in QWidgetPrivate::setVisible(bool) () at /usr/lib/libQt6Widgets.so.6
#9  0x00007f214494678a in QWidgetPrivate::handleClose(QWidgetPrivate::CloseMode) () at /usr/lib/libQt6Widgets.so.6
#10 0x00007f2144963127 in ??? () at /usr/lib/libQt6Widgets.so.6
#11 0x00007f2143fdf300 in QWindow::event(QEvent*) () at /usr/lib/libQt6Gui.so.6
#12 0x00007f21448fc55c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#13 0x00007f2143744e08 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#14 0x00007f2143f74e94 in QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) ()
    at /usr/lib/libQt6Gui.so.6
#15 0x00007f2143fbc6bb in QPlatformWindow::close() () at /usr/lib/libQt6Gui.so.6
#16 0x00007f2143fd76c7 in QWindow::close() () at /usr/lib/libQt6Gui.so.6
#17 0x00007f21437a17b7 in ??? () at /usr/lib/libQt6Core.so.6
#18 0x00005581f22bb239 in ??? ()
#19 0x00005581f22bb2ff in ??? ()
#20 0x00007f21437a17b7 in ??? () at /usr/lib/libQt6Core.so.6
#21 0x00007f21437a17b7 in ??? () at /usr/lib/libQt6Core.so.6
#22 0x00007f21437a17b7 in ??? () at /usr/lib/libQt6Core.so.6
#23 0x00007f21437a1a0a in ??? () at /usr/lib/libQt6Core.so.6
#24 0x00007f2145179138 in ??? () at /usr/lib/libqtermwidget6.so.2
#25 0x00007f21437a1a0a in ??? () at /usr/lib/libQt6Core.so.6
#26 0x00007f214391e0a5 in ??? () at /usr/lib/libQt6Core.so.6
#27 0x00007f21437a1a0a in ??? () at /usr/lib/libQt6Core.so.6
#28 0x00007f21437aa910 in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt6Core.so.6
#29 0x00007f21448fc55c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt6Widgets.so.6
#30 0x00007f2143744e08 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt6Core.so.6
#31 0x00007f21439a4359 in ??? () at /usr/lib/libQt6Core.so.6
#32 0x00007f214310ea89 in ??? () at /usr/lib/libglib-2.0.so.0
#33 0x00007f21431709b7 in ??? () at /usr/lib/libglib-2.0.so.0
#34 0x00007f214310df95 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#35 0x00007f21439a28e2 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt6Core.so.6
#36 0x00007f214374f0de in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt6Core.so.6
#37 0x00007f214374942d in QCoreApplication::exec() () at /usr/lib/libQt6Core.so.6
#38 0x00005581f22a68b5 in ??? ()
#39 0x00007f2143c39c88 in ??? () at /usr/lib/libc.so.6
#40 0x00007f2143c39d4c in __libc_start_main () at /usr/lib/libc.so.6
#41 0x00005581f22a6fc5 in ??? ()
Possible Solution

A slot should be disconnected before closing the main window. I'll make a PR.

Context

I don't know if this happened before, but I can reproduce it consistently with the latest git QTerminal and Qt 6.7.1-4 from Arch under LabWC (didn't test under X11).

System Information