RFR: 8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking [v6]
Coleen Phillimore
coleenp at openjdk.org
Fri Sep 5 19:38: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
If the test becomes problematic because of timing, we could have another change to make it /manual.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26863#issuecomment-3259525975
More information about the hotspot-dev
mailing list