Bug 420720 - Crash when putting the cursor on a graph and pressing arrow up/down
Summary: Crash when putting the cursor on a graph and pressing arrow up/down
Status: CONFIRMED
Alias: None
Product: kmplot
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Christoph Feck
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 19:07 UTC by Laura David Hurka
Modified: 2020-04-29 08:30 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laura David Hurka 2020-04-28 19:07:05 UTC
SUMMARY
KmPlot crashes when the cursor is aligned to a graph and arrow up/down is pressed.

STEPS TO REPRODUCE
1. Plot a function f(x) = x
2. Click on the graph of that function, so the cursor is aligned
3. Press arrow up or arrow down

OBSERVED RESULT
Crash. Terminal output (german, not sure what it means, probably segfault):
Speicherzugriffsfehler (Speicherabzug geschrieben)

Reproducible everytime.

EXPECTED RESULT
Nothing. (Well, moving the viewport would be nice.)

Linux/KDE Plasma: some Xfce desktop system
KDE Frameworks Version: 5.69
Qt Version: 5.14.1
Comment 1 Christoph Feck 2020-04-28 19:34:26 UTC
Now you are really torturing that old program ;)

Backtrace:
#0  View::mouseMoveEvent (this=0x5555557becb0, e=0x0) at /usr/src/debug/kmplot-20.07.70git.20200327T031703~7ca0ae8-ku.3.2.x86_64/kmplot/view.cpp:3335
#1  0x00007ffff06a63df in View::keyPressEvent (e=<optimized out>, this=0x5555557becb0) at /usr/src/debug/kmplot-20.07.70git.20200327T031703~7ca0ae8-ku.3.2.x86_64/kmplot/view.cpp:3890
#2  View::keyPressEvent (this=0x5555557becb0, e=<optimized out>) at /usr/src/debug/kmplot-20.07.70git.20200327T031703~7ca0ae8-ku.3.2.x86_64/kmplot/view.cpp:3776
#3  0x00007ffff75daa85 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
Comment 2 Christoph Feck 2020-04-28 19:41:11 UTC
There is actually a disabled block of code to handle the Up/Down key. These were supposed to switch between graphs in trace mode, see https://cgit.kde.org/kmplot.git/tree/kmplot/view.cpp#n3796

I will commit a crash fix in a minute, but leave actually re-enabling that code for someone interested in investigating it.
Comment 3 Christoph Feck 2020-04-28 19:49:56 UTC
Git commit 44546b52d0ab7c7dde5bfb0acfeceb4c2e726bbe by Christoph Feck.
Committed on 28/04/2020 at 19:46.
Pushed by cfeck into branch 'release/20.04'.

Fix crash caused by disabled graph switching code in trace mode

M  +2    -0    kmplot/view.cpp

https://commits.kde.org/kmplot/44546b52d0ab7c7dde5bfb0acfeceb4c2e726bbe
Comment 4 Laura David Hurka 2020-04-29 08:30:14 UTC
(In reply to Christoph Feck from comment #1)
> Now you are really torturing that old program ;)

Yeah. It may be old, and GeoGebra will probably do the same and more, but KmPlot has a nice UI and a nice feature set. I understood it very quickly.

It is probably not possible to compete with GeoGebra’s feature set, so I would like to see just the UX of KmPlot improved.