-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JEP 389: Foreign Linker API (Incubator) #11195
Comments
Will most likely be targeted for JDK16 as an incubator release |
It's proposed to jdk16 now. |
As per #11027 (comment), following are JEP389 tests:
|
From an internal build
These tests have been excluded via adoptium/aqa-tests#2088 |
Below is the updated list of JEP389 test failures after ibmruntimes/openj9-openjdk-jdk16#9 is merged for the 0.25 release:
|
Hi @dnakamura, I notice these
I am wondering what scripts/setting we should add/update on OpenJDK/OpenJ9 side to generate these libraries (at least via CMake) to get these test suites working as expected. |
We put OpenJDK test libraries into the test-images artifact. Did you make these libraries available when running tests? |
If you are doing your own build, look in the build//images/test directory. If it's not there, try running |
I see OpenJDK nightly testing using an argument like |
I tried to export the option to OpenJ9 but ended up with failure due to the unrecognised option when compiling one of these tests.
|
It's not a VM option, it's a test option. Here is the entire command line used by the nightly build.
|
I assume you are running via TKG. There is probably some doc somewhere about where to put the test image, and TKG will just find and use it. Try extracting the tar file so it's at the same level as the JVM, and rename test-images to openjdk-test-image
|
Or try running the test via a grinder, does it have the same problem? If not, then look at what the grinder did. |
There are two issues with the missing libraries when manually running the jtreg tests via TKG with
The other one is failure to locate the library in test code. e.g.
against the Spec at https://download.java.net/java/early_access/jdk16/docs/api/jdk.incubator.foreign/jdk/incubator/foreign/LibraryLookup.html#ofLibrary(java.lang.String)
Probably need to add settings to ensure they are reachable in the test code (e.g. setting up |
Did you try the grinder? If the grinder doesn't work then perhaps the foreign tests aren't setup correctly to use the native test libraries. Both those libraries are in the test image. |
I do see Likely you aren't setting up the environment correctly. |
Look at your TKG output for a |
Figured it out, you need to export |
Initial investigation: Lambda bytecode generation: https://github.com/ibmruntimes/openj9-openjdk-jdk16/blob/openj9/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java Java property flag to dump Lambda bytecodes:
|
The foundational reason to exclude If we choose to include |
I think
|
|
@ChengJin01 I was going through your spec references, and I didn't see an explicit note that
|
@babsingh, the links above are outdated.
If you look at all jtreg tests specific to
which is explained at http://cr.openjdk.java.net/~mcimadamore/8254231_v3/javadoc/jdk/incubator/foreign/LibraryLookup.html
The symbol is the key to CLinker.downcallHandle() to keep the strong reference to the native library to |
The old and new links have identical content. I still feel the same. @tajila Can you provide a second opinion? I don't think having a strong reference is a requirement for If As per http://cr.openjdk.java.net/~mcimadamore/8254231_v3/javadoc/jdk/incubator/foreign/LibraryLookup.html, you can also have a standalone
|
This doesn't work (already tried before) especially on Windows and randomly crashed on Linux (at very low frequency) due to the invalid address (the library was already unloaded and there is no way to validate the address until the native function is called and no way stop them during the call).
The prerequisite for this is that you have to know the |
As I mentioned above, simply passing a memory address of the native function over to |
I just checked a simple test on both Windows & Linux with my latest updated code (simply keeps holding the passed-in addressable parameter in addition to getting the raw long value of the corresponding function address and nothing else changed in there)
and it is quit interesting that the problem with
or the memory address of the symbol is passed to the
Both of tests above work well whether the passed-in addressable parameter is a memory address or not. Will add tests with MemoryAddress as parameters to our own test suites and keep an eye on this issue in case it reoccurred in the future. |
Closing as it's for jdk16. |
https://openjdk.java.net/jeps/389
Issues
Add NativeMethodHandle stubs - #11255
Add LibraryLookup native - #11260
The text was updated successfully, but these errors were encountered: