ghostscript 9.05 fails with preview-latex and auctex

Bug #1028681 reported by Jarvis Schultz
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
auctex (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This is not the same as this bug: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/543266

The error in this bug is reported as:

    Error: /invalidfileaccess in --file--

It is the same as the bug mentioned here: http://email.esm.psu.edu/pipermail/macosx-emacs/2011-January/002566.html
and here: http://lists.gnu.org/archive/html/bug-auctex/2010-10/msg00016.html

I was able to fix this by downgrading to ghostscript 8.70. Note that 8.71 has a different bug in it that produces an error that says

    Error /undefined in copy_trailer_attrs

(as reported here: https://savannah.gnu.org/bugs/?29023)

To answer the required questions:

1) Description: Ubuntu 12.04 LTS
      Release: 12.04

2) ghostscript:
       Installed: 9.05~dfsg-0ubuntu4
       Candidate: 9.05~dfsg-0ubuntu4
       Version table:
     *** 9.05~dfsg-0ubuntu4 0
                 500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
                 100 /var/lib/dpkg/status

  auctex/ preview-latex:
      Installed: 11.86-2ubuntu1
      Candidate: 11.86-2ubuntu1
      Version table:
     *** 11.86-2ubuntu1 0
            500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
            100 /var/lib/dpkg/status

3) In emacs pressing 'C-c C-c C-p' inside of an equation environment should produce a preview of the equation. I

4) Instead a red circle/ error symbol is shown. Button-2 clicking the error yields the following error message

gs -dOutputFile\=\(_region_.prv/tmp30703Qa0/pr1-1.png\) -q -dSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r119.953x119.811
GS>{DELAYSAFER{.setsafe}if}stopped pop/.preview-BP currentpagedevice/BeginPage get dup null eq{pop{pop}bind}if def<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or{.preview-BP 0.246098 0.246098 0.246098 setrgbcolor clippath fill 0.859388 0.859388 0.796887 setrgbcolor}{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-do{[count 3 roll save]3 1 roll dup length 0 eq{pop}{setpagedevice}{ifelse .runandhide}stopped{handleerror quit}if aload pop restore}bind def [(_region_.prv/tmp30703Qa0/preview.ps)(r)file]aload exch dup 0 setfileposition 101518()/SubFileDecode filter cvx .runandhide aload pop dup dup 101518 setfileposition 577()/SubFileDecode filter cvx<<>>preview-do
Error: /invalidfileaccess in --file--
Operand stack:
   --nostringval-- (_region_.prv/tmp30703Qa0/preview.ps) (r)
Execution stack:
   %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
   --dict:1167/1684(ro)(G)-- --dict:0/20(G)-- --dict:79/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 533
GS<3>

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

"Error: /invalidfileaccess in --file--" means that Ghostscript is not able to read one of the input files or to write its output file. The file in question is probably _region_.prv/tmp30703Qa0/preview.ps as this file name is on the top of the Ghostscript stack. Moving to auctex ...

If you tghink it is really a Ghostscript bug, please try to reproduce it by a Ghostscript call from the command line and attch the needed files to this bug report. Then I will be able to forward it to the Ghostscript developers.

affects: ghostscript (Ubuntu) → auctex (Ubuntu)
Changed in auctex (Ubuntu):
status: New → Incomplete
Revision history for this message
Jarvis Schultz (jarvisschultz) wrote :

I believe that you are correct in thinking it is a problem in auctex. I was able to run all of the latex, dvips, and ghostscript calls that preview-latex is making individually with both versions of gs. Therefore the conclusion is indeed that there is a problem with the way that preview-latex is combining the individual calls. Sorry for posting in the wrong package!

Revision history for this message
Jarvis Schultz (jarvisschultz) wrote :

I am sure I am not the only one with this bug... I really don't want it to close. Can I provide any more helpful info?

Revision history for this message
era (era) wrote :

As far as I am able to understand, this no longer needs to be "Incomplete" as it was reassigned to the correct package now. Thus, changing bug status to New.

Changed in auctex (Ubuntu):
status: Incomplete → New
Revision history for this message
era (era) wrote :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608802 looks related, but I am hesitant to mark that as the proper upstream bug for this one. If the workarounds hinted at in the resolution work for you, please feel free to add this information by clicking on "Also affects Distribution", selecting Debian, and pasting the URL for this bug report as the upstream bug.

If that works, see also, for the record, LP bug#987711.

Revision history for this message
lorenzo (lorenzo-tamellini) wrote :

I am not sure whether this is the right place to post at this point, but I also experienced the same problem and I found a quick fix.

I am working on a fresh ubuntu 12.04 LTS installation, emacs 23.3.1, auctex 11.86 and ghostscript 9.05 (everything from ubuntu software center).

I fixed the problem by modifying the command issued by latex-preview. Go to

menu -> preview -> customize -> expand this menu

and then

menu -> preview -> customize -> preview Gs -> Preview Gs Options -> Show

and modify -dSAFER to -dNOSAFER

hope this helps
Lorenzo

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in auctex (Ubuntu):
status: New → Confirmed
Revision history for this message
Jarvis Schultz (jarvisschultz) wrote :

Removing ghostscript 8.70, and using 9.05~dfsg-0ubuntu4.2 from the 12.04 repositories, and then following the suggestion of @lorenzo worked for me.

Revision history for this message
Hairong Zhu (hrzhu) wrote :

lorenzo's solution works for me, thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.