Crash when undocking/docking sub-windows
Requirements
-
I searched through the issues if the issue already exists
Steps to reproduce
- Undo a panel with a spreadsheet, move it to an external window
- Re-dock it again, for example above the project explorer
- Try to move the spreadsheet to a different position
Expected
Everything is ok after undocking/re-docking.
Observed
In the second step above the spreadsheet is not visible anymore, the dock looks broken:
When trying to move this broken spreadsheet, the application crashes with
#0 0x00007ffff2b7873a in QObject::setProperty(char const*, QVariant const&) () from /usr/lib64/libQt5Core.so.5
#1 0x00007ffff6dda6bc in ads::updateDockWidgetFocusStyle(ads::CDockWidget*, bool) () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#2 0x00007ffff6ddb08d in ads::DockFocusControllerPrivate::updateDockWidgetFocus(ads::CDockWidget*) () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#3 0x00007ffff6dd8eb2 in ads::CDockWidgetTab::mousePressEvent(QMouseEvent*) () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#4 0x00007ffff371ebaf in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#5 0x00007ffff37c584e in QFrame::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#6 0x00007ffff36dd87c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#7 0x00007ffff36e4bb7 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#8 0x00007ffff2b3cdf3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#9 0x00007ffff36e3bbf in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007ffff37388da in ?? () from /usr/lib64/libQt5Widgets.so.5
#11 0x00007ffff373ba4d in ?? () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007ffff36dd87c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007ffff36e463f in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007ffff2b3cdf3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#15 0x00007ffff2f8783b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib64/libQt5Gui.so.5
#16 0x00007ffff2f88ae5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib64/libQt5Gui.so.5
#17 0x00007ffff2f5f12b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5
#18 0x00007fffeccebe2a in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#19 0x00007ffff0b2082b in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff0b20bd0 in ?? () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ffff0b20c5c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#22 0x00007ffff2b9f21c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#23 0x00007ffff2b3b65a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#24 0x00007ffff2b44e97 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#25 0x00000000006114c7 in main (argc=<optimized out>, argv=<optimized out>) at /home/alex/Projekte/labplot/src/kdefrontend/LabPlot.cpp:240
The root cause seems to be the deletion of the view in the destructor of ContentDockWidget which is called for some reasons (why?) when moving the floating dock back into the main window:
#0 SpreadsheetView::~SpreadsheetView (this=0x618000021080, __in_chrg=<optimized out>) at /home/alex/Projekte/labplot/src/commonfrontend/spreadsheet/SpreadsheetView.cpp:142
#1 0x00007ffff2b6d3bb in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#2 0x00007ffff3719b66 in QWidget::~QWidget() () from /usr/lib64/libQt5Widgets.so.5
#3 0x00007ffff3719d59 in QWidget::~QWidget() () from /usr/lib64/libQt5Widgets.so.5
#4 0x00007ffff2b6d3bb in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#5 0x00007ffff3719b66 in QWidget::~QWidget() () from /usr/lib64/libQt5Widgets.so.5
#6 0x00007ffff3875119 in QScrollArea::~QScrollArea() () from /usr/lib64/libQt5Widgets.so.5
#7 0x00007ffff2b6d3bb in QObjectPrivate::deleteChildren() () from /usr/lib64/libQt5Core.so.5
#8 0x00007ffff3719b66 in QWidget::~QWidget() () from /usr/lib64/libQt5Widgets.so.5
#9 0x000000000096db1d in ContentDockWidget::~ContentDockWidget (this=0x607000171ce0, __in_chrg=<optimized out>) at /home/alex/Projekte/labplot/src/commonfrontend/core/ContentDockWidget.cpp:49
#10 ContentDockWidget::~ContentDockWidget (this=0x607000171ce0, __in_chrg=<optimized out>) at /home/alex/Projekte/labplot/src/commonfrontend/core/ContentDockWidget.cpp:49
#11 0x00007ffff6dde450 in ads::CFloatingDockContainer::~CFloatingDockContainer() () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#12 0x00007ffff6dde7c1 in ads::CFloatingDockContainer::~CFloatingDockContainer() () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#13 0x00007ffff2b70cd5 in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#14 0x00007ffff371e31b in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007ffff37fea63 in QDockWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#16 0x00007ffff6ddf672 in ads::CFloatingDockContainer::event(QEvent*) () from /usr/lib64/libqt5advanceddocking.so.2.10.1
#17 0x00007ffff36dd87c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#18 0x00007ffff36e463f in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#19 0x00007ffff2b3cdf3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#20 0x00007ffff2b3f811 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
Labplot Version
Debug build 2.10.0-2091-gaf4461323
Feb 23 2024, 09:59:36
System: openSUSE Leap 15.5
Locale: English,United States (Decimal point '.', Group separator ','
Number settings: Decimal point '.', Group separator ',', Exponential 'e', Zero digit '0', Percent '%', Positive/Negative sign '+'/'-' (Updated on restart)
Architecture: x86_64-little_endian-lp64
Kernel: linux 5.14.21-150500.55.49-default
C++ Compiler: GNU 12.3.0
C++ Compiler Flags: -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -Wextra -Wundef -Wpointer-arith -Wunreachable-code -Wunused -Wdeprecated-declarations -fno-omit-frame-pointer -fstack-protector -fexceptions -std=c++17 -O2 -Wcast-align -Wswitch-enum -fvisibility=default -pedantic -Wzero-as-null-pointer-constant
Edited by Alexander Semke