RFR: 8228604: StackMapFrames are missing from redefined class bytes of retransformed classes
Alex Menkov
amenkov at openjdk.org
Wed Jan 25 04:17:04 UTC 2023
On Tue, 24 Jan 2023 00:16:10 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
> classFileParser drops stack map frames for JDK classes (when verification is not required).
> As a result JvmtiClassFileReconstituter cannot restore the attribute for class redefinition.
> Note that if the class is in CDS archive, the frames are restored from CDS, so this issue affects only JDK classes which are not in CDS.
> This code is old (from "initial load") and I don't understand the reason it was implemented this way.
>
> Testing: tier1-tier6
we have 3 test classes:
java.util.Date (JDK class in CDS archive)
java.lang.ProcessBuilder (JDK class, but not in CDS archive)
MissedStackMapFrames - application class
I'd expect that at least java.util.Date and java.lang.ProcessBuilder have the same verification requirement.
But in Date has StackMapTable (starting from JDK12-b15), and ProcessBuilder doesn't has StackMapTable.
AFAIU this is caused by the deleted condition in parse_stackmap_table:
`if (!need_verify && !DumpSharedSpaces) {
return NULL;
}`
For Date classes the attribute is not dropped during CDS dump and is stored in CDS. Later during test execution the class is loaded from CDS as is (with the attribute).
-------------
PR: https://git.openjdk.org/jdk/pull/12155
More information about the serviceability-dev
mailing list