JDK-8209192 : [AOT] Testcases fails to throw LinkageError
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:10,11,12
Priority:P3
Status:Closed
Resolution:Duplicate
Submitted:2018-08-09
Updated:2019-09-13
Resolved:2018-10-04
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
please check comments section for steps to reproduce.
Comments
Thank you, Ramesh
03-10-2018
Yes, fix for JDK-8206963 helped loadingConstraints00605 test to pass.
[~rgangadhar] How I can verify the fix with all failed tests? Instructions are only for loadingConstraints00605 test.
02-10-2018
I will take this bug to see if JDK-8206963 fix will help.
18-09-2018
For the loading.loadingConstraints00605 test case, First.<clinit> is the trouble AOT method. It needs to create a loader constraint for TheClass in the other (SomeInterface) classloader. Normally this would be done when we resolve the constant pool entry, but AOT inlines the call to SomeInterface.f and never resolves the constant pool entry.
[~kvn][~iveresov] It sounds like the proposed JDK-8206963 solution would solve this by deoptimizing, because we have a dependent method SomeInterface.f in a different classloader.
14-09-2018
This sounds like the same problem described in JDK-8206963.
14-09-2018
RULE "vm/constantpool/loadingConstraints/loadingConstraints001/loadingConstraints00101/loadingConstraints00101" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints002/loadingConstraints00201/loadingConstraints00201" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints003/loadingConstraints00302/loadingConstraints00302" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints003/loadingConstraints00304m1/loadingConstraints00304m1" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints003/loadingConstraints00304m2/loadingConstraints00304m2" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00401m1/loadingConstraints00401m1" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m1/loadingConstraints00404m1" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m2/loadingConstraints00404m2" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m3/loadingConstraints00404m3" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m4/loadingConstraints00404m4" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m5/loadingConstraints00404m5" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints004/loadingConstraints00404m6/loadingConstraints00404m6" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints005/loadingConstraints00501/loadingConstraints00501" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints005/loadingConstraints00502m1/loadingConstraints00502m1" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints005/loadingConstraints00502m2/loadingConstraints00502m2" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints005/loadingConstraints00502m3/loadingConstraints00502m3" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints006/loadingConstraints00603/loadingConstraints00603" any any
RULE "vm/constantpool/loadingConstraints/loadingConstraints006/loadingConstraints00605/loadingConstraints00605" any any
10-08-2018
ILW = Incorrect execution of compiled code (no exception thrown), specialized tests with AOT'ed java.base, don't use AOT = HLM = P3
Steps to reproduce
====================
1. download JDK11 Igor internal build
2. set JAVA_HOME and PATH to point to JDK11 build accordingling
3. create java.base aot library using the following command
jaotc -J-Xmx7g --compile-for-tiered --info --compile-commands base.txt --output solibs/rameshbase.so --module java.base
4. download and extract the attachment linkageerror.zip into the current folder.
5. create AOT Library for testcases using the following command
contents of "compilecommands/vmloading.txt"
======================================
compileOnly loading.*
TERMINAL> jaotc -J-Xmx4g --info -J-cp -Jvmloading --compile-commands compilecommands/vmloading.txt --output solibs/vmloading.so --directory vmloading
6. execute the following commands at the command line.
SCENARIO 1: Without AOTLibrary, Normal Run
============================================
java -cp vmloading loading.loadingConstraints00605
LinkageError thrown as expected: java.lang.LinkageError: loader constraint violation: loader loading.SelectiveLoader @61baa894 (instance of loading.SelectiveLoader, child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) wants to load class loading.TheClass. A different class with the same name was previously loaded by loading.SelectiveLoader @b065c63 (instance of loading.SelectiveLoader, child of loading.SelectiveLoader @61baa894 loading.SelectiveLoader).
ACTUAL OUTPUT: LinkageError thrown
SCENARIO 2: With AOTLibrary for testcases
=========================================
jaotc -J-Xmx4g --info -J-cp -Jvmloading --compile-commands compilecommands/vmloading.txt --output solibs/vmloading.so --directory vmloading
[root@llg00fyn ramesh]# java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAOT -XX:+UseAOTStrictLoading -XX:AOTLibrary="solibs/vmloading.so,solibs/rameshbase.so" -cp vmloading loading.loadingConstraints00605 > linkage_error.txt
attachment contains file "linkage_error.txt"
SCENARIO 3 (WITH AOTLibrary for testclasses + PrintAOT is turned off)
========================================================================
java -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading -XX:AOTLibrary="solibs/vmloading.so,solibs/rameshbase.so" -cp vmloading loading.loadingConstraints00605
LinkageError is not thrown
ACTUAL OUTPUT: LinkageError not thrown
EXPECTED OUTPUT: LinkageError should be thrown