eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

IllegalAccessException: Caller-sensitive method cannot be looked up using a restricted lookup object #11433

Open gatoborrachon opened 3 years ago

gatoborrachon commented 3 years ago

Java -version output

openjdk version "1.8.0_282-internal" OpenJDK Runtime Environment (build 1.8.0_282-internal-202012091711-b04) Eclipse OpenJ9 VM (build master-b5733bb66, JRE 1.8.0 Windows 8.1 amd64-64-Bit Compressed References 20201209_934 (JIT enabled, AOT enabled) OpenJ9 - b5733bb66 OMR - da9530688 JCL - 06559695 based on jdk8u282-b04)

Summary of problem

maybe this is a duplicated of #7741, but i have more information that may help.

There's a crash when placing a block from the 0.0.5 version of this Minecraft Mod: https://github.com/CD4017BE/ThermokineticEngineering/packages/481819 (Required Dependency: CD4017BE_lib 6.6.0: https://github.com/CD4017BE/CD4017BE_lib/packages/71046).

it is not present when using the 0.0.4 version of it (with CD4017BE_lib 6.6.0), so maybe in one of the commits between 0.0.4 and 0.0.5 there's the source of the issue.

@tajila hello again, i remember that you commented in #11271 that there was a difference in the crash report if i use Xshare:off, well, the same is happening in this case, i think there is a (hard to fix) reason why this issue (#7741) is still open, if that's the case let me know and i will close this issue.

also, sorry for bothering with these issues related to a game, i should not being using a business software to play (i only do it because of the performance improvement), i think this issue is pretty hard to fix so no worries, i don't wan't to be a nuisance more time, i'm so grateful with you and the others who helped me with that issue

Diagnostic files

Crash Report without -Xshare:off https://pastebin.com/46WXWnEJ

Crash Report using -Xshare:off https://pastebin.com/SRvhQjYj

gatoborrachon commented 3 years ago

The developer of the mod told me that the issue is from this line: https://github.com/CD4017BE/CD4017BE_lib/blob/161dd614d267befd9f009d93f01febf15983847d/src/java/cd4017be/lib/network/Synchronizer.java#L386

Basically MethodHandles.asInterfaceInstance() is the thing that doesn't work.

pshipton commented 3 years ago

@tajila fyi

gatoborrachon commented 3 years ago

well, i want to say that this would be for Java 8, or that does not matter? (the labeled version)

gatoborrachon commented 3 years ago

mmm, sorry for being impatient, but are there any news about this? or there still not enough info to fix this specific error?

tajila commented 3 years ago

@gatoborrachon The holiday season as slowed our progress, hopefully we can get to this by the end o the month.

gatoborrachon commented 3 years ago

Yeah no problem, take the necessary time, for the following months there's no hurry

tajila commented 3 years ago

The issue going on here is that we do not support MethodHandleImpl.bindCaller(MethodHandle mh, Class<?> hostClass) which is needed when creating method handle proxies (ie. MethodHandleProxies.asInterfaceInstance) with a security manager enabled.

Fixing this now would require changes to the extensions repo, these changes will have to be reverted as soon as the ojdk_mh work is complete. Given that we anticipate completion for the 0.26 release, I will hold off on this for the time being.

tajila commented 3 years ago

@babsingh FYI

gatoborrachon commented 3 years ago

sorry, i forgot to say: don't worry about the issue mentioned above (with Growthcraft), not even the author knows what is happening (nor will fix it by his side)

babsingh commented 3 years ago

@gatoborrachon Can you confirm if the below JDK8 resolves the above IllegalAccessException?

OpenJ9 JDK8 Linux-x64 Nightly (15 Mar 21): https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2021-03-15-20-08/OpenJDK8U-jdk_x64_linux_openj9_2021-03-15-20-08.tar.gz

babsingh commented 3 years ago

Please ignore the above comment: https://github.com/eclipse/openj9/issues/11433#issuecomment-800642453. I got a false positive during test verification: https://github.com/eclipse/openj9/issues/7741#issuecomment-801123148.

gatoborrachon commented 3 years ago

no problem, i tried anyways and it crashed with the same issue.

pshipton commented 2 years ago

I assume this is resolved in jdk17+ builds since they use the OpenJDK MethodHandle implementation. This may eventually be backported to jdk11 and jdk8.

tajila commented 2 years ago

Yes, this should be resolved as soon as we backport ojdk_mh

gatoborrachon commented 2 years ago

many thanks, i will let you know if it works fine as soon as possible

babsingh commented 2 years ago

@gatoborrachon you will need JDK17+ to test. will Minecraft Mod work with JDK17+?

gatoborrachon commented 2 years ago

oh, Minecraft 1.12 only works with JDK8, but no problem, i can wait

SilearFlare commented 9 months ago

Sorry to necrobump the thread, but after running into the same issue, and by using an experimental minecraft mod (https://github.com/GTNewHorizons/lwjgl3ify/releases) that lets you use java 17 to run this particular instance, I can confirm that the JDK17+ does actually function with this minecraft mod and does specifically fix the issue that @gatoborrachon had, where openj9 would crash whenever the Growthcraft cheese vat would be placed. The only issue is that the mod itself I am using to is highly experimental, and ends up causing more crashes due to other unrelated issues :sweat_smile:, but I can at least confirm Babsingh's question.