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

Submitted by:  Shri <theillusiveman>
Submitted on:  Fri 15 Jan 2016 07:49:00 PM UTC  
 
Category: Plotting with OpenGLSeverity: 4 - Important
Priority: 5 - NormalItem Group: Regression
Status: ConfirmedAssigned to: None
Originator Name: ShriOpen/Closed: Open
Release: devOperating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 28 Oct 2017 12:25:20 PM UTC, comment #13:

I configured MXE-Octave with the following:

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

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

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

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>
Project Member
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:

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>
Project Member
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.

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

Retagging from "crash" to "performance".

Lachlan Andrew <lachlan>
Project Member
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.

Shri <theillusiveman>
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.

Shri <theillusiveman>
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>
Project Administrator
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.

(file #36476)

Shri <theillusiveman>
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>
Project Administrator
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.

Shri <theillusiveman>
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>
Project Administrator
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/(fsnfft)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(alphaf))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.

Shri <theillusiveman>

 

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

Attach File(s):
   
   
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 theillusiveman (22KiB - image/png)
file #36050:  testscr.m added by theillusiveman (804B - text/plain - The code and data used to reproduce the issue.)
file #36051:  PSD_Data_1.zip added by theillusiveman (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
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by mmuetzel (Posted a comment)
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by theillusiveman (Submitted the item)
  • -unavailable- added by theillusiveman
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 15 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 17 Oct 2017 06:09:15 PM UTCmtmillerSeverity3 - 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
    Sat 07 Oct 2017 05:12:23 PM UTCmmuetzelAttached File-=>Added t1-inc.pdf, #42080
      Attached File-=>Added t1.tex, #42081
    Sat 07 Oct 2017 03:04:25 PM UTCmmuetzelItem GroupPerformance=>Regression
      StatusNeed Info=>Confirmed
      Release4.0.0=>dev
    Tue 28 Jun 2016 11:27:24 AM UTClachlanItem GroupSegfault, Bus Error, etc.=>Performance
    Tue 17 May 2016 04:43:42 PM UTCmtmillerSummaryOctave hangs and does not respond when trying to print plots=>Octave hangs on extremely slow ghostscript on Windows when printing figures
    Fri 26 Feb 2016 06:26:27 PM UTCtheillusivemanAttached File-=>Added 1.png, #36476
    Sun 21 Feb 2016 08:29:41 PM UTCmtmillerCategoryPlotting=>Plotting with OpenGL
      StatusNone=>Need Info
    Fri 15 Jan 2016 07:49:00 PM UTCtheillusivemanAttached 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.1-cleanup1