jdk17u-dev
jdk17u-dev copied to clipboard
8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking
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
- [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/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