Your message dated Sat, 05 May 2007 13:17:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#299447: fixed in gv 1:3.6.2-4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: gv
Version: 1:3.6.1-9
Severity: normal

In certain cases the ps file scanner can get confused by ps files
embedded within a page.  The file
<http://www.inference.phy.cam.ac.uk/sanjoy/bug/gv/several-pages.ps>,
extracted from a colleague's textbook, shows the problem.  Running gv
several-pages.ps shows only page "540,54" (really "540,541") in the
page list.  But the file has a few pages: (540,541) and (543,542) and
(639,638).  On my laptop (Pentium 3) all versions of gs (v8.01, 8.14,
and 8.50) show the full set of pages, so I the problem is most likely
in gv.

The
<http://www.inference.phy.cam.ac.uk/sanjoy/bug/gv/difficult-page.ps>
file has the difficult page itself, without the huge prolog (all those
tex fonts) or the pages after it.

Also, the vanilla gv 3.6.1, say from the gv_3.6.1.orig.tar.gz file,
shows all the pages in the sidebar.  So the problem is probably in a
Debian patch.  By trying various partial patches and guessing a bit, I
narrowed it down to this hunk from
debian/patches/02_293976=045735_filename+unknown.diff (available after
doing 'apt-src install gv/unstable'), which applies to the readline()
routine:

--- gv-3.6.1.orig/src/ps.c
+++ gv-3.6.1/src/ps.c
@@ -1826,7 +1858,12 @@
    else
 #endif
    if  (!IS_COMMENT("Begin"))     {} /* Do nothing */
-   else if IS_BEGIN("Document:")  SKIP_UNTIL_1("EndDocument")
+   else if IS_BEGIN("Document:")  {  /* Skip the EPS without handling its 
content */
+            while (line && !IS_END("Document")) {
+               line = ps_io_fgetchars(fd,-1);
+               if (line) *line_lenP += FD_LINE_LEN;
+            }
+   }
    else if IS_BEGIN("Feature:")   SKIP_UNTIL_1("EndFeature")
 #ifdef USE_ACROREAD_WORKAROUND
    else if IS_BEGIN("File")       SKIP_UNTIL_2("EndFile","EOF")

(also available at
<http://www.inference.phy.cam.ac.uk/sanjoy/bug/gv/causes-bug.diff>)

The culprit seems to be the change from SKIP_UNTIL_1("EndDocument") to
the while loop.  SKIP_UNTIL_1() calls readline(), which skips over
embedded ps documents.  The while loop, however, blindly reads to the
next %%EndDocument.  The difference shows up when an included ps
document includes a ps document, as the troublesome page does.  Here
is its structure:

$ egrep '^%%(Begin|End)Document' difficult-page.ps 
%%BeginDocument: /home/mackay/handbook/figs/inter/sc_a1.blank.ps
%%BeginDocument: EPSF
%%EndDocument
%%EndDocument
%%BeginDocument: /home/mackay/handbook/figs/inter/sc_a2b.blank.ps
%%BeginDocument: EPSF
%%EndDocument
%%EndDocument
%%BeginDocument: /home/mackay/handbook/figs/inter/sc_a3.blank.ps
%%BeginDocument: EPSF
%%EndDocument
%%EndDocument
%%BeginDocument: /home/mackay/handbook/figs/test_train.eps
%%EndDocument
%%BeginDocument: /home/mackay/handbook/figs/probability.eps
%%EndDocument
%%BeginDocument: /home/mackay/handbook/figs/error_bar_net.ps
%%EndDocument

So the first document includes another document.  With the patch, the
scanner will get to the first BeginDocument, then skip to the first
EndDocument, which matches the *second* BeginDocument.  But the second
BeginDocument gets skipped over, so the scanner should be quite
confused!

Now, I'm not sure whether the analysis above is totally right.  But
applying the patch above produces the bug, and reverting it removes
the bug.  And the behavior with the patch seems to be incorrect and
worth fixing.

Although perhaps the embedded ps file is part of the problem?  It was
created by gnuplot and is basically an EPS file surrounded by a few
lines to turn it into a regular PS file -- probably one is asking for
trouble by including it.  That section of 'several-pages.ps' begins:

%%BeginDocument: /home/mackay/handbook/figs/inter/sc_a2b.blank.ps
%!PS-Adobe-2.0
%%Creator: gnuplot
%%DocumentFonts: Courier
%%DocumentNeededFonts: Courier
%%Pages: (atend)
%%BoundingBox: 46 50 550 770
%%EndComments
/GnuTransform {
  90 rotate
  50 -550 translate
  2 2 scale
} def
%%EndProlog
%%Page: ? 1
gsave
GnuTransform
%%BeginDocument: EPSF
1 dict begin
/showpage {} def
%!PS-Adobe-2.0 EPSF-2.0
%%Creator: gnuplot
%%DocumentFonts: Courier
%%DocumentNeededFonts: Courier
%%BoundingBox: 0 0 360 252
%%EndComments

So gnuplot was doing something funky by making an EPS file and
wrapping a few lines of ps around it to handle the scaling and moving
the figure towards the center of the page.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.27-200503091
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages gv depends on:
ii  gs                       8.01-5          Transitional package
ii  gs-afpl [gs]             8.14-3          The AFPL Ghostscript PostScript in
ii  gs-gpl [gs]              8.01-5          The GPL Ghostscript PostScript int
ii  libc6                    2.3.2.ds1-20    GNU C Library: Shared libraries an
ii  libice6                  4.3.0.dfsg.1-10 Inter-Client Exchange library
ii  libsm6                   4.3.0.dfsg.1-10 X Window System Session Management
ii  libx11-6                 4.3.0.dfsg.1-10 X Window System protocol client li
ii  libxext6                 4.3.0.dfsg.1-10 X Window System miscellaneous exte
ii  libxmu6                  4.3.0.dfsg.1-10 X Window System miscellaneous util
ii  libxpm4                  4.3.0.dfsg.1-10 X pixmap library
ii  libxt6                   4.3.0.dfsg.1-10 X Toolkit Intrinsics
ii  xaw3dg                   1.5+E-8         Xaw3d widget set
ii  xlibs                    4.3.0.dfsg.1-10 X Keyboard Extension (XKB) configu

-- no debconf information


--- End Message ---
--- Begin Message ---
Source: gv
Source-Version: 1:3.6.2-4

We believe that the bug you reported is fixed in the latest version of
gv, which is due to be installed in the Debian FTP archive:

gv_3.6.2-4.diff.gz
  to pool/main/g/gv/gv_3.6.2-4.diff.gz
gv_3.6.2-4.dsc
  to pool/main/g/gv/gv_3.6.2-4.dsc
gv_3.6.2-4_i386.deb
  to pool/main/g/gv/gv_3.6.2-4_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stefan Fritsch <[EMAIL PROTECTED]> (supplier of updated gv package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 05 May 2007 14:51:16 +0200
Source: gv
Binary: gv
Architecture: source i386
Version: 1:3.6.2-4
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <[EMAIL PROTECTED]>
Changed-By: Stefan Fritsch <[EMAIL PROTECTED]>
Description: 
 gv         - PostScript and PDF viewer for X
Closes: 299447 393454
Changes: 
 gv (1:3.6.2-4) unstable; urgency=low
 .
   * QA upload.
   * gv has been orphaned. Setting maintainer to QA group.
   * Fix reading of ~/.gv config file. (Closes: #393454)
   * Fix handling of files with nested .eps files. (Closes: #299447)
Files: 
 ce99b47fa94fe5b03410cff5c86f935e 575 text optional gv_3.6.2-4.dsc
 3fdadfbfcca440450821f4f80f32fdf8 14661 text optional gv_3.6.2-4.diff.gz
 f599a45f9695c256b6eb4f612222ff33 168342 text optional gv_3.6.2-4_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGPIC0bxelr8HyTqQRAgE/AJ985JQGqKFzSJa27x8dtbOuH6pPYgCgnnUB
oEjpTa40Oy8rKU/SzyH0Uf8=
=xVA1
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to