jtreg issue

David Holmes david.holmes at oracle.com
Thu Mar 12 07:03:27 UTC 2020


On 12/03/2020 4:28 pm, Prasanta Sadhukhan wrote:
> I am able to test with jdk10 by commenting the requirement part in 
> test/jdk/TEST.ROOT
> #requires.extraPropDefns = 
> ../../../open/test/jtreg-ext/requires/VMProps.java

Yes but note that means you disabled @requires checking so you may get 
errors due to an unknown @requires or, if it just ignores that, you may 
run under under the wrong environment and have problems that way.

> but when I try to test with jdk9 or jdk8 I am getting this
> 
> java.lang.UnsupportedClassVersionError: bug5062649 : Unsupported 
> major.minor version 54.0

That is the classfile version for JDK 10. You need to delete everything 
between tests so that the test is compiled afresh with jdk8 and then jdk9.

David
-----

> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at java.net.URLClassLoader.defineClass(URLClassLoader.
> 
> Any suggestions?
> 
> Regards
> Prasanta
>> On 12-Mar-2020, at 11:36 AM, David Holmes <david.holmes at oracle.com 
>> <mailto:david.holmes at oracle.com>> wrote:
>>
>> On 12/03/2020 3:45 pm, Prasanta Sadhukhan wrote:
>>> Hi David,
>>> I tried removing JTwork but still getting issue
>>> ./bin/jtreg -jdk:/Users/PRSADHUK/Downloads/jdk-10.jdk/Contents/Home/ 
>>> /export/jdk/client/closed/test/jdk/javax/swing/JEditorPane/5062649/bug5062649.java
>>> Directory "JTwork" not found: creating
>>> Directory "JTreport" not found: creating
>>> failed to get value for vm.jvmci
>>> java.lang.UnsatisfiedLinkError: sun.hotspot.WhiteBox.isGCSelected(I)Z
>>
>> Ah yes. VMProps relies on the WhiteBox API built into the JVM. You 
>> cannot run on an earlier JDK in that case. You would have to modify 
>> VMProps.java locally to check for the UnsatisfiedLinkErrors and then 
>> decide whether to return true or false for the various hasXXX methods 
>> based on the JDK you are using to execute the tests.
>>
>> David
>>
>>> at sun.hotspot.WhiteBox.isGCSelected(Native Method)
>>> at sun.hotspot.gc.GC.isSelected(GC.java:62)
>>> at sun.hotspot.gc.GC.selected(GC.java:78)
>>> at requires.VMProps.vmJvmci(VMProps.java:242)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.call(VMProps.java:94)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.hasJFR
>>> java.lang.UnsatisfiedLinkError: 
>>> sun.hotspot.WhiteBox.isJFRIncludedInVmBuild()Z
>>> at sun.hotspot.WhiteBox.isJFRIncludedInVmBuild(Native Method)
>>> at requires.VMProps.vmHasJFR(VMProps.java:339)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.call(VMProps.java:104)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.aot
>>> java.lang.UnsatisfiedLinkError: sun.hotspot.WhiteBox.isGCSelected(I)Z
>>> at sun.hotspot.WhiteBox.isGCSelected(Native Method)
>>> at sun.hotspot.gc.GC.isSelected(GC.java:62)
>>> at sun.hotspot.gc.GC.selected(GC.java:78)
>>> at requires.VMProps.vmAOT(VMProps.java:381)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.call(VMProps.java:108)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.aot.enabled
>>> java.lang.UnsatisfiedLinkError: sun.hotspot.WhiteBox.aotLibrariesCount()I
>>> at sun.hotspot.WhiteBox.aotLibrariesCount(Native Method)
>>> at requires.VMProps.vmAotEnabled(VMProps.java:399)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.call(VMProps.java:109)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.cds.archived.java.heap
>>> java.lang.UnsatisfiedLinkError: 
>>> sun.hotspot.WhiteBox.isJavaHeapArchiveSupported()Z
>>> at sun.hotspot.WhiteBox.isJavaHeapArchiveSupported(Native Method)
>>> at requires.VMProps.vmCDSForArchivedJavaHeap(VMProps.java:426)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.call(VMProps.java:113)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.gc.Serial
>>> java.lang.UnsatisfiedLinkError: sun.hotspot.WhiteBox.isGCSupported(I)Z
>>> at sun.hotspot.WhiteBox.isGCSupported(Native Method)
>>> at sun.hotspot.gc.GC.isSupported(GC.java:55)
>>> at requires.VMProps.lambda$vmGC$0(VMProps.java:285)
>>> at requires.VMProps$SafeMap.put(VMProps.java:69)
>>> at requires.VMProps.vmGC(VMProps.java:284)
>>> at requires.VMProps.call(VMProps.java:121)
>>> at requires.VMProps.call(VMProps.java:57)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.run(GetJDKProperties.java:80)
>>> at 
>>> com.sun.javatest.regtest.agent.GetJDKProperties.main(GetJDKProperties.java:54)
>>> failed to get value for vm.gc.Parallel
>>> java.lang.UnsatisfiedLinkError: sun.hotspot.WhiteBox.isGCSupported(I)Z
>>> at sun.hotspot.WhiteBox.isGCSupported(Native Method)
>>> ……
>>> Regards
>>> Prasanta
>>>> On 12-Mar-2020, at 5:06 AM, David Holmes <david.holmes at oracle.com 
>>>> <mailto:david.holmes at oracle.com><mailto:david.holmes at oracle.com>> wrote:
>>>>
>>>> Hi Prasanta,
>>>>
>>>> On 11/03/2020 6:22 pm, Prasanta Sadhukhan wrote:
>>>>> Hi,
>>>>> I intend to test a jtreg test with jdk10 and below with jtreg5.0. 
>>>>> This are the steps I did
>>>>> ./bin/jtreg -version
>>>>> jtreg, version 5.0 dev 762
>>>>> export JT_JAVA=/Users/PRSADHUK/Downloads/jdk-15.jdk/Contents/Home/
>>>>> PRSADHUK-Mac:jtreg PRSADHUK$ ./bin/jtreg 
>>>>> -jdk:/Users/PRSADHUK/Downloads/jdk-10.jdk/Contents/Home/ 
>>>>> /export/jdk/client/closed/test/jdk/javax/swing/JEditorPane/5062649/bug5062649.java
>>>>> Exception while calling user-specified class: requires.VMProps
>>>>> java.lang.UnsupportedClassVersionError: requires/VMProps has been 
>>>>> compiled by a more recent version of the Java Runtime (class file 
>>>>> version 59.0), this version of the Java Runtime only recognizes 
>>>>> class file versions up to 54.0
>>>>> at java.base/java.lang.ClassLoader.defineClass1(Native Method)
>>>>> I am sure this is very known issue. Can someone guide me as to what 
>>>>> needs to be done to test with older jdk?
>>>>> BTW, the repo is latesthg.openjdk.java.net/jdk/client 
>>>>> <http://hg.openjdk.java.net/jdk/client><http://hg.openjdk.java.net/jdk/client> 
>>>>> <http://hg.openjdk.java.net/jdk/client>
>>>>
>>>> It looks like your JDK 10 run is finding a pre-existing:
>>>>
>>>> ./JTwork/extraPropDefns/classes/requires/VMProps.class
>>>>
>>>> which was compiled by a later JDK. Try deleting that class file. Or 
>>>> better still use a different JTwork directory.
>>>>
>>>> David
>>>>
>>>>> Regards
>>>>> Prasanta
> 


More information about the jtreg-use mailing list