Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8290482: Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications #10352

Closed
wants to merge 9 commits into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Sep 20, 2022

This update is primarily about changes to the JNI Invocation API specification, mainly in relation to DestroyJavaVM. The motivation for the changes is to align with changes being made to the JLS, JVMS and java.lang.Runtime, specifications in relation to VM termination - ref:

JDK-8290196 12.8: Clarify the definition of program exit
https://bugs.openjdk.org/browse/JDK-8290196

JDK-8290388 5.7: Clarify the definition of JVM termination
https://bugs.openjdk.org/browse/JDK-8290388

JDK-8290036 Define and specify Runtime shutdown sequence
https://bugs.openjdk.org/browse/JDK-8290036

Mostly these are just non-normative changes to the JNI spec prose but there are two actual specification changes:

  1. The fact it is an error to detach a thread with active Java frames was only mentioned in the overview section, not in the actual DetachCurrentThread specification. (Just an oversight - the VM already checked this)

  2. We need to make it an error to call DestroyJavaVM from an attached thread with active Java frames (as this can't work for the same reason we disallow DetachCurrentThread). This requires an implementation change in Hotspot.

Issue 2 covers the code change, and regression test, in this PR.

In addition the specification changes can be seen here:

The specification itself is not open but comments on the spec changes are welcome - though please see the JBS issue and CSR request first. The revised wording has already been extensively reviewed/negotiated between Alex Buckley, Stuart Marks and myself, so any change must either be a glaring error/problem or else a trivial adjustment.

Thank you.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires a CSR request to be approved

Issues

  • JDK-8290482: Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications
  • JDK-8292897: Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10352/head:pull/10352
$ git checkout pull/10352

Update a local copy of the PR:
$ git checkout pull/10352
$ git pull https://git.openjdk.org/jdk pull/10352/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10352

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10352.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 20, 2022

👋 Welcome back dholmes! 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 openjdk bot added the rfr Pull request is ready for review label Sep 20, 2022
@openjdk
Copy link

openjdk bot commented Sep 20, 2022

@dholmes-ora The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org csr Pull request needs approved CSR before integration labels Sep 20, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 20, 2022

Webrevs

@dholmes-ora
Copy link
Member Author

/label add hotspot-runtime

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Sep 21, 2022
@openjdk
Copy link

openjdk bot commented Sep 21, 2022

@dholmes-ora
The hotspot-runtime label was successfully added.

Copy link
Contributor

@robehn robehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@dholmes-ora
Copy link
Member Author

Thanks @robehn !

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good. I looked at the specification changes and they looked okay also.

@dholmes-ora
Copy link
Member Author

Thanks @coleenp !

@dholmes-ora
Copy link
Member Author

CSR is now approved.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Sep 27, 2022
@openjdk
Copy link

openjdk bot commented Sep 27, 2022

@dholmes-ora This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8290482: Update JNI Specification of DestroyJavaVM for better alignment with JLS, JVMS, and Java SE API Specifications

Reviewed-by: rehn, coleenp

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 103 new commits pushed to the master branch:

  • f8d9fa8: 8294483: Remove vmTestbase/nsk/jvmti/GetThreadState tests.
  • 6ad151d: 8293143: Workaround for JDK-8292217 when doing "step over" of bytecode with unresolved cp reference
  • 22b59b6: 8294471: SpecTaglet is inconsistent with SpecTree for inline property
  • 763d4bf: 8293592: Remove JVM_StopThread, stillborn, and related cleanup
  • 739fdec: 8289162: runtime/NMT/ThreadedMallocTestType.java should print out memory allocations to help debug
  • a11477c: 8289797: tools/launcher/I18NArgTest.java fails on Japanese Windows environment
  • 7151128: 8294317: Insufficient build rules for tzdb.dat
  • fb4979c: 8290401: Support dump all phases and print nodes in ascending order of index
  • 112ca2b: 8293964: Unused check_for_duplicates parameter in ClassLoaderExt::process_jar_manifest
  • 99017b0: 8293064: Remove unused NET_xxx functions
  • ... and 93 more: https://git.openjdk.org/jdk/compare/4020ed53dd6e45cafa1d86432274700f0d4a67ca...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 27, 2022
@dholmes-ora
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 27, 2022

Going to push as commit e5b65c4.
Since your change was applied there have been 103 commits pushed to the master branch:

  • f8d9fa8: 8294483: Remove vmTestbase/nsk/jvmti/GetThreadState tests.
  • 6ad151d: 8293143: Workaround for JDK-8292217 when doing "step over" of bytecode with unresolved cp reference
  • 22b59b6: 8294471: SpecTaglet is inconsistent with SpecTree for inline property
  • 763d4bf: 8293592: Remove JVM_StopThread, stillborn, and related cleanup
  • 739fdec: 8289162: runtime/NMT/ThreadedMallocTestType.java should print out memory allocations to help debug
  • a11477c: 8289797: tools/launcher/I18NArgTest.java fails on Japanese Windows environment
  • 7151128: 8294317: Insufficient build rules for tzdb.dat
  • fb4979c: 8290401: Support dump all phases and print nodes in ascending order of index
  • 112ca2b: 8293964: Unused check_for_duplicates parameter in ClassLoaderExt::process_jar_manifest
  • 99017b0: 8293064: Remove unused NET_xxx functions
  • ... and 93 more: https://git.openjdk.org/jdk/compare/4020ed53dd6e45cafa1d86432274700f0d4a67ca...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 27, 2022
@openjdk openjdk bot closed this Sep 27, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 27, 2022
@openjdk
Copy link

openjdk bot commented Sep 27, 2022

@dholmes-ora Pushed as commit e5b65c4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@dholmes-ora dholmes-ora deleted the 8290482-destroyjvm branch September 27, 2022 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants