Bug 434271

Summary: Plotting doesn't work with octave 6.2
Product: [Applications] cantor Reporter: Egor Ignatov <egori>
Component: octave-backendAssignee: Cantor Bugs <cantor-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.semke, egori, warquark
Priority: NOR    
Version First Reported In: 20.12.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 22.03
Sentry Crash Report:
Attachments: Execution log
Octave 6.2 plot example
Cantor segfault backtrace

Description Egor Ignatov 2021-03-11 07:59:25 UTC
Created attachment 136578 [details]
Execution log

SUMMARY
After updating octave to version 6.2.0, the plot function hangs when evaluating the worksheet.

STEPS TO REPRODUCE
1. Install octave version 6.2.0
2. Open cantor with octave backend
3. Write 'plot(1:1)'
4. Click 'Evaluate Worksheet'

OBSERVED RESULT
Plotting hangs

EXPECTED RESULT
The plot result appears.

SOFTWARE/OS VERSIONS
Linux: Alt Linux Sisyphus
KDE Plasma Version: 20.12.3
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
--
Linux: Arch Linux
KDE Plasma Version: 20.12.3
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
I use gnuplot graphics toolkit.

See also: https://bugs.kde.org/show_bug.cgi?id=433982
Comment 1 Nikita Sirgienko 2021-03-11 17:15:21 UTC
Created attachment 136592 [details]
Octave 6.2 plot example

I can't reproduce this problem.
Comment 2 Nikita Sirgienko 2021-03-11 17:23:21 UTC
How you get Octave 6.2? Is it from apt packages, builded manually or it from some container package system like snap?
Because if you get octave 6.2 from snap/flatpack or any other container technology, when you should add some additional parameters to container, otherwise the octave will be too isolated and cantor won't able to got any images for plot due filesystem isolation.
You can check this bugreport to know more about problems (and how to fix them) between Cantor and Octave from container (from Flatpack in this report): https://bugs.kde.org/show_bug.cgi?id=420959
Comment 3 Egor Ignatov 2021-03-12 08:30:57 UTC
I have this problem on both of my VMs: 
- Alt Linux
Got octave from an rpm package
(http://geyser.altlinux.org/ru/sisyphus/srpms/octave)

- Latest Arch Linux
Got octave from the official repository
(https://archlinux.org/packages/community/x86_64/octave/)

What OS are you using?
Comment 4 Nikita Sirgienko 2021-03-17 19:43:16 UTC
I have used Ubuntu 20.04.2 LTS.
Can you please verify, that the plots works in Octave 6.2 itself, for example in octave-cli?
Comment 5 Egor Ignatov 2021-03-18 08:36:16 UTC
Yes, octave-cli 6.2 itself works on both of the systems above.

I tried to change octave executable from 'octave-cli' to just 'octave'
in cantor and it fixed plotting on arch linux.

But in Alt linux gnuplot and qt toolkits started to randomly crash on every
other plot (so plot works sometimes).

But in Alt linux, the gnuplot and qt toolkits started randomly crashing on
every other plot (plot sometimes works).

Is there a reason octave-cli used by default instead of octave?
Comment 6 Egor Ignatov 2021-03-18 08:37:48 UTC
Created attachment 136808 [details]
Cantor segfault backtrace

Cantor crashes with "(libspectre) ghostscript reports: syntaxerror -18"
Comment 7 Egor Ignatov 2021-03-22 13:42:45 UTC
Additionally segfault occurs only when using png internal plot format.
Comment 8 Alexander Semke 2022-01-09 15:58:40 UTC
Git commit cacd670b504b77aeaab0f02eef8630ca84b3e50f by Alexander Semke.
Committed on 09/01/2022 at 15:58.
Pushed by asemke into branch 'master'.

[octave] changed the default octave executable from 'octave-cli' to 'octave' which seems to be the only working interface in >6.0 and set the recommended version to 6.2.
FIXED-IN: 22.03

M  +1    -1    src/backends/octave/octavebackend.cpp
M  +2    -2    src/backends/octave/octavebackend.kcfg.in

https://invent.kde.org/education/cantor/commit/cacd670b504b77aeaab0f02eef8630ca84b3e50f
Comment 9 Alexander Semke 2022-01-09 16:42:39 UTC
(In reply to Egor Ignatov from comment #7)
> Additionally segfault occurs only when using png internal plot format.

I confirm it's working with 'octave' I switched the default setting to 'octave' instead of 'octave-cli' now. Also, because of the multiple and different issues we have with EPS I removed this output, also for octave, and switched to PNG on default. Please check. If you have some issues with the PNG format, please report them in a separate ticket and I'll check. Thanks.