bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37719: [gs-devel] Recent ghostscript broke preview-latex again


From: Ikumi Keita
Subject: bug#37719: [gs-devel] Recent ghostscript broke preview-latex again
Date: Tue, 15 Oct 2019 16:18:52 +0900

Hi Chris,

>>>>> Chris Liddell <address@hidden> writes:

> But, I'm going to make that warning honour the -dQUIET/-q parameter, so
> you won't have to worry about that. I'll push the commit tomorrow
> morning, and it'll be in the pending release.

Thanks, we appreciate your kindness.

>>> But there are some things that are confusing.
>> 
>>> First, on your command line, your output file is in parentheses, but the
>>> file name in the error message does not have parentheses.
>> 
>> I'm not sure what those parentheses are for.  Maybe those are "quotes"
>> for PS language and "consumed" by ghostscript?
>> 
>>> Secondly, the file name on your command line is
>>> "bbb.prv/tmp821SQO/pr1-2.png" but the one in the error is
>>> "bbb.prv/tmp821SQO/pr1-1.png". So, clearly not the same file.
>> 
>> Agreed.  In general, preview-latex needs multiple image files for
>> multiple math formulae in the latex document.  As far as I understand,
>> preview-latex invokes gs only once for those image files and gives input
>> to its prompt "GS>" to produce one image file, and waits the next prompt
>> to come up, and gives another input to it to produce another image
>> file,... and repeats similar cycle until all image files are generated.
>> 
>> So I think that the error message for "...pr1-1.png" was injected just
>> after preview-latex gave input for "..pr1-2.png", and those were
>> recorded in the emacs buffer for inter-process communication in that
>> order.

> OKay, that's not how I think I'd have done it, but it makes sense of
> what you're seeing.

I have to apologize for having failed to tell you correctly the
invocation string of ghostscript.  The debug facility of preview-latex
didn't record literally how it invoked gs and I didn't notice that.
Preview-latex actually called gs as

/home/keita/gs/bin/gs -dOutputFile\=\(bbb.prv/tmp0UabeI/pr1-\%d.png\) -q 
-dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 
-dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r108.606x108.587 -dDELAYBIND

.  The parameter for -dOutputFile contains "%d", not a constant number.

Triggered by this discovery, I managed to tame preview-latex to work
without /PermitFileWriting.  After reading portion of Use.html, I
understood the true origin of the error:
(1) OutputFile parameter is given with "-d" option rather than "-s".
    This is the reason why the output file name is surrounded by
    parentheses.
(2) Ghostscript>9.27 disables "%d" specification in OutputFile
    parameter if it is given with "-d" option.  I observe that gs 9.27
    finishes without any problems while gs>9.27 does not:
> gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
            -dTextAlphaBits=4 -dOutputFile='(sample-%00d.pgm)' sample.ps
GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
> ~/gs/bin/gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
            -dTextAlphaBits=4 -dOutputFile='(sample-%00d.pgm)' sample.ps
GPL Ghostscript GIT PRERELEASE 9.29 (2019-08-15)
Copyright (C) 2019 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GPL Ghostscript GIT PRERELEASE 9.29: **** Could not open the file 
'sample-1.pgm'.
Error: /invalidfileaccess in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   showpage   --nostringval--   2  
 %stopped_push   --nostringval--   showpage   showpage   false   1   %stopped_pu
sh   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   
%oparray_pop   1817   1   3   %oparray_pop   --nostringval--   %errorexec_pop   
.runexec2   --nostringval--   showpage   --nostringval--   2   %stopped_push   
--nostringval--   1824   0   4   %oparray_pop   showpage   showpage
Dictionary stack:
   --dict:727/1123(ro)(G)--   --dict:1/20(G)--   --dict:85/200(L)--   
--dict:179/300(L)--
Current allocation mode is local
Last OS error: Permission denied
Current file position is 119708
GPL Ghostscript GIT PRERELEASE 9.29: Unrecoverable error, exit code 1

    (These command line string are taken from an example in Use.html and
     I don't understand most of them.)

(3) The "%d" specification in OutputFile parameter is valid if given
    with "-s" option, even with gs>9.27:
> ~/gs/bin/gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
            -dTextAlphaBits=4 -sOutputFile='sample-%00d.pgm' sample.ps
GPL Ghostscript GIT PRERELEASE 9.29 (2019-08-15)
Copyright (C) 2019 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
(It finishes without any problems.)

(4) So I changed preview-latex to use "-s" option instead of "-d" for
    OutputFile parameter and to remove parentheses around the file name
    containing "%d".  With this change, I confirmed that
    /PermitFileWriting is no longer necessary.

Regards,
Ikumi Keita





reply via email to

[Prev in Thread] Current Thread [Next in Thread]