Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4906854
Votes 15
Synopsis "Affine" operation with bilinear interp. and ImageLayout hint crash medialib
Category jai:medialib
Reported Against 1.1.2
Release Fixed
State 8-Fix Available, bug
Priority: 4-Low
Related Bugs
Submit Date 14-AUG-2003
Description


FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


JAI version:
------------
jai-1_1_2 Thu Jul 10 18:57:36 PDT 2003


FULL OS VERSION :
 customer  Windows 2000 [Version 5.00.2195]
French version, service pack 4


A DESCRIPTION OF THE PROBLEM :
Applying the "Affine" operation cause an exception in medialib native code when the following conditions are meet:

   * The data type is FLOAT.

   * The interpolation type is "BILINEAR".

   * The RenderingHint contains an ImageLayout
     (no matter what the ImageLayout contains)

Changind the datatype to BYTE, or the interpolation to NEAREST, or removing the ImageLayout hint make the bug disaspear.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached test case.



ERROR MESSAGES/STACK TRACES THAT OCCUR :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x187E0CA6
Function=[Unknown.]
Library=C:\Java\J2SDK\jre\bin\mlib_jai.dll

NOTE: We are unable to locate the function name  customer  for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
        at com.sun.medialib.mlib.Image.ZoomTranslate_Fp(Native Method)
        at com.sun.media.jai.mlib.MlibScaleBilinearOpImage.computeRect(MlibScaleBilinearOpImage.java:143)
        at javax.media.jai.ScaleOpImage.computeTile(ScaleOpImage.java:1195)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1139)
        at javax.media.jai.PlanarImage.cobbleFloat(PlanarImage.java:3267)
        at javax.media.jai.PlanarImage.getData(PlanarImage.java:2194)
        at javax.media.jai.PlanarImage.getData(PlanarImage.java:2029)
        at javax.media.jai.RenderedOp.getData(RenderedOp.java:2277)
        at fr.ird.jai.AffineTest.main(AffineTest.java:28)

Dynamic libraries:
0x00400000 - 0x00406000         C:\Java\J2SDK\bin\java.exe
0x78460000 - 0x784E1000         C:\WINNT\system32\ntdll.dll
0x78ED0000 - 0x78F32000         C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F34000         C:\WINNT\system32\KERNEL32.DLL
0x770C0000 - 0x7712E000         C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78045000         C:\WINNT\system32\MSVCRT.dll
0x08000000 - 0x08136000         C:\Java\J2SDK\jre\bin\client\jvm.dll
0x77E00000 - 0x77E65000         C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000         C:\WINNT\system32\GDI32.DLL
0x77540000 - 0x77571000         C:\WINNT\system32\WINMM.dll
0x75E00000 - 0x75E1A000         C:\WINNT\system32\IMM32.DLL
0x6C8D0000 - 0x6C8D8000         C:\WINNT\system32\LPK.DLL
0x66410000 - 0x66464000         C:\WINNT\system32\USP10.dll
0x10000000 - 0x10007000         C:\Java\J2SDK\jre\bin\hpi.dll
0x007D0000 - 0x007DE000         C:\Java\J2SDK\jre\bin\verify.dll
0x007E0000 - 0x007F8000         C:\Java\J2SDK\jre\bin\java.dll
0x00800000 - 0x0080D000         C:\Java\J2SDK\jre\bin\zip.dll
0x18470000 - 0x1857A000         C:\Java\J2SDK\jre\bin\awt.dll
0x777F0000 - 0x7780E000         C:\WINNT\system32\WINSPOOL.DRV
0x793C0000 - 0x793D1000         C:\WINNT\system32\MPR.DLL
0x77A40000 - 0x77B2C000         C:\WINNT\system32\ole32.dll
0x18590000 - 0x185B3000         C:\Java\J2SDK\jre\bin\cmm.dll
0x186C0000 - 0x189F0000         C:\Java\J2SDK\jre\bin\mlib_jai.dll
0x77910000 - 0x77933000         C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000         C:\WINNT\system32\DBGHELP.dll
0x68EA0000 - 0x68EAB000         C:\WINNT\system32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 576K, used 88K [0x10010000, 0x100b0000, 0x104f0000)
  eden space 512K,  17% used [0x10010000, 0x10026338, 0x10090000)
  from space 64K,   0% used [0x100a0000, 0x100a0000, 0x100b0000)
  to   space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
 tenured generation   total 2220K, used 1690K [0x104f0000, 0x1071b000, 0x14010000)
   the space 2220K,  76% used [0x104f0000, 0x10696a98, 0x10696c00, 0x1071b000)
 compacting perm gen  total 4096K, used 3720K [0x14010000, 0x14410000, 0x18010000)
   the space 4096K,  90% used [0x14010000, 0x143b22b0, 0x143b2400, 0x14410000)

Local Time = Tue Jul 29 19:59:36 2003
Elapsed Time = 1
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
#
# An error report file has been saved as hs_err_pid1932.log.
# Please refer to the file for further information.
#


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.RenderingHints;
import java.awt.image.RenderedImage;
import java.awt.geom.AffineTransform;

import javax.media.jai.*;
import javax.media.jai.operator.*;


public class AffineTest {
  public static void main(final String[] args) {
    System.out.println(JAI.getBuildVersion());

    RenderedImage image;
    image = ConstantDescriptor.create(
              new Float(450), new Float(460),
              new Float[] {new Float(10f)}, null);

    ImageLayout layout = new ImageLayout();
    RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

    image = AffineDescriptor.create(image,
              AffineTransform.getTranslateInstance(-50, -50),
              Interpolation.getInstance(Interpolation.INTERP_BILINEAR),
              new double[]{Double.NaN}, hints);

    image.getData(); // CRASH!!!
  }
}

---------- END SOURCE ----------
(Incident Review ID: 193054) 
======================================================================
Posted Date : 2006-07-17 17:54:15.0
Work Around
N/A
Evaluation
Tested on Window NT and reproduced the problem.  (See the attached "result" file).

  xxxxx@xxxxx   2003-08-14

--- BEGIN ---   xxxxx@xxxxx   2003-08-14

On WinNT 4.0, with a debugging version of mlib_jai.dll, JVM crashed in the
following mediaLib function call:

------ mlib_ImageZoomTranslate_Fp -- mediaLib:0220:20030814:win32 ------
src->type = 4
dst->type = 4
src->data = 030E2CFC
dst->data = 02B40474
src->stride = 512
dst->stride = 512
3 x 2 x 1 --> 2 x 1 x 1
zoomx = 1.000000, zoomy = 1.000000
tx = 0.000000, ty = 0.000000
filter = 1
edge   = 0

The same test ran without a crash on Solaris/SPARC.  The attached log file,
log.run.csh, shows that the function was called in cases of 1x scaling
and 0 or -1 translation in this test.   While those cases might be processed
by pure Java code more efficiently, we still should fix the mediaLib function
mlib_ImageZoomTranslate_Fp() on Wintel.

--- END ---   xxxxx@xxxxx   2003-08-14

--- BEGIN ---   xxxxx@xxxxx   2003-08-20

It turned out to be caused by a bug in MSC 6.0 version 12.00.8168 which was
used for building mlib_jai.dll and mlib_jai_mmx.dll for JAI 1.1.2.  Using
a slightly newer compiler, version 12.00.8804, the MCST team couldn't
reproduce the problem.  Turning off optimization on function
mlib_ImageZoomClipping() fixed the problem.  Yet a better workaround is
to move the following statements near the end of mlib_ImageZoomClipping()
up to next to "param->zoomy = zoomy;"

        param->rzoomx = rzoomx;
        param->rzoomy = rzoomy;

--- END ---   xxxxx@xxxxx   2003-08-20
The suggested fix of moving two statements is incorrect.
By upgrading the compiler to VC7.0, the bug is fixed with
MediaLibJAI.20060714.
Posted Date : 2006-07-17 17:54:16.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang