bugGNU Octave - Bugs: bug #51772, Errors when running...

 
 

bug #51772: Errors when running compare_plot_demos with gnuplot toolkit on Windows

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Thu 17 Aug 2017 04:08:47 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Need Info Assigned to:  None
Originator Name:  Avinoam 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

Sun 10 Mar 2019 06:53:03 PM UTC, comment #8: 

No response, asumming this has been fixed in the latest release.  Closing report.

Rik <rik5>
Group administrator
Sun 03 Mar 2019 05:49:50 AM UTC, comment #7: 

The last comment on this bug report was from August, 2017.  Is this still a problem with the new 5.1.0 release?

Rik <rik5>
Group administrator
Sat 19 Aug 2017 09:06:40 PM UTC, comment #6: 

Yes, you are describing well the problem. Just a small correction: Octave does not hang. The next print command fails with the error message:


The process cannot access the file because it is being used by another


More interesting, I can't reproduce this problem on another Windows machine I have.

maybe more people can check if they can confirm this problem.

I am changing the status to "Need Info"

Avinoam Kalma <avinoam>
Group Member
Sat 19 Aug 2017 06:47:58 PM UTC, comment #5: 

OK, so I understand a little more now.  There an error message from gnuplot (line 0: warning:...) and an error message from ghostscript (GPL Ghostscript 9.16:...) which is expecting to find the file created by gnuplot but is missing because of the "plot area too small" issue.  There is that.

Then there is a more pressing issue that the ghostscript failure to find a file is causing Octave to hang on your system.  If Octave wouldn't hang, and instead just recognize a demo/test failure, it would be consistent with old behavior.  (I still don't see how ghostscript is launched with the demo('axis') command.)

Could you recreate the bigger issue with a more simple command?  For example, try something like

system('gv nonexistantfile.png');

Again, I'm not 100% sure I understand exactly what the manifestation is.  I can reproduce the gnuplot error by adding a third line to the title in the axis.m file, but nothing hangs here.

Dan Sebald <sebald>
Fri 18 Aug 2017 05:01:43 AM UTC, comment #4: 

The problem here is not this particular example,
but when there is a gnuplot error, it causes the next print to fail with the error


The process cannot access the file because it is being used by another


This is a regression bug, because in 4.2.1, the same example cause a gnuplot error, but without affecting the next print.


Avinoam Kalma <avinoam>
Group Member
Thu 17 Aug 2017 06:24:48 PM UTC, comment #3: 

The line of script that generates the origin/size in _gnuplot_draw_axes_.m is the following:


  pos = __actual_axis_position__ (h);
[snip]
  else ## activepositionproperty == outerposition
    fprintf (plot_stream, "unset tmargin;\n");
    fprintf (plot_stream, "unset bmargin;\n");
    fprintf (plot_stream, "unset lmargin;\n");
    fprintf (plot_stream, "unset rmargin;\n");
    fprintf (plot_stream, "set origin %g, %g;\n", pos(1:2));
    if (strcmp (axis_obj.dataaspectratiomode, "manual"))
      sz_str = sprintf ("ratio %g", -dr);
    else
      sz_str = "noratio";
    endif
    sz_str = sprintf ("set size %s %g, %g;\n", sz_str, pos(3:4));


My recollection is that the _actual_axis_position_ (h) was a bit tricky and did not always produce good results.  When I find time, I will look into this more closely.  I searched past email for reference though and found these:

https://savannah.gnu.org/bugs/?48427#comment13

https://savannah.gnu.org/bugs/?47974#comment21
https://savannah.gnu.org/bugs/?47974#comment23
https://savannah.gnu.org/bugs/?47974#comment27
https://savannah.gnu.org/bugs/?47974#comment52
https://savannah.gnu.org/bugs/?47974#comment55

Dan Sebald <sebald>
Thu 17 Aug 2017 05:04:59 PM UTC, comment #2: 

The error messages are coming from gnuplot, not Octave.

Demos 5 and 6 work on my linux system, but it's clear what the problem is.  It looks like your example is failing with the interactive terminal plot (prior to attempting a PNG file).  Attached is the screenshot of my interactive terminal.  Notice how small the plot region is because of how large of space is left in the margins.  The resulting PNG looks similar.

I would guess on your system the margins are so big, relatively speaking, that there is few if any pixels left for the actual plot.  gnuplot then gives the error message you see and must get in a bad state as far as some intermediate data file.  The fact that gnuplot can't do follow-up plots after that condition may be a gnuplot bug which I will investigate.

The main issue with Octave, though, is that the demo 5 is using space much too big in the margins.  I'm also attaching the gnuplot commands that Octave generates, i.e.,


drawnow ("qt", "/dev/null", "a5_demo.gp");


and the size of the plot is set within with


unset tmargin;
unset bmargin;
unset lmargin;
unset rmargin;
set origin 0, 0.3667;
set size ratio -1 1, 0.2666;


So the Octave scripts for the gnuplot toolkit are choosing far too big margins for some reason.


Dan Sebald <sebald>
Thu 17 Aug 2017 06:39:02 AM UTC, comment #1: 

A simple example:


graphics_toolkit gnuplot
demo ("axis", 5);
print ("-dpng", "a5.png");
demo ("axis", 6);
print ("-dpng", "a6.png");


The result on Win-7 machine with dev version is:


>> bug_71772
axis example 5:
 clf;
 x = 0:0.1:10;
 plot (x, sin(x));
 axis image;
 title ({"image", 'equivalent to "tight" & "equal"'});

         line 0: warning: Terminal canvas area too small to hold plot.
            Check plot boundary and font sizes.
axis example 6:
 clf;
 colormap ("default");
 [x,y,z] = peaks (50);
 x1 = max (x(:));
 pcolor (x-x1, y-x1/2, z);
 hold on;
 [x,y,z] = sombrero ();
 s = x1 / max (x(:));
 pcolor (s*x+x1, s*y+x1/2, 5*z);
 axis tight;

The process cannot access the file because it is being used by another process.


This happens in dev version, but not in 4.2.1, so it is marked as regression

Avinoam Kalma <avinoam>
Group Member
Thu 17 Aug 2017 04:08:47 AM UTC, original submission:  


When running compare_plot_demos from m/testfun/private
I get on some of the files, when using gnuplot toolkit, the error message


GPL Ghostscript 9.16: Unrecoverable error, exit code 1
The process cannot access the file because it is being used by another process.


In this case the png file is not create, but err file is not created either.
 


Avinoam Kalma <avinoam>
Group Member

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (Updated the item)
  • -email is unavailable- added by avinoam (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-10 rik5 StatusNone Need Info
        Open/ClosedOpen Closed
    2017-08-17 sebald Attached File- Added axis_demo5_Screenshot_from_2017-08-17_11:49:18.png, #41556
    2017-08-17 avinoam Item GroupUnexpected Error or Warning Regression

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code