Bug 4030 - IOException creating Postscript with graphics on Sun
Summary: IOException creating Postscript with graphics on Sun
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.15
Hardware: Sun Solaris
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-08 15:39 UTC by Tim Brinson
Modified: 2012-04-01 07:01 UTC (History)
0 users



Attachments
The FO file that causes the problem. (4.45 KB, text/xml)
2001-10-08 15:45 UTC, Tim Brinson
Details
Another error output when there are 100 graphic references. Shows they only occur sometimes. (6.22 KB, text/plain)
2001-10-08 16:20 UTC, Tim Brinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Brinson 2001-10-08 15:39:13 UTC
When a file with external graphics is processed a write error occured for the
first grahpic referenced in the file.  The rest of the file processed fine
except the first graphic.

This did not occur on NT but did on Solaris.

The there are two possible exceptions that are raised from the same stack trace
(See below).  The outcome is the same in both cases.  Not sure why one exception
is raised some times and the other one other tiems.

----------------------------------------------------------------------
Error1:
----------------------------------------------------------------------


FOP 0.20.1
using SAX parser org.apache.xerces.parsers.SAXParser
building formatting object tree
setting up fonts
rendering areas to PostScript
 [1]
 [2]java.io.IOException: Pipe broken
	at java.lang.Throwable.fillInStackTrace(Native Method)
	at java.lang.Throwable.fillInStackTrace(Compiled Code)
	at java.lang.Throwable.<init>(Compiled Code)
	at java.lang.Exception.<init>(Compiled Code)
	at java.io.IOException.<init>(Compiled Code)
	at java.io.PipedInputStream.receive(Compiled Code)
	at java.io.PipedInputStream.receive(Compiled Code)
	at java.io.PipedOutputStream.write(PipedOutputStream.java:136)
	at java.util.zip.DeflaterOutputStream.deflate(Compiled Code)
	at java.util.zip.DeflaterOutputStream.finish(Compiled Code)
	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:132)
	at org.apache.fop.render.ps.FlateEncodeFilter.doFilter(FlateEncodeFilter.java:34)
	at org.apache.fop.render.ps.FilterThread.run(FilterThread.java:27)

 [3]
Parsing of document complete, stopping renderer
written out PostScript
Initial heap size: 975Kb
Current heap size: 2356Kb
Total memory used: 1381Kb
  Memory use is indicative; no GC was performed
  These figures should not be used comparatively
Total time used: 3988ms
Pages rendererd: 3
Avg render time: 1329ms/page
Mon Oct 8 17:22:53 CDT 2001




----------------------------------------------------------------------
Error2:
----------------------------------------------------------------------


FOP 0.20.1
using SAX parser org.apache.xerces.parsers.SAXParser
building formatting object tree
setting up fonts
rendering areas to PostScript
 [1]java.io.IOException: Read end dead
	at java.lang.Throwable.fillInStackTrace(Native Method)
	at java.lang.Throwable.fillInStackTrace(Compiled Code)
	at java.lang.Throwable.<init>(Compiled Code)
	at java.lang.Exception.<init>(Compiled Code)
	at java.io.IOException.<init>(Compiled Code)
	at java.io.PipedInputStream.receive(Compiled Code)
	at java.io.PipedInputStream.receive(Compiled Code)
	at java.io.PipedOutputStream.write(PipedOutputStream.java:136)
	at java.util.zip.DeflaterOutputStream.deflate(Compiled Code)
	at java.util.zip.DeflaterOutputStream.finish(Compiled Code)
	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:132)
	at org.apache.fop.render.ps.FlateEncodeFilter.doFilter(FlateEncodeFilter.java:34)
	at org.apache.fop.render.ps.FilterThread.run(FilterThread.java:27)

 [2]
 [3]
Parsing of document complete, stopping renderer
written out PostScript
Initial heap size: 975Kb
Current heap size: 2356Kb
Total memory used: 1381Kb
  Memory use is indicative; no GC was performed
  These figures should not be used comparatively
Total time used: 4056ms
Pages rendererd: 3
Avg render time: 1352ms/page
Mon Oct 8 17:33:46 CDT 2001
Comment 1 Tim Brinson 2001-10-08 15:45:30 UTC
Created attachment 651 [details]
The FO file that causes the problem.
Comment 2 Tim Brinson 2001-10-08 15:52:37 UTC
As I run it more the symptoms change a little (for no appearant reason).  Now it
is occuring on the second and third graphic in the file and not the first one. 
All else is the same.

BTW, the version of FOP is 0.20.1 and the version of java is 1.2.2.
Comment 3 Tim Brinson 2001-10-08 16:20:07 UTC
Created attachment 652 [details]
Another error output when there are 100 graphic references.  Shows they only occur sometimes.
Comment 4 Jeremias Maerki 2001-10-08 23:18:38 UTC
I feared that something like this might happen. The problem seems to be 
something related to different implementations of threads between the JDK on 
Windows and Solaris. Maybe there is also a problem with piped streams that I'm 
using to run the filters. When I wrote those filters I was a bit lazy to 
implement proper descendants of FilterOutputStreams. Instead I implemented them 
so they rather worked on the whole stream at once than in chunks like it would 
have to being implemented as FilterOutputStreams. That's why I had to introduce 
the piped streams.

So, to resolve this we have to find out if there's a known problem with threads 
or piped stream in Solaris JDK and maybe try to find a work-around. 
Unfortunately, I can't help here because I don't have a Solaris machine handy. 
You might also try another version of the JDK.

The other solution would be to reimplement the filters as descendants of 
FilterOutputStream. It would be so nice if someone could do this and also 
implement the RunLengthFilter which is part of PostScript Level 2, so we have 
at least some kind of compression on bitmaps. The problem here is that PS Level 
2 supports LZW compression which brings up licence issues, but the RunLength 
compression is free. Only PS Level 3 has Flate compression.
Comment 5 Jeremias Maerki 2008-11-01 08:23:44 UTC
In recent versions of FOP this is no longer implemented this way and this particular bug shouldn't pop up anymore. Closing this issue.
Comment 6 Glenn Adams 2012-04-01 07:01:36 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed