Discussion:
Invasive changes in preview-latex
David Kastrup
2005-02-25 17:35:04 UTC
Permalink
Hi folks,

sorry to be redirecting this to the AUCTeX list, but I need the
exposure, and I don't think any active members of the
preview-latex-devel list are not also reading AUCTeX, and besides, I
am sick of moderating every single post through the broken web
interface of the p-l list. And p-l is scheduled for inclusion into
AUCTeX soon, anyway.

In order to get rid of all the security bunk from switching between
safe and unsafe mode, I have reorganized the GhostScript calls, and
now file names of the generated previews are completely different, and
lots of code has changed. So please test-drive this change (no, the
installation changes are not yet finished and checked in, I still have
to do this). I need to know when temporary files don't get removed
and similar things.

Particularly important are race conditions: files that get deleted (or
that have their deletion silently ignored) while they are still being
accessed (Windows is notorious for that), files that are removed too
early, that kind of thing. I want to have a reasonable coverage of
GhostScript versions, and of operating systems (meaning the Windows
guys in particular). Whether I'll get it is a different question, but
_please_, I need to showcase this in a week.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Frank Küster
2005-02-25 18:41:38 UTC
Permalink
Post by David Kastrup
In order to get rid of all the security bunk from switching between
safe and unsafe mode, I have reorganized the GhostScript calls, and
now file names of the generated previews are completely different, and
lots of code has changed. So please test-drive this change (no, the
installation changes are not yet finished and checked in, I still have
to do this). I need to know when temporary files don't get removed
and similar things.
The bug I reported to preview-latex this week is still there. The gs
trace is now, with gs-afpl:

gs -q -dSAFER -dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r123.035x122.862
GS>/.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 gsave 0.705882 0.933333 0.705882 setrgbcolor false setstrokeadjust 3 setlinewidth clippath strokepath matrix setmatrix true {2 index{newpath}if round exch round exch moveto pop false}{round exch round exch lineto}{curveto}{closepath}pathforall pop fill grestore }{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-do{[count 3 roll save]3 1 roll{setpagedevice}stopped{handleerror quit}if cvx systemdict/.runandhide known{.setsafe(AFPL Ghostscript)product ne{<<>>setpagedevice}if{.runandhide}}if stopped{handleerror quit}if count 1 ne{quit}if aload pop restore<</OutputFile(/dev/null)>>setpagedevice}bind def (_region_.prv/tmp2013Dou/preview.dsc)(r)file dup dup 0 setfileposition 425()/SubFileDecode filter cvx exec dup dup 425 setfileposition 50()/SubFileDecode filter cvx <</OutputFile(_region_.prv/tmp2013Dou/prev001.png)>>preview-do
AFPL Ghostscript 8.14: **** Could not open the file .
Error: /invalidfileaccess in --.outputpage--
Operand stack:
1 true
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue 2 3 %oparray_pop --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1148 --nostringval-- %end_runandhide --nostringval-- --nostringval-- --nostringval-- 0 8 %oparray_pop --nostringval-- --nostringval--
Dictionary stack:
--dict:1120/1686(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- --dict:104/127(ro)(G)-- --dict:238/347(ro)(G)-- --dict:19/24(L)-- --dict:4/6(L)-- --dict:23/31(L)--
Current allocation mode is local
Last OS error: 2

Preview-GhostScript finished

Regards, Frank
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer
David Kastrup
2005-02-25 18:52:06 UTC
Permalink
Post by Frank Küster
Post by David Kastrup
In order to get rid of all the security bunk from switching between
safe and unsafe mode, I have reorganized the GhostScript calls, and
now file names of the generated previews are completely different,
and lots of code has changed. So please test-drive this change
(no, the installation changes are not yet finished and checked in,
I still have to do this). I need to know when temporary files
don't get removed and similar things.
The bug I reported to preview-latex this week is still there. The gs
gs -q -dSAFER -dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r123.035x122.862
GS>/.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 gsave 0.705882 0.933333 0.705882 setrgbcolor false setstrokeadjust 3 setlinewidth clippath strokepath matrix setmatrix true {2 index{newpath}if round exch round exch moveto pop false}{round exch round exch lineto}{curveto}{closepath}pathforall pop fill grestore }{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-do{[count 3 roll save]3 1 roll{setpagedevice}stopped{handleerror quit}if cvx systemdict/.runandhide known{.setsafe(AFPL Ghostscript)product ne{<<>>setpagedevice}if{.runandhide}}if stopped{handleerror quit}if count 1 ne{quit}if aload pop restore<</OutputFile(/dev/null)>>setpagedevice}bind def (_region_.prv/tmp2013Dou/preview.dsc)(r)file dup dup 0 setfileposition 425()/SubFileDecode filter cvx exec dup dup 425 setfileposition 50()/SubFileDecode filter cvx <</OutputFile(_region_.prv/tmp2013Dou/prev001.png)>>preview-do
This is not a report about the new code that I checked in half an hour
ago. Please resynch, reinstall and try again.

I should have mentioned in the mail I sent out that it came
immediately after checking the stuff in, so please don't test this
right now with a nightly snapshot or similar: they don't have the new
code right now.

In case you want to help but don't use CVS to update, you can also
just fetch preview.el from the Sourceforge web interface to CVS. It
is the only file containing _relevant_ changes.

I'd really appreciate hearing about it.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-02-25 19:11:25 UTC
Permalink
Post by David Kastrup
I should have mentioned in the mail I sent out that it came
immediately after checking the stuff in, so please don't test this
right now with a nightly snapshot or similar: they don't have the new
code right now.
In case you want to help but don't use CVS to update, you can also
just fetch preview.el from the Sourceforge web interface to CVS. It
is the only file containing _relevant_ changes.
Uh, you know that it takes some time till changes you made in the CVS
repositories on SourceForge which require authentication propagate to
the repositories with anonymous access? Usually one or two hours.
--
Ralf
David Kastrup
2005-02-25 19:20:26 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
I should have mentioned in the mail I sent out that it came
immediately after checking the stuff in, so please don't test this
right now with a nightly snapshot or similar: they don't have the new
code right now.
In case you want to help but don't use CVS to update, you can also
just fetch preview.el from the Sourceforge web interface to CVS.
It is the only file containing _relevant_ changes.
Uh, you know that it takes some time till changes you made in the
CVS repositories on SourceForge which require authentication
propagate to the repositories with anonymous access? Usually one or
two hours.
Oh RATS! No, I didn't know that. I assumed that the repositories
were the same.

What about the web interface? It carries
<URL:http://cvs.sourceforge.net/viewcvs.py/*checkout*/preview-latex/preview/preview.el>
which seems up to date. But right now we are 2 hours 40 minutes after
the checkin, so anonymous CVS probably should work, too.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli
2005-02-25 19:48:39 UTC
Permalink
Post by David Kastrup
Post by Ralf Angeli
Uh, you know that it takes some time till changes you made in the
CVS repositories on SourceForge which require authentication
propagate to the repositories with anonymous access? Usually one or
two hours.
Oh RATS! No, I didn't know that. I assumed that the repositories
were the same.
What about the web interface? It carries
<URL:http://cvs.sourceforge.net/viewcvs.py/*checkout*/preview-latex/preview/preview.el>
which seems up to date. But right now we are 2 hours 40 minutes after
the checkin, so anonymous CVS probably should work, too.
The web interface sits on top of the CVS repository with anonymous
access. So as long as the changes are not in the repository the web
interface will not show them either.

I tried a `cvs up' right after you sent the message and did not get
any updates. Then I looked at the web interface and did not see any
new check-in either. A few minutes ago I did `cvs up' again and got
the changes.
--
Ralf
Ralf Angeli
2005-02-25 20:17:26 UTC
Permalink
Post by David Kastrup
So please test-drive this change
No obvious problems with

$ gs -h
ESP Ghostscript 7.07.1 (2003-07-12)

and `preview-image-type' set to 'dvipng or 'png.
--
Ralf
David Kastrup
2005-02-25 20:49:41 UTC
Permalink
Post by Ralf Angeli
Post by David Kastrup
So please test-drive this change
No obvious problems with
$ gs -h
ESP Ghostscript 7.07.1 (2003-07-12)
and `preview-image-type' set to 'dvipng or 'png.
Well, actually 7.07 was my default installation on Fedora before, so I
am not particularly surprised. That was apparently one of the few
GhostScripts that actually _worked_ even with PDF. Which, by the way,
is the most interesting case, anyway.

I shall probably try 8.15 and 8.50 which I have now installed in some
obscure side directories.

By now we have the variants
AFPL GhostScript
then with some delay behind it
GPL GhostScript
then with even more delay and patches and excising
GNU GhostScript
and then generally following after it, but with lots of patches
ESP GhostScript

As if having two variants had not been enough of a nuisance already.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Loading...