[tex-live] bug in epstopdf.pl: using tell/seek on a pipe on solaris

Daniel Villeneuve daniel2villeneuve at videotron.ca
Wed Sep 2 04:36:59 CEST 2009


Recently, I've installed ghostscript-8.64 and pstoedit-3.45 on 
solaris2.9 and tried to generate PDF files using pdflatex (TeXLive 2008).

I got rather deep errors processing some Postscript files, and the 
problem was related to the following lines in 
texmf/scripts/epstopdf/epstopdf.pl:

  open(OUT,"|$pipe") or error "Cannot open Ghostscript for piped input";
...
      my $pos = tell(OUT)+length($_);


The problem is that the expectation about "tell(OUT)" is to yield the 
total number of characters written so far, but for a pipe on solaris I 
only get the number of characters since the last newline.  So the code 
as it is works when outputting to a file, or with a pipe on linux (at 
least for the tests I've made), but it fails when used with an output 
pipe on solaris.

My local solution was to remove the CR-EOL hack entirely (I'm only 
installing TeXLive on POSIX platforms), use <IN> instead of getline() 
and "my $pos = tell(IN);" in place of the line above.

I understand that this is not a valid solution (regression w.r.t. the 
CR-EOL case).  Maybe a better approach would be to drop the "lookahead" 
part of the CR-EOL hack and read the first part a second time.

Regards,
--
Daniel Villeneuve


More information about the tex-live mailing list