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

8253681: closed java/awt/dnd/MouseEventAfterStartDragTest/MouseEventAfterStartDragTest.html test failed #491

Closed
wants to merge 1 commit into from

Conversation

mrserb
Copy link
Member

@mrserb mrserb commented Oct 3, 2020

The "discardingMouseEvents" flag in the SunDragSourceContextPeer class is used on the different threads without any synchronization.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Windows x64 macOS x64
Build ✔️ (3/3 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ❌ (1/9 failed) ✔️ (9/9 passed)

Failed test task

Issue

  • JDK-8253681: closed java/awt/dnd/MouseEventAfterStartDragTest/MouseEventAfterStartDragTest.html test failed

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/491/head:pull/491
$ git checkout pull/491

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 3, 2020

👋 Welcome back serb! 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 Oct 3, 2020
@openjdk
Copy link

openjdk bot commented Oct 3, 2020

@mrserb The following label will be automatically applied to this pull request:

  • awt

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.

@openjdk openjdk bot added the awt client-libs-dev@openjdk.org label Oct 3, 2020
@mlbridge
Copy link

mlbridge bot commented Oct 3, 2020

Webrevs

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

As far as I can see, the only effect volatile has here is making sure the successive calls to checkEvent eventually get the updated value of discardingMouseEvents. This does not seem to resolve the original race: calls to checkEvent can still see old values of discardingMouseEvents for a while, therefore some events can still leak. Turning the flag volatile makes it less likely, which might drop the error frequency under the testability threshold. Still, it might be good as the stop-gap.

The iron-clad fix would be to synchronously insert something like DiscardMouseEvent on the beginning of event queue, and AcceptMouseEvent at the end of it, and let the EventQueue processor thread manage the flag -- so that EventQueue serializes everything, like it is designed to?

@openjdk
Copy link

openjdk bot commented Oct 7, 2020

@mrserb 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:

8253681: closed java/awt/dnd/MouseEventAfterStartDragTest/MouseEventAfterStartDragTest.html test failed

Reviewed-by: shade

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 38 new commits pushed to the master branch:

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 Oct 7, 2020
@mrserb
Copy link
Member Author

mrserb commented Oct 7, 2020

The iron-clad fix would be to synchronously insert something like DiscardMouseEvent on the beginning of event queue, and AcceptMouseEvent at the end of it, and let the EventQueue processor thread manage the flag -- so that EventQueue serializes everything, like it is designed to?

Unfortunately, it is not possible to store this flag in EventQueue nor EventDispatchThread and maintain it using upcoming events, the JVM may run a few applications in parallel so it may have more than one EventQueue/EventDispatchThread and this code was written to discard all events in all apps while one of them start DnD.

The code could be changed though when the support of multiple EventQueue/EventDispatchThread will be finally dropped.

@shipilev
Copy link
Member

shipilev commented Oct 8, 2020

No problem. I was pointing out the volatile just makes us more lucky, does not fix the whole issue. Of course, it might be better than nothing.

@mrserb
Copy link
Member Author

mrserb commented Oct 8, 2020

/integrate

@openjdk openjdk bot closed this Oct 8, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 8, 2020
@openjdk
Copy link

openjdk bot commented Oct 8, 2020

@mrserb Since your change was applied there have been 66 commits pushed to the master branch:

  • d036dca: 8254103: Shenandoah: Move updating thread roots to concurrent phase
  • 7e82ba1: 8254146: Avoid unnecessary volatile write on new AtomicBoolean(false)
  • 6d13c76: 8253191: C2: Masked byte comparisons with large masks produce wrong result on x86
  • a191c58: 8253404: C2: assert(C->live_nodes() <= C->max_node_limit()) failed: Live Node limit exceeded limit
  • 6bc4931: 8253717: Relocate stack overflow code out of thread.hpp/cpp
  • 782d45b: 8242882: opening jar file with large manifest might throw NegativeArraySizeException
  • f860372: 8253566: clazz.isAssignableFrom will return false for interface implementors
  • 66f27b5: 8254015: copy_to_survivor_space should use in-hand klass for scanning
  • 76a5852: 8253756: C2 CompilerThread0 crash in Node::add_req(Node*)
  • 8f9e479: 8254144: Non-x86 Zero builds fail with return-type warning in os_linux_zero.cpp
  • ... and 56 more: https://git.openjdk.java.net/jdk/compare/d296708ca66ab15e31a05f963a5e162a3e3f07f9...master

Your commit was automatically rebased without conflicts.

Pushed as commit c2a5de6.

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

@mrserb mrserb deleted the JDK-8253681 branch October 8, 2020 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awt client-libs-dev@openjdk.org integrated Pull request has been integrated
2 participants