Re: Recent ghostscript broke preview-latex again

Ikumi Keita <[email protected]> Mon, 14 Oct 2019 20:40:53 +0900
Newsgroups gmane.comp.printing.ghostscript.devel
Message-ID <88635.1571053253@localhost>
Hi Chris,

>>>>> Chris Liddell <[email protected]> writes:
> Before you call .locksafe, adding something like:

> systemdict /.addcontrolpath known
> {
>   /PermitFileReading (bbb.pdf) .addcontrolpath
>   /PermitFileReading (bbb.prv/tmp0UabeI/preview.dsc) .addcontrolpath
> } if

Thank you, this improves the situation.  However, preview-latex still
does not work.  Ghostscript does not produce PNG files we expect and
sometimes raises errors.  I quote a sample error at the last of this
message.

I have an impression that gs fails to write out PNG files at specified
paths due to restricted permission about file operation.

Regards,
Ikumi Keita

/home/keita/gs/bin/gs -dOutputFile\=3D\(bbb.prv/tmp821SQO/pr1-2.png\) -q -=
dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=3D4 -dGraph=
icsAlphaBits\=3D4 -sDEVICE\=3Dpng16m -r108.606x108.587
GS>systemdict /.addcontrolpath known {
  /PermitFileReading (bbb.pdf) .addcontrolpath
  /PermitFileReading (bbb.prv/tmp821SQO/preview.dsc) .addcontrolpath
} if
{<</PermitFileReading[(bbb.pdf)(bbb.prv/tmp821SQO/preview.dsc)]>> setuserp=
arams .locksafe} stopped pop {DELAYSAFER{.setsafe}if}stopped pop/.preview-=
BP currentpagedevice/BeginPage get dup null eq{pop{pop}bind}if def<</Begin=
Page{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or{.pre=
view-BP gsave 1 1 0.878431 setrgbcolor clippath fill grestore }{pop}ifelse=
}bind/PageSize[1 1]>>setpagedevice/preview-do{/.preview-ST[count 4 roll sa=
ve]def dup length 0 eq{pop}{setpagedevice}{ifelse exec}stopped{handleerror=
 quit}if .preview-ST aload pop restore}bind def  (bbb.prv/tmp821SQO/previe=
w.dsc)(r)file /.preview-ST 1 index def dup 0 setfileposition 499()/SubFile=
Decode filter cvx exec .preview-ST dup dup 550 setfileposition 52()/SubFil=
eDecode filter cvx<<>>preview-do

 **** WARNING: .lockfileaccess or .setsafe called ****
 **** when file access controls are already active ****
GPL Ghostscript GIT PRERELEASE 9.29: **** Could not open the file 'bbb.prv=
/tmp821SQO/pr1-1.png'.
Error: /invalidfileaccess in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   showpage   --nostringval--=
   2   %stopped_push   --nostringval--   showpage   %loop_continue   showp=
age   showpage   false   1   %stopped_push   .runexec2   --nostringval--  =
 showpage   --nostringval--   2   %stopped_push   --nostringval--   showpa=
ge   false   1   %stopped_push   --nostringval--   showpage   4   1   3   =
showpage   %for_pos_int_continue   1965   1   7   %oparray_pop   showpage =
  showpage   1824   0   9   %oparray_pop   showpage   showpage
Dictionary stack:
   --dict:731/1123(ro)(G)--   --dict:1/20(G)--   --dict:84/200(L)--   --di=
ct:84/200(L)--   --dict:135/256(ro)(G)--   --dict:315/325(ro)(G)--   --dic=
t:33/64(L)--   --dict:6/9(L)--   --dict:6/20(L)--
Current allocation mode is local
Last OS error: Permission denied