8283784: java_lang_String::as_platform_dependent_str stores to oop in native state
Hi all,
This pull request contains a backport of commit c9a469a from the openjdk/jdk repository.
The commit being backported was authored by David Holmes on Mar 30 2022 and was reviewed by Kim Barrett, Aleksey Shipilev, and Stefan Karlsson.
Thanks!
Progress
- [x] Change must not contain extraneous whitespace
- [ ] JDK-8283784 needs maintainer approval
- [x] Commit message must refer to an issue
Issue
- JDK-8283784: java_lang_String::as_platform_dependent_str stores to oop in native state (Bug - P4)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3988/head:pull/3988
$ git checkout pull/3988
Update a local copy of the PR:
$ git checkout pull/3988
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3988/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3988
View PR using the GUI difftool:
$ git pr show -t 3988
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3988.diff
Hi @jyma22, welcome to this OpenJDK project and thanks for contributing!
We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.
If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user jyma22" as summary for the issue.
If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
⚠️ @jyma22 This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).
/signed
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!
This backport pull request has now been updated with issue from the original commit.
/approval request adjusts the block scope so that JNIHandles::destroy_local is called once we are back in VM, and so no longer safepoint-safe
@jyma22 8283784: The approval request has been created successfully.
HI @jyma22 please read https://wiki.openjdk.org/display/JDKUpdates/How+to+contribute+or+backport+a+fix and give a fix request comment with the required information.
⚠️ @jyma22 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.
Fix Request 17u
Backprting this patch eliminates the critical JNIHandles safepoint safety issue. The change adjusts block scope to ensure JNIHandles::destroy_local is called when back in VM state, which is a targeted fix that doesn't affect core functionality. Path applies cleanly to 17u. Included test passes. Ran tier1-3 as sanity check with no regressions observed.