| Summary: | Arrays clone() does not work in static method of interface for IBM JDK 8 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ondrej Lukas <olukas> |
| Component: | java-1.8.0-ibm | Assignee: | jiri vanek <jvanek> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | bugproxy, hannsj_uhl, jjarvis |
| Target Milestone: | rc | Keywords: | Patch |
| Target Release: | 7.3 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-09 14:30:03 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1230910 | ||
------- Comment From chavez.com 2016-04-04 16:02 EDT------- Raised PMR 71432,001,866 with Java L3. ------- Comment From chavez.com 2016-04-08 11:59 EDT------- Checked on Java L3 ticket. PMR has been reassigned to core team but no other update. Will follow-up next week. ------- Comment From chavez.com 2016-04-12 10:20 EDT-------
Updates from Java L3:
I am able to recreate the issue on Java 8 SR3 by directly calling the
static method from the interface.
I was able to recreate the issue with a simple test:
public class Test {
public static void main(String[] args) throws Exception {
int [] array = SimpleInterface.methodWillFail();
for (int i=0; ; i++)
{
java.lang.Thread.sleep(200);
System.out.println(i);
}
}
}
#jre/bin/java Test
Exception in thread "main" java.lang.IllegalAccessError: Class
Test$SimpleInterface illegally accessing "protected" member of class [I
at Test$SimpleInterface.methodWillFail(Test.java:19)
at Test.main(Test.java:6)
#jre/bin/java -version
Java(TM) SE Runtime Environment (build pxa6480sr3-20160407_01(SR3))
IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References
20160406_298435 (JIT enabled, AOT enabled)
J9VM - R28_20160406_1359_B298435
JIT - tr.r14.java.green_20160329_114288
GC - R28_20160406_1359_B298435_CMPRSS
J9CL - 20160406_298435)
JCL - 20160331_01 based on Oracle jdk8u91-b13
While The same test works without error in the following Oracle JDK:
# jre/bin/java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
In the test code if I remove return array.clone(); and just use return
array; it runs on IBM JDK without error. Also if I write the static
method within a class inside the interface, it works with IBM JDK.
Moving to VM team for investigation.
I will review the PMR & share my analysis by EOD 13th Apr.
------- Comment From chavez.com 2016-04-20 08:37 EDT------- Update from Java L3. I would like to here back from Red Hat if there is a requirement to have an interim fix sooner or waiting for the official service release is acceptable. "APAR IV83949 is created for this issue. It will be available as part of our next SR release. Expected timeline for it to be available by Jun 2016" Will this be included in next (Oracle CPU 19.4) security release? If so, then it should be ok to wait. If not, then interim fix would be nice. ------- Comment From chavez.com 2016-04-20 09:05 EDT------- I've passed on the question to Java L3. Waiting for reply... ------- Comment From chavez.com 2016-04-20 09:29 EDT------- Java L3 reply: The bug/issue is specific to IBM JDK (J9), we don't know whether the same issue exist in Oracle JDK or not. Our release schedule is independent of Oracle JDK. As I mentioned in my update, the fix will be part of our next SR release which is expected to be GAed in early June. I know all above. Still always few weeks after Oracle CPU there IS ibm update. If this issue is not resolved in this closest update, then June is definitely to late ------- Comment From chavez.com 2016-04-20 14:34 EDT------- I am a bit confused as to the request about the fix for Oracle as previously the JTC had tried the following version and it did not show the problem: java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) However I still went back to Java L3 and queried them about their obligation, if any, to report issues they find to Oracle and here is what they said: "Yes, we do report to Oracle based on the component. For example, Class Library component/code base is common for IBM JDK & Oracle JDK. So, we report to Oracle if any issue is identified in Class Library component. But, the current issue is reported in JVM component which is IBM's independent implementation 'J9'. If customer finds same issue with Oracle JDK, then customer needs to work with the Oracle. " fyi ... IBM Java 1.8.0 SR3 FP10 was released at 07/26/2016 at http://www.ibm.com/developerworks/java/jdk/linux/download.html ... (In reply to Hanns-Joachim Uhl from comment #11) > fyi ... IBM Java 1.8.0 SR3 FP10 was released at 07/26/2016 at > http://www.ibm.com/developerworks/java/jdk/linux/download.html ... . ... and which is available from RHN since 08/10/2016 ... ... please see https://access.redhat.com/errata/RHSA-2016:1587 ... . ... please retest as soon as possible whether this bugzilla is resolved ... ------- Comment From hannsj_uhl.com 2016-09-22 07:08 EDT------- ... per the previous comments closing this bugzilla at the IBM side ... Closing as CURRENT RELEASE. |
It seems IBM JDK has an issue with using clone() method for arrays in static method of interface. Using arrays clone() method causes exception as following for IBM JDK 8: java.lang.IllegalAccessError: Class com/mycompany/ibmjdkclone/SimpleInterface illegally accessing "protected" member of class [I This happens only for using arrays clone() method from static method of interface. Other places where arrays clone() method is used work fine (e.g. static method in some class; even in static method in inner class of interface). It can be simply reproduced by calling static method methodWillFail() of this interface: public interface SimpleInterface { static int[] methodWillFail() { int[] array = {1, 2}; return array.clone(); } } We use following version of IBM JDK 8: java -version java version "1.8.0" Java(TM) SE Runtime Environment (build pxa6480sr2fp10-20160108_01(SR2 FP10)) IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20160106_284759 (JIT enabled, AOT enabled) J9VM - R28_20160106_1341_B284759 JIT - tr.r14.java_20151209_107110.02 GC - R28_20160106_1341_B284759_CMPRSS J9CL - 20160106_284759) JCL - 20151231_01 based on Oracle jdk8u71-b15