-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8317287: [macos14] InterJVMGetDropSuccessTest.java: Child VM: abnormal termination #16396
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
Conversation
👋 Welcome back songpv-imt! A progress list of the required criteria for merging this PR into |
@songpv-imt 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. |
Webrevs
|
/reviewer credit @shurymury |
@songpv-imt |
a96950a
to
bb51b8f
Compare
@songpv-imt Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
bb51b8f
to
59cea9f
Compare
@songpv-imt Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Based on description in Chapter "17.4 Memory Model", and specifically chapter "17.4.5 Happens-before Order" of the "The Java® Language Specification", DragSourceDropListener.finished field is accessed from two threads without proper synchronization which may also be possible causing the test to fail. Hence, putting code accessing to DragSourceDropListener.finished into a proper synchronization code block.
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.
Subsequent to submitting a job to verifying this, I've no objection to stability fixes but from what I saw on macOS 14.0 this failed because of some macOS 14 event delivery changes which have been resolved in macOS 14.1
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
Change BUTTON1_MASK to BUTTON1_DOWN_MASK because BUTTON1_MASK is deprecated: https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/event/InputEvent.html#BUTTON1_MASK
Thank you for pointing out the BUTTON1_DOWN_MASK field. I have made the suggested changes. Regarding the issue described in the bug, based on my tests, without the code fix, it actually happens on both macOS 14 and 14.1. |
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Show resolved
Hide resolved
Instead of using SYNC_LOCK to synchronize accessing the listener's fields, for better code transparency, we have placed the code that accesses the listener's fields from the main thread into the AWT Event Queue.
Hmm... Are you suggesting instead of using SYNC_LOCK, for better code transparency, we should place the code that accesses the listener's fields from the main thread into AWT Event Queue with EventQueue.invokeAndWait? Can you please check if the update code meets your suggestion? Thanks. |
Yes. Half of the access to the state of the listener is already on the even queue. It would be pretty transparent to make the other part of the access to go through the queue. |
@shurymury The last code commit has implemented the changes based on your suggestion. Can you please advise what other step I should take to complete this bug ? Thanks. |
Why this issue can be reproduced in macOS 14? What was changed in that version? |
I am uncertain about the exact code modifications in MacOS 14 that make this issue reproducible. Nevertheless, considering the underlying code logic, this issue could occur on any version of MacOS, contingent on timing factors, if the fix is not applied. |
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
- Replace Thread.sleep by robot.delay - Fix the code's formatting
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.
Both the original test and updated test in this PR pass on the latest macOS version 14.2. Since this is a test stabilization fix I would like to suggest a change to JBS title to reflect it since the current one might be misleading.
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
- Update success1 and success2 to volatile
@songpv-imt any plans to resume your work on this fix? |
@victordyakov, hmm... I think I have addressed all comments from the reviewers. Any other action I need to follow up? Thank. |
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
@songpv-imt 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 846 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prrace, @honkar-jdk, @aivanov-jdk) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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.
Ran the updated test on macOS 13 and 14.2, it works well with the stabilization fix done for macOS 14.1. Changes look good.
I ran a job with 50 repeats of the test in our CI, the test passes. I've submitted a new job, just in a case, with the most recent changes. |
- Fix whitespace errors
/integrate |
@songpv-imt |
test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
Outdated
Show resolved
Hide resolved
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.
Thank you for updating it.
/integrate |
@songpv-imt |
/sponsor |
Going to push as commit cbfddf4.
Your commit was automatically rebased without conflicts. |
@aivanov-jdk @songpv-imt Pushed as commit cbfddf4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The root cause of the bug is because mousePress() method is invoked before mouseMove() event is completely processed causing the drag & drop behavior not being able to be recognized properly. This in turn makes the method dragSourceListener.isDropFinished() returns false and fail the test. To fix this, setAutoWaitForIdle(true) and Thread.Sleep is called to make sure the mouseMove() event is processed completely before moving to execute the mousePress() method.
JBS issue: JDK-8317287
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16396/head:pull/16396
$ git checkout pull/16396
Update a local copy of the PR:
$ git checkout pull/16396
$ git pull https://git.openjdk.org/jdk.git pull/16396/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16396
View PR using the GUI difftool:
$ git pr show -t 16396
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16396.diff
Webrev
Link to Webrev Comment