The JDK14 version of StackTraceElement::decode is based on the JDK8 code which contains mixed usages of method->constants() and method->method_holder()->constants() assuming they point to the same thing. In the case of anonymous methods this isn't true. Usually this isn't a problem but if CDS is enabled the version flag of method->method_holder()->constants() is non-zero but version of method->constants() is 0 which causes the code to switch constants pools and it reads garbage. JDK-8140685 refactored this code to remove this logic and the JVMCI version of this code should be converted to use the same scheme.
|