RFR: 8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking [v6]
David Holmes
dholmes at openjdk.org
Tue Sep 9 06:32:18 UTC 2025
On Fri, 5 Sep 2025 19:15:33 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:
>> There is a race between `JvmtiClassFileReconstituter::copy_bytecodes` and `InstanceKlass::link_class_impl`. `InstanceKlass::link_class_impl` can be rewriting bytecodes. `JvmtiClassFileReconstituter::copy_bytecodes` will not restore them to the original ones because the flag `rewritten` is `false`. This will result in invalid bytecode.
>>
>> This PR adds linking a class before the `copy_bytecodes` method is called.
>> The PR also adds a regression test.
>>
>> Tested fastdebug and release builds: Linux x86_64 and arm64
>> - The reproducer from JDK-8277444 passed.
>> - The regression test passed.
>> - Tier1 - tier3 passed.
>
> Evgeny Astigeevich has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix comments
Nothing further from me. If there are issues with the test we will address them as needed.
Thanks
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26863#pullrequestreview-3199565160
More information about the serviceability-dev
mailing list