cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hartle <mhar...@hartle-klug.com>
Subject Sun confirmed bug in JPEGEncoder, affecting Batik
Date Tue, 25 Sep 2001 13:30:10 GMT
Hello,

recently, we found a bug in Suns native 
sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(), causing the 
VM to crash when streams where images are being encoded to are somehow 
disconnected (e.g., user pressed stop button, connection reset by peer, 
...) before the encoding has ended. Sun has confirmed this to be a new 
bug under Bug Id 4502892, which can be seen under 
http://developer.java.sun.com/developer/bugParade/bugs/4502892.html (you 
may have to register with Suns Java Developer Connection, but this is 
free). As far as we were able to test it, Suns JDK 1.3.1, JDK 1.4 beta 
and IBMs JDK 1.3.0 are affected under both Windows 2000 and Linux 2.2.

Attached please find the Test.java, allowing you to test whether your 
plattform is affected by this bug, and a slightly modified 
org.apache.batik.transcoder.image.JPEGEncoder.java which works around 
the issue by buffering the encoded image and thereby isolating the 
faulty native method from problematic stream exceptions. To test whether 
your plattform is affected, have a look at Test.java and test your 
plattform with the attached Java class by typing "javac Test.java", 
followed by "java Test". When this application is being run, it silently 
loops printing dots every 500 ms, having one thread encode a JPEG image 
and another one read only some of it and then closing the connection. We 
rarely saw more than 5-6 dots being printed without the VM crashing.

An unpatched Batik running on an affected JVM cannot reliably being used 
in production systems for server-side image generation; we were running 
a Win2K server with Tomcat 4 and Cocoon2 using Batik for dynamic image 
generation, and it took us more than 2 days to isolate this and write 
the workaround. If you are registered with Suns Java Developer 
Connection and have a spare Bug Vote slot, please be so kind to vote for 
this bug.

Best regards,

Michael Hartle,
Hartle & Klug GbR

Mime
View raw message