Bug 455096 - Labplot2 crashes when trying to delete text element from xy-curve
Summary: Labplot2 crashes when trying to delete text element from xy-curve
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (show other bugs)
Version: 2.9.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-09 18:06 UTC by carl.benjamin.dreyer
Modified: 2022-07-10 08:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.10
Sentry Crash Report:


Attachments
data i used in application to make the plot (359 bytes, text/csv)
2022-06-09 18:06 UTC, carl.benjamin.dreyer
Details
The stacktrace (366.76 KB, text/plain)
2022-06-09 18:16 UTC, carl.benjamin.dreyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description carl.benjamin.dreyer 2022-06-09 18:06:03 UTC
Created attachment 149581 [details]
data i used in application to make the plot

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
The application crashes when i try to delete a text label on a xy-curve plot

STEPS TO REPRODUCE
1. open labplot2 version 2.9.0
2. import csv file containing data, to a new spreadsheet, see attachment for data i used
3. higlight all columns -> right click -> Plot data -> xy-curve -> plot
4. Click on "text" from panel bar -> press delete button to delete text label -> crash happens

OBSERVED RESULT
Application crashes

EXPECTED RESULT
Application would delete text label

SOFTWARE/OS VERSIONS

im using XFCE with Arch Linux 64bit

Linux/XFCE Plasma: XFCE DE 4.16
(available in About System)
XFCE Plasma Version: 4.16
KDE Frameworks Version: frameworkintegration 5.94.0-1 (kf5)
Qt Version: 5.15.4

ADDITIONAL INFORMATION
Comment 1 carl.benjamin.dreyer 2022-06-09 18:16:12 UTC
Created attachment 149582 [details]
The stacktrace

the stacktrace
Comment 2 Alexander Semke 2022-06-11 09:37:10 UTC
(In reply to carl.benjamin.dreyer from comment #0)
> STEPS TO REPRODUCE
> 1. open labplot2 version 2.9.0
> 2. import csv file containing data, to a new spreadsheet, see attachment for
> data i used
> 3. higlight all columns -> right click -> Plot data -> xy-curve -> plot
> 4. Click on "text" from panel bar -> press delete button to delete text
> label -> crash happens

Thanks for reporting this issue. We'll check it.

Just an additional comment in case you're interested or it's helping you to workaround this problem, if you are adding the text label via the toolbar it's added as a child of the worksheet and this is where we crash when you try to delete the label. If you add the label as a child of the plot via plot's context menu, and this is maybe what you also want to have at the end, there is no crash when you try to delete the text label.
Comment 3 Alexander Semke 2022-07-10 08:20:38 UTC
Git commit ccaf546ca8b20467f1df0184921ea21984a567a3 by Alexander Semke.
Committed on 10/07/2022 at 08:20.
Pushed by asemke into branch 'master'.

[worksheet] 	don't crash when deleting a text label that was added after worksheet objects (plots and curves) were created via the plot data dialog.

When a text label is added after new curves were created via PlotDataDialog,  
the undo or delete steps for this label lead to a crash in the handling of graphics effects in Qt. 
The root cause for the crash is not completely clear (maybe related ot labels child ScaledTextItem)
so we deactivate the fade-in effect completely for text labels.
FIXED-IN: 2.10

M  +1    -0    ChangeLog
M  +14   -5    src/commonfrontend/worksheet/WorksheetView.cpp

https://invent.kde.org/education/labplot/commit/ccaf546ca8b20467f1df0184921ea21984a567a3