-
Notifications
You must be signed in to change notification settings - Fork 58
8289079: java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1 failed with "RuntimeException: Test failed" #73
Conversation
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
@AlanBateman The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation and fix seem quite reasonable.
Thanks.
@AlanBateman 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:
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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
For the records - the implicit upcall will be kept alive for the duration of the downcall to which it is passed to. In this case, since the downcall forks another thread and then returns (and the call to the stub occurs at some point later in the other thread), it is possible for the implicit session to be reclaimed before the async thread had a chance to execute it. With fully synchronous code this would never be an issue, as the standard safety "keep-alive" provided by the linker would have been enough. |
/integrate |
Going to push as commit 7e13cdb. |
@AlanBateman Pushed as commit 7e13cdb. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is a fix to a recently added test. The test uses pthread_create to create native threads that invoke a Java method via a generated "upcall stub". The upcall stub is created in an implicit memory session but the test doesn't do anything to ensure that the memory session remains open. Testing in higher tiers runs the test with options that sometimes lead to a cleaner closing the memory session before the native threads have terminated. The failure mode is exit code 133 due to a child VM exiting with SIGTRAP. The test needs to be changed to ensure that the memory session is not closed until the threads terminate. To keep it simple, I've changed it to use the global memory session. The alternative is to change it to use a shared session or a reachability fence, coupled with a pthread_join to ensure that all native threads with a reference to stub terminate before the session is closed. The test is intended to exercise concurrent implicit attaching so keeping it as simple as possible seems best.
The test is also changed too use shouldHaveExitValue(0) as the original test discarded the child VM exit code when the test failed.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk19 pull/73/head:pull/73
$ git checkout pull/73
Update a local copy of the PR:
$ git checkout pull/73
$ git pull https://git.openjdk.org/jdk19 pull/73/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 73
View PR using the GUI difftool:
$ git pr show -t 73
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/73.diff