JDK-6671585 : memory fault using RescaleOP
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: generic
  • Submitted: 2008-03-05
  • Updated: 2011-01-19
  • Resolved: 2008-07-30
Related Reports
Duplicate :  
Relates :  
Description
RescaleOp causes a memory fault when running on MacOS (jdk 1.5) and Ubunto (jdk 1.6)
Sample program is attached. This code has been known to run in the past, but I don't have 1.4 anymore to retest it.

I suspect the problem is related to the way the image is created, though the resulting BuffredImage can be written to a .png file and looks fine. 

I will be filling a related bug against ConvolveOP that refuses to convolve the same image.

Ubuntu
ddhill@ddhill-desktop:~$ java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

MacOs
[ddhill devware_build]$ java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

Comments
EVALUATION The problem reported here is duplicate of CR 4886506. Note that jpeg reader produce buffered image of type TYPE_3BYTE_BGR. The data type for this image type is TYPE_BYTE. Note also that rescale operation is created using same scale factor and offset for all color components of filtered image. This is exactly same situation as described by the CR 4886506. This particular problem may be workaround by construction of RescaleOp object in a slightly different manner: we can explicitly specify settings for each color component of processed image: // Brighten the image by 30% final float scaleFactor = 1.3f; final float[] scaleFactors = new float[] { scaleFactor, scaleFactor, scaleFactor }; final float[] offstes = new float[] { 0f, 0f, 0f }; final RescaleOp op = new RescaleOp(scaleFactors, offstes, null); This change in rescale operation setup allows to workaround the problem. So, I close this CR as a duplicate of 4886506.
30-07-2008

WORK AROUND See evaluation.
30-07-2008