bugGNU Octave - Bugs: bug #46910, Octave hangs on extremely slow...

 
 

bug #46910: Octave hangs on extremely slow ghostscript on Windows when printing figures with Qt 5

Submitter:  - <_102371>
Submitted:  Fri 15 Jan 2016 07:49:00 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Shri Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 09 Mar 2018 10:25:37 PM UTC, comment #14: 

Can anyone else verify that this is working properly now?

Can we close this report?

John W. Eaton <jwe>
Group administrator
Sat 28 Oct 2017 12:25:20 PM UTC, comment #13: 

I configured MXE-Octave with the following:

./configure --enable-devel-tools --enable-windows-64 --enable-octave=default --enable-binary-packages --with-ccache --disable-system-opengl --enable-qt5


With our own opengl32.dll file in the bin-folder, printing no longer hangs forever.

Markus Mützel <mmuetzel>
Group administrator
Sat 07 Oct 2017 05:12:23 PM UTC, comment #12: 

Dmitri, I tried the command you suggested and got the following results:

>> plot([0 1])

>> tic; print("t1.pdf", "-dpdflatexstandalone"); toc
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
Elapsed time is 2.4439 seconds.


Octave returns to the prompt in that case. However, the resulting pdf cannot be opened with Adobe Reader.
Please, find the resulting pdf and tex files attached.

(file #42080, file #42081)

Markus Mützel <mmuetzel>
Group administrator
Sat 07 Oct 2017 05:02:22 PM UTC, comment #11: 

May be Windows build is special, but I thought eps should
be written by gl2ps directly (no ghostscript involved).

Can you try
tic; print("t1.pdf", "-dpdflatexstandalone"); toc

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Sat 07 Oct 2017 03:04:25 PM UTC, comment #10: 

I can confirm that the figure can be plotted very fast on Windows 10 with Octave 4.2.1. I also cannot re-produce with Octave 4.3.0+ hg id "5570b0f12112" (qt4).
However, I am seeing the issue again on a more recent build with hg id "c2ef0eddf6bc" and 3 later builds that were build with qt5.

When issuing the print command, Octave stops responding and "gs.exe" uses one core indefinitely (25% CPU usage on a quad-core). After 20 minutes, it was still not finished. It also doesn't stop using the CPU when I kill Octave.

This can also be re-produced with:

plot ([0 1]);
print ("plot.eps")


Printing succeeds and is fast with "graphics_toolkit gnuplot".

I don't know whether this has something to do with the switch from qt4 to qt5 or with something else that has changed between these builds.

Marking as a regression on dev.

Markus Mützel <mmuetzel>
Group administrator
Tue 03 Jan 2017 10:26:12 PM UTC, comment #9: 

I have tested this on the new release 4.2.0. It has worked flawlessly and does not appear to crash or hang at all. This issue can be closed.

- <_102371>
Tue 28 Jun 2016 11:27:24 AM UTC, comment #8: 

Retagging from "crash" to "performance".

Lachlan Andrew <lachlan>
Fri 26 Feb 2016 11:24:17 PM UTC, comment #7: 

After further tinkering around (due to Mike's suggestion), I found that saving in vector file formats (eps, svg etc) is extremely fast and works, while saving as bitmap images (jpeg png etc) seems to hang Octave, at least for these cases.
As a temporary work around, I can suggest saving as vector files, like .svg and using pprograms such as inkscape to export it as an image. Its a lot of manual labour, but for some cases it might come in handy until the problem is solved.

- <_102371>
Fri 26 Feb 2016 06:51:57 PM UTC, comment #6: 

Ah yes, I see, my bad. It does not hang indeed. So maybe ghostscript is at fault here.

For the time being, I got around by using my University computers to access MATLAB, from which I could save the plots as images. It would be nice if someone can confirm this and get to the root of this problem.

- <_102371>
Fri 26 Feb 2016 06:33:40 PM UTC, comment #5: 

But it does not hang like it did when you tried to print to a png? So that is a meaningful result. It hints that the png conversion is what's taking a long time (which I also saw on Debian, although not a half hour).

Can someone on Windows test the script provided in this report and confirm a long delay with printing the log plot to a png?

If you're looking for solutions or workarounds to this in the meantime, you can obviously try reducing the number of points in your data sets before plotting.

Mike Miller <mtmiller>
Group Member
Fri 26 Feb 2016 06:26:27 PM UTC, comment #4: 

I changed it to the eps extension, but it does not produce any meaningful results. When I import to Word it does not display the plot. Tried displaying on LibreOffice Draw which displayed some comments (Creator, CreationDate, and Language level). I am not sure whats going on here.

Attached the screenshot in case you want to look at it.


- <_102371>
Fri 26 Feb 2016 05:49:44 PM UTC, comment #3: 

The script works for me on Debian. It does take an extremely long time to save to a png, mostly in the ghostscript external program which converts from an eps file to a png file. Can you try changing the output file extension to .eps and see if that avoids freezing?

Mike Miller <mtmiller>
Group Member
Fri 26 Feb 2016 05:21:18 PM UTC, comment #2: 

@Mike
Thanks for the response Mike!

The RC-3 version does not appear to have the issue fixed.
Tried waiting for about half hour each (which in my opinion is way too longer than necessary) and still does not work. Just hangs up.

Let me clarify this. The plots DO show up. I can see them and they seem fine. But the moment I try to SAVE them, by using the print() or saveas() command, they freeze up. I am not sure why.
What I meant was that using the same parameters (fs=3000, l=30003 etc) and the script, generating a simple waveform, for instance, a sinc wave (instead of using the data I have) appears to save without issues. But when I try doing with the data I collected, or for that matter using randn() to generate the data, the same issue arises.
The length of the data is 30003. Please take a look at the code I had attached earlier if you want to go through it.

- <_102371>
Sun 21 Feb 2016 08:29:41 PM UTC, comment #1: 

Thanks for the report. I'm sorry no one has responded to this yet. I am not a Windows user or developer, but there have been several similar issues with Octave plots freezing on Windows. You say simpler plots do not show this problem, can you narrow down what type of plot or the size of the plot that is needed to cause this error to happen for you?

Can you also try the 4.0.1-rc3 release candidate to see if the issue has already been resolved?

Can you try waiting longer to see if the saving is simply taking a long time?

Mike Miller <mtmiller>
Group Member
Fri 15 Jan 2016 07:49:00 PM UTC, original submission:  

Octave hangs and crashes when trying to save a particular plot that I needed. I can see the graph, but as soon as the saveas command is used, it hangs. The code is provided here and attached as well (along with the required data):

clear all;
close all;
clc;
pkg load optim;
path='PSD_Data_1\';
files=dir(sprintf('%s*.mat',path));
[r1,c1]=size(files);
fs=3000;
curveorder=1;
load(sprintf('%s%s',path,files(1).name));
l=length(data);
nfft=2^nextpow2(l);
f=0:fs/nfft:fs/2;
f2=f(2:end);
freqspec=abs(fft(data,nfft));
freqspec=freqspec(1:nfft/2+1);
powspec=1/(fs*nfft)*abs(freqspec).^2;
powspec(2:end-1)=2*powspec(2:end-1);
powspecdb=10*log10(powspec);
[alpha,c,rmsval]=expfit(curveorder,f(1),(fs/nfft),powspecdb);
curveval=(-exp(alpha*f))*c;
figure
semilogx(f,curveval);
hold on;
semilogx(f,powspecdb);
curvecoeff=polyfit(f',powspecdb,1);
curveval2=polyval(curvecoeff,f');
grid on;
hold off;
figure
semilogx(f,curveval2);
hold on
semilogx(f,powspecdb);
grid on;
hold off;
print(1,'PleaseDoNotCrash.png');

Additional Info: Octave 4.0.0, Windows 7 SP1 64 Bits.
N.B: Tried it with a few others, did not crash. Crashes with this particular code.

- <_102371>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42080:  t1-inc.pdf added by mmuetzel (2KiB - application/pdf)
file #42081:  t1.tex added by mmuetzel (2KiB - application/octet-stream)
file #36476:  1.png added by _102371 (22KiB - image/png)
file #36050:  testscr.m added by _102371 (804B - text/plain - The code and data used to reproduce the issue.)
file #36051:  PSD_Data_1.zip added by _102371 (27KiB - unknown/unknown - The code and data used to reproduce the issue.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by _102371 (Submitted the item)
  • -email is unavailable- added by _102371
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 17 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-14 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-10-17 mtmiller Severity3 - Normal 4 - Important
        SummaryOctave hangs on extremely slow ghostscript on Windows when printing figures Octave hangs on extremely slow ghostscript on Windows when printing figures with Qt 5
    2017-10-07 mmuetzel Attached File- Added t1-inc.pdf, #42080
        Attached File- Added t1.tex, #42081
    2017-10-07 mmuetzel Item GroupPerformance Regression
        StatusNeed Info Confirmed
        Release4.0.0 dev
    2016-06-28 lachlan Item GroupSegfault, Bus Error, etc. Performance
    2016-05-17 mtmiller SummaryOctave hangs and does not respond when trying to print plots Octave hangs on extremely slow ghostscript on Windows when printing figures
    2016-02-26 _102371 Attached File- Added 1.png, #36476
    2016-02-21 mtmiller CategoryPlotting Plotting with OpenGL
        StatusNone Need Info
    2016-01-15 _102371 Attached File- Added testscr.m, #36050
        Attached File- Added PSD_Data_1.zip, #36051
        Carbon-Copy- Added theillusiveman

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code