Skip to content

Conversation

chadrako
Copy link
Contributor

@chadrako chadrako commented Sep 18, 2025

Backport of https://bugs.openjdk.org/browse/JDK-8277444. Trivial conflict (NULL vs nullptr)

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

  • JDK-8277444 needs maintainer approval
  • Change must not contain extraneous whitespace
  • 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/jdk17u-dev.git pull/3955/head:pull/3955
$ git checkout pull/3955

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3955

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@chadrako
Copy link
Contributor Author

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 2025

👋 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.

@openjdk
Copy link

openjdk bot commented Sep 18, 2025

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

@openjdk openjdk bot changed the title Backport 46ae1ee87152742082e6047d0556944d7ae4567d 8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking Sep 18, 2025
@openjdk
Copy link

openjdk bot commented Sep 18, 2025

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

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Sep 18, 2025
@openjdk
Copy link

openjdk bot commented Sep 18, 2025

⚠️ @chadrako This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 18, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 18, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant