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
Spring app fails on OpenJ9 with a profiler with "java.lang.VerifyError: JVMVRFY012 stack shape inconsistent" #5676
Comments
@ChengJin01 Can you take a look at this? |
Will investigate to see what happened to the app. |
I already reproduced the issue locally on OpenJ9:
and it works fine with OpenJDK:
@AntonKatilin, please help to confirm whether this is the same verification error detected on your side. |
The snaptrace shows it failed at an
Given that the DDR got corrupted when decoding some of the methods (including ) on this class, I need to add debugging information in code to see how it goes. |
I confirm this is exactly the issue we've experienced. |
If it helps, we found that specifying -Xverify:none eliminates the exception, and the application seems to work normally with that option specified. So it may be a too-strict-check issue. |
Specifying -Xverify:none disables the verifier at runtime. So we still need to figure out why it failed in such case. |
Yes, sure. We understand what -Xverify:none does. Just wanted to let you know. |
Looking at the bytecode of the failing method
against the detailed snaptrace on the verifier:
It shows it failed in matchStack() at:
Given that the stackmap of the constructor method was built via |
Specifically, the failure occurred when checking the stack against the exception handler stack as follows:
|
Debugging message in code shows it failed on
According to the logic in setInitializedThisStatus (against the Spec), the However, the debugging message shows there is no such element in the failing stackmap frame for java/lang/RuntimeException (even in the whole stackmap)
Given that the first element in the stackmap frame should contain BCV_SPECIAL_INIT in the case of the <init> method, I need to double-check the code in |
It seems there is no issue with simulateStack / mergeStacks. I need to get back to check where it failed as the existing code there was modified for the flag check specific to the case of invokespecial and exception handlers. |
The check on the
That's explains why the test program above passed on Hotspot as the check gets used since Java 7.
|
The change is to disable the check on the uninitializedThis flag on old version classfiles (< 51) as such check is only applied to classfiles with stackmaps which was introduced since Java 7(class version is 51). Fix: eclipse-openj9#5676 Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
The change is to disable the check on the uninitializedThis flag on old version classfiles (< 51) as such check is only applied to classfiles with stackmaps which was introduced since Java 7(class version is 51). Fix: eclipse-openj9#5676 Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
This issue is coming in openjdk 17- Apr 28, 2022 8:20:51 AM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh |
Hi @gangadharparde, there is no evidence indicating the exception above was the same as the original issue (even though it occurred in the You'd better double-check and open a new issue with the complete error messages plus the steps to reproduce the issue for our investigation. |
According to the error message above:
it looks like there was some module specific access issue from the package FYI: @JasonFengJ9 |
@gangadharparde pls try |
A Spring application fails with "java.lang.VerifyError: JVMVRFY012 stack shape inconsistent" on latest OpenJ9 Java 8 and Java 12 when started with YourKit Java Profiler agent's default instrumentation.
There is no issue with HotSpot in the same configuration, therefore we suppose there might be a JVM bug. Could you please check whether it's a JVM bug or, if the bytecode is indeed invalid, share detail on what's wrong with it.
How to reproduce:
Normally, it should start on OpenJ9 without any issues except for some non critical access warnings on Java 12.
Get the latest YourKit Java Profiler agent by downloading and unpacking https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2019.1-docker.zip . The ZIP contains agents for Linux and Windows. No key is needed.
Start the example with -agentpath: to let it fail on "java.lang.VerifyError: JVMVRFY012 stack shape inconsistent".
The text was updated successfully, but these errors were encountered: