RFR: 8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking [v6]

Evgeny Astigeevich eastigeevich at openjdk.org
Fri Sep 5 19:15:33 UTC 2025


> 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

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26863/files
  - new: https://git.openjdk.org/jdk/pull/26863/files/05207c6c..f442736a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26863&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26863&range=04-05

  Stats: 7 lines in 2 files changed: 1 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/26863.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26863/head:pull/26863

PR: https://git.openjdk.org/jdk/pull/26863


More information about the hotspot-dev mailing list