-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8269091: javax/sound/sampled/Clip/SetPositionHang.java failed with ArrayIndexOutOfBoundsException: Array index out of range: -4 #7436
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
…rayIndexOutOfBoundsException: Array index out of range: -4
|
👋 Welcome back prr! A progress list of the required criteria for merging this PR into |
Webrevs
|
| if (newFramePosition >= 0) { | ||
| clipBytePosition = newFramePosition * frameSize; | ||
| newFramePosition = -1; | ||
| synchronized (this) { |
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.
Maybe instead of synchronization we can read it to the local variable,then use, then reset to -1? This class already has many different locks used for synchronization and this one add another one for "this".
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.
I suppose both should avoid this specific problem. But yes, there's a lot of synchronization in this class.
FIx updated.
…rayIndexOutOfBoundsException: Array index out of range: -4
|
@prrace 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 48 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. ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit 1a7b70a.
Your commit was automatically rebased without conflicts. |
This test has started failing since we got M1 macs to test on. I don't think we've ever seen this failure elsewhere.
I don't know what it is about that architecture that makes it more likely but I can see how it can happen when multiple threads are using the same instance.
newFramePosition is declared volatile which does make it quite possible that after the read and before the use it will have changed.
The fix just synchronizes this block to prevent it.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7436/head:pull/7436$ git checkout pull/7436Update a local copy of the PR:
$ git checkout pull/7436$ git pull https://git.openjdk.java.net/jdk pull/7436/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7436View PR using the GUI difftool:
$ git pr show -t 7436Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7436.diff