[11u] RFR: 8215449: Several tests failing when jtreg run with -vmoption:--illegal-access=deny
Severin Gehwolf
sgehwolf at redhat.com
Tue Oct 1 14:20:15 UTC 2019
Hi Christoph,
On Tue, 2019-10-01 at 09:15 +0000, Langer, Christoph wrote:
> Hi Severin,
>
> I'm wondering if this issue with ReflectionCallerCacheTest also
> exists in jdk/jdk. If so, I suggest it should be fixed there first
> and that fix be backported.
The reason for this is that the test code is different between JDK 11u
and JDK head. In particular, AccessTest.java is different.
The stack trace with --illegal-access=deny in JDK 11u looks like this:
test ReflectionCallerCacheTest.load("AccessTest$PublicFinalField"): failure
java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.lang.reflect.Field.modifiers accessible: module java.base does not "opens java.lang.reflect" to unnamed module @8cbf8a2
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:176)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:170)
at testloader//AccessTest.makeFinalNonFinal(AccessTest.java:163)
at testloader//AccessTest$FinalField.<init>(AccessTest.java:116)
at testloader//AccessTest$PublicFinalField.<init>(AccessTest.java:139)
So in JDK 11u it goes through AccessTest.makeFinalNonFinal() which
triggers the issue. That method is no longer there in jdk/jdk due to
JDK-8210496[1] which happened for JDK 12. Thus, for jdk/jdk we don't
have the path of AccessTest.makeFinalNonFinal[2], and as such no IOE is
being thrown. Therefore, it's a JDK 11-only issue at this point. Does
that make sense?
Thanks,
Severin
[1] https://bugs.openjdk.java.net/browse/JDK-8210496
[2] http://hg.openjdk.java.net/jdk-updates/jdk11u-dev/file/2201ae271c28/test/jdk/java/lang/reflect/callerCache/AccessTest.java#l116
> Best regards
> Christoph
>
> > -----Original Message-----
> > From: jdk-updates-dev <jdk-updates-dev-bounces at openjdk.java.net> On
> > Behalf Of Severin Gehwolf
> > Sent: Montag, 30. September 2019 17:25
> > To: jdk-updates-dev at openjdk.java.net
> > Subject: [11u] RFR: 8215449: Several tests failing when jtreg run with -
> > vmoption:--illegal-access=deny
> >
> > Hi,
> >
> > Please review this Oracle JDK 11 partity patch. Some tests are failing
> > in JDK 11u when VM option --illegal-access=deny is being used. The only
> > test as mentioned in JDK-8215449 which also fails in JDK 11u is
> > RacyHandler.java. Other tests' status is as follows:
> >
> > * LocaleProvider.sh (equiv of LocaleProvidersRun.java) doesn't fail
> > with --illegal-access=deny
> > * CanHandleClassFilesTest.java doesn't exist in JDK 11u and isn't
> > appropriate. JDK-8207954 added that test, which makes no sense for
> > JDK 11u.
> >
> > However, I've noticed that other tests are failing in tier1 with --
> > illegal-access=deny. Due to the above and those failures I've done
> > these changes to the original patch:
> >
> > * ReflectionCallerCacheTest.java fails with --illegal-access=deny in
> > OpenJDK 11u. Added 'java.base/java.lang.reflect:+open' to @modules
> > tag so that the test passes in JDK 11u as well. Requires JDK-8208364
> > * Drop hunk to LocaleProvidersRun.java as it doesn't apply JDK 11u.
> > * Omit changes to CanHandleClassFilesTest.java as it doesn't apply to
> > JDK 11.
> >
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8215449
> > webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-
> > 8215449/03/webrev/
> > Original changeset: http://hg.openjdk.java.net/jdk/jdk/rev/9dd0a2fdec24
> >
> > Testing: Relevant tests fail prior with option --illegal-access=deny
> > and pass after.
> >
> > I'll also backport JDK-8210789 and JDK-8208364. JDK-8210789 applies
> > cleanly and fixes T8152616.java failure with --illegal-access=deny.
> > JDK-8208364 is a pre-requisite of this patch. It also applies cleanly.
> >
> > Thoughts?
> >
> > Thanks,
> > Severin
More information about the jdk-updates-dev
mailing list