jdk11u-dev icon indicating copy to clipboard operation
jdk11u-dev copied to clipboard

8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking

Open chadrako opened this issue 2 months ago • 8 comments
trafficstars

Backport of https://bugs.openjdk.org/browse/JDK-8277444. The backport was not clean but the fixes were trivial naming differences

This fixes a race condition that occurs when a class is simultaneously retransformed via the Instrumentation API and linked. This can lead to invalid bytecode which will cause a VerifyError. Even worse, if class verifying is turned off, which it is by default for java.* classes, this will cause the JVM to crash/segfault.

The included test test/jdk/java/lang/instrument/RetransformBigClassTest.java fails before the patch and passes after


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [ ] JDK-8277444 needs maintainer approval
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3096/head:pull/3096
$ git checkout pull/3096

Update a local copy of the PR:
$ git checkout pull/3096
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3096/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3096

View PR using the GUI difftool:
$ git pr show -t 3096

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3096.diff

Using Webrev

Link to Webrev Comment

chadrako avatar Sep 18 '25 22:09 chadrako

Waiting to request maintainer approval until backport is merged in newer JDKs

chadrako avatar Sep 18 '25 22:09 chadrako

:wave: Welcome back chadrako! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Sep 18 '25 22:09 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Sep 18 '25 22:09 openjdk[bot]

This backport pull request has now been updated with issue from the original commit.

openjdk[bot] avatar Sep 18 '25 22:09 openjdk[bot]

Webrevs

mlbridge[bot] avatar Sep 18 '25 22:09 mlbridge[bot]

@chadrako This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Oct 17 '25 03:10 bridgekeeper[bot]

/keepalive

chadrako avatar Oct 20 '25 22:10 chadrako

@chadrako The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar Oct 20 '25 22:10 openjdk[bot]

@chadrako This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Nov 18 '25 08:11 bridgekeeper[bot]