United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7167647 : [macosx] Posix semaphore leak in ColorSpace

Details
Type:
Bug
Submit Date:
2012-05-09
Status:
Closed
Updated Date:
2012-06-20
Project Name:
JDK
Resolved Date:
2012-06-20
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Duplicate
Affected Versions:
7u4
Fixed Versions:
8

Related Reports
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Darwin euler.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
Calling toRGB() on a CIEXYZ ColorSpace leaks Posix semaphores and exhausts system files.

REGRESSION.  Last worked in version 6u31

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Put the following code in a file named Test.java:

    import java.awt.color.ColorSpace;
    public class Test
    {
        public static void main(String[] args) throws Throwable {
            final ColorSpace CIEXYZ = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
            for(int i = 0; i < 100000; i++) {
                CIEXYZ.toRGB(new float[] {80f, 100, 100});
            }
            new java.io.FileInputStream("Test.java").close();
        }
    }

Run javac Test.java
Run java Test


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program shouldn't output anthing
ACTUAL -
Exception in thread "main" java.io.FileNotFoundException: Test.java (Too many open files)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:97)
	at Test.main(Test.java:9)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.io.FileNotFoundException: Test.java (Too many open files)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:97)
	at Test.main(Test.java:9)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
    import java.awt.color.ColorSpace;
    public class Test
    {
        public static void main(String[] args) throws Throwable {
            final ColorSpace CIEXYZ = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
            for(int i = 0; i < 100000; i++) {
                CIEXYZ.toRGB(new float[] {80f, 100, 100});
            }
            // Should be an existing file
            new java.io.FileInputStream("Test.java").close();
        }
    }

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None found if you need CIEXYZ support.

                                    

Comments



Hardware and Software, Engineered to Work Together