Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Certain methods in imageioJPEG.c (the glue code between the IJG native JPEG libraries and the Image I/O API) such as readImageHeader(), readImage(), writeImageHeader(), and writeImage() make JNI calls in the scope of Get/ReleasePrimitiveArrayCritical. Most Java upcalls in the file have been correctly surrounded with RELEASE/GET_ARRAYS macros, but a few cases fell through the cracks. Running any application that reads or writes JPEG images with the non-standard -Xcheck:jni flag causes the following error (or something similar): FATAL ERROR in native method: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:545) at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:300) at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:422) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:538) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:871) at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:855) at javax.imageio.ImageIO.read(ImageIO.java:1317) at javax.imageio.ImageIO.read(ImageIO.java:1241) at Test.<init>(Test.java:29) at Test.main(Test.java:40) These problem areas are unlikely to cause problems, but we should try to conform to the JNI specs, which mandate that no JNI upcalls be made inside of a critical section. ###@###.### 2001-11-16
|