Bug 493523 - "Add/Subtract/Multiply/Divide Value" for matrix are completely unusable and will cause crash when "Preview" is enabled
Summary: "Add/Subtract/Multiply/Divide Value" for matrix are completely unusable and w...
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.11.1
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-23 06:23 UTC by Huanyu Liu
Modified: 2024-09-28 09:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.12
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Huanyu Liu 2024-09-23 06:23:16 UTC
SUMMARY
The "Add/Subtract/Multiply/Divide Value" functions for matrix are completely unusable. Attempting to use the functions will result in a "Wrong numeric value provided" error. Enabling the "Preview" feature will make LabPlot crash.

STEPS TO REPRODUCE
1. Launch LabPlot and create a new project
2. Add a matrix to the project (the default 10×10 zero matrix is OK)
3. Go to "Matrix → Manipulate Data → Add/Subtract/Multiply/Divide Value"
4a. Either click the "Add/Subtract/Multiply/Divide" button (the default value 0 is OK)
4b. Or enable the "Preview" checkbox for Add and Subtract

OBSERVED RESULT
4a: A "Wrong numeric value provided" error occurs
4b: LabPlot crashes

EXPECTED RESULT
No error or crash should happen

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Backtrace for the crash (some debuginfod symbol packs are not downloaded):
#0  AddSubtractValueDialog::initPreview (this=0x555556cf8d60) at /usr/src/debug/labplot/labplot-2.11.1/src/kdefrontend/spreadsheet/AddSubtractValueDialog.cpp:527
#1  0x0000555555944e58 in AddSubtractValueDialog::updatePreview (this=0x555556cf8d60) at /usr/src/debug/labplot/labplot-2.11.1/src/kdefrontend/spreadsheet/AddSubtractValueDialog.cpp:575
#2  0x0000555555933d2a in AddSubtractValueDialog::previewChanged (this=0x555556cf8d60, state=<optimized out>)
    at /usr/src/debug/labplot/labplot-2.11.1/src/kdefrontend/spreadsheet/AddSubtractValueDialog.cpp:446
#3  0x00007ffff4ce35de in ?? () from /usr/lib/libQt5Core.so.5
#4  0x00007ffff5a45545 in QAbstractButton::clicked(bool) () from /usr/lib/libQt5Widgets.so.5
#5  0x00007ffff5a47f33 in ?? () from /usr/lib/libQt5Widgets.so.5
#6  0x00007ffff5a494e1 in ?? () from /usr/lib/libQt5Widgets.so.5
#7  0x00007ffff5a496b2 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5Widgets.so.5
#8  0x00007ffff5990046 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#9  0x00007ffff5956581 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007ffff595c3e1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff4caeed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#12 0x00007ffff595a0f5 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff59a97ba in ?? () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff59ab817 in ?? () from /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff5956581 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff4caeed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#17 0x00007ffff513c260 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/libQt5Gui.so.5
#18 0x00007ffff511d2cd in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#19 0x00007ffff0f5f435 in ?? () from /usr/lib/libQt5WaylandClient.so.5
#20 0x00007ffff2a81559 in ?? () from /usr/lib/libglib-2.0.so.0
#21 0x00007ffff2ae4157 in ?? () from /usr/lib/libglib-2.0.so.0
#22 0x00007ffff2a80a55 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#23 0x00007ffff4cfe1af in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#24 0x00007ffff4ca6b9c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#25 0x00007ffff5b64fff in QDialog::exec() () from /usr/lib/libQt5Widgets.so.5
#26 0x00007ffff4ce35de in ?? () from /usr/lib/libQt5Core.so.5
#27 0x00007ffff5949305 in QAction::triggered(bool) () from /usr/lib/libQt5Widgets.so.5
#28 0x00007ffff594f030 in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt5Widgets.so.5
#29 0x00007ffff5ae168b in ?? () from /usr/lib/libQt5Widgets.so.5
#30 0x00007ffff5ae17b4 in ?? () from /usr/lib/libQt5Widgets.so.5
#31 0x00007ffff5990046 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#32 0x00007ffff5956581 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#33 0x00007ffff595c3e1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#34 0x00007ffff4caeed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#35 0x00007ffff595a0f5 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/libQt5Widgets.so.5
#36 0x00007ffff59aa055 in ?? () from /usr/lib/libQt5Widgets.so.5
#37 0x00007ffff59ab817 in ?? () from /usr/lib/libQt5Widgets.so.5
#38 0x00007ffff5956581 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#39 0x00007ffff4caeed8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#40 0x00007ffff513c260 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/libQt5Gui.so.5
#41 0x00007ffff511d2cd in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#42 0x00007ffff0f5f435 in ?? () from /usr/lib/libQt5WaylandClient.so.5
#43 0x00007ffff2a81559 in ?? () from /usr/lib/libglib-2.0.so.0
#44 0x00007ffff2ae4157 in ?? () from /usr/lib/libglib-2.0.so.0
#45 0x00007ffff2a80a55 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#46 0x00007ffff4cfe1af in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#47 0x00007ffff4ca6b9c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#48 0x00007ffff4cb309d in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#49 0x00005555556ac794 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/labplot/labplot-2.11.1/src/kdefrontend/LabPlot.cpp:243
Comment 1 reports_go_brrr 2024-09-23 19:14:10 UTC
Reproduced it.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 2 Alexander Semke 2024-09-28 09:32:15 UTC
Git commit 67391b1853a22454cb136e22b6617300613c4614 by Alexander Semke.
Committed on 28/09/2024 at 09:32.
Pushed by asemke into branch 'master'.

Adressed multiple issues in the "add/subtract values" dialog introduced
with the last new features in this area - baseline subtractions,
preview of the results and working with differences:

* hide the preview option for Matrix, not supported yet, needs to be done differently than for the Spreadsheet
* properly initialize the start and end values if add/subtract is done based on the difference of values
* properly add/subtract values instead of showing "wrong value provided"
FIXED-IN: 2.12

M  +1    -0    ChangeLog
M  +2    -2    src/commonfrontend/matrix/MatrixView.cpp
M  +88   -53   src/kdefrontend/spreadsheet/AddSubtractValueDialog.cpp
M  +2    -1    src/kdefrontend/spreadsheet/AddSubtractValueDialog.h

https://invent.kde.org/education/labplot/-/commit/67391b1853a22454cb136e22b6617300613c4614
Comment 3 Alexander Semke 2024-09-28 09:34:01 UTC
(In reply to Huanyu Liu from comment #0)
> SUMMARY
> The "Add/Subtract/Multiply/Divide Value" functions for matrix are completely
> unusable. Attempting to use the functions will result in a "Wrong numeric
> value provided" error. Enabling the "Preview" feature will make LabPlot
> crash.

Thank you for reporting these problems. We fixed it now, the fix will be available in the next release of LabPlot 2.12.