bugGNU Octave - Bugs: bug #39131, print -dFORMAT without an output...

 
 

bug #39131: print -dFORMAT without an output file crashes or confuses Octave

Submitter:  Mike Miller <mtmiller>
Submitted:  Fri 31 May 2013 10:28:41 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Duplicate Assigned to:  bpabbott
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 05 Sep 2013 11:48:38 PM UTC, comment #4: 
Ben Abbott <bpabbott>
Group Member
Tue 03 Sep 2013 01:30:10 AM UTC, comment #3: 

I haven't confirmed, but the problem looks to be that the "-sOutputFile=-" isn't included in the ghostscript options.

http://www.ghostscript.com/doc/current/Use.htm#Pipes

For Unix or Windows the proper pipeline would be,


gnuplot-pipeline: '/opt/local/bin/gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite -dLanguageLevel=1 -dEmbedAllFonts=true -dEPSCrop -sPAPERSIZE=letter -dFIXEDMEDIA -sOutputFile=- /var/tmp/oct-YP9zhA.ps /var/tmp/oct-noAx1s.eps | /usr/bin/lpr -l ; rm /var/tmp/oct-noAx1s.eps ; rm /var/tmp/oct-YP9zhA.ps'


Ben Abbott <bpabbott>
Group Member
Sat 31 Aug 2013 08:45:49 PM UTC, comment #2: 

Just for reference, in the absence of a file name the result should be spooled to the system printer via lpr

Ben Abbott <bpabbott>
Group Member
Fri 31 May 2013 10:40:25 PM UTC, comment #1: 

Oops, just found this has been reported and commented on already as #38166. I have provided extra detail here that wasn't in that report.

Mike Miller <mtmiller>
Group Member
Fri 31 May 2013 10:28:41 PM UTC, original submission:  

Originally reported at http://bugs.debian.org/710423

The print command fails to print to a printer when no filename is specified if various -d options are passed to print. At the very least print should either error on an invalid combination or just ignore and print as if no -d option had been given. I can't say what Matlab does.

Example 1, "print -deps" with gnuplot:


plot (1:10, 1:10);
print -deps
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted


Example 2, "print -dpng" with gnuplot:


plot (1:10, 1:10);
print -dpng
GPL Ghostscript 9.05: **** Could not open the file  .
GPL Ghostscript 9.05: Unrecoverable error, exit code 1


... and the following is actually sent to the printer and printed as plain text:


Error: /invalidfileaccess in --showpage--
                                         Operand stack:
                                                          1   true
                                                                  Executation stac


Example 3, "print -deps" with fltk:


plot (1:10, 1:10);
print -deps


No error, but the contents of the EPS are dumped as text to the same terminal that Octave is running in.

Example 4, "print -dpng" with fltk:


plot (1:10, 1:10);
print -dpng


Also no error message, but what appears to be the byte content of a PNG is sent as text to the printer and printed, one or two lines of nonsense per page.

I started looking at what _print_parse_opts_ does with these various combinations of options. I assume this can be fixed in there with some logic about whether the output filename was specified or not.

Mike Miller <mtmiller>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by mtmiller (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
    2013-09-05 bpabbott Open/ClosedOpen Closed
    2013-09-05 bpabbott Assigned toNone bpabbott
    2013-05-31 mtmiller StatusNone Duplicate
        Dependencies- Depends on bugs #38166

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code