RFR: 8269091: javax/sound/sampled/Clip/SetPositionHang.java failed with ArrayIndexOutOfBoundsException: Array index out of range: -4 [v2]

Phil Race prr at openjdk.java.net
Fri Feb 11 23:28:43 UTC 2022


> 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. 
> 
>                     if (newFramePosition >= 0) { 
>                         clipBytePosition = newFramePosition * frameSize; 
>                         newFramePosition = -1; 
>                     } 
> 
> 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.

Phil Race has updated the pull request incrementally with one additional commit since the last revision:

  8269091: javax/sound/sampled/Clip/SetPositionHang.java failed with ArrayIndexOutOfBoundsException: Array index out of range: -4

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7436/files
  - new: https://git.openjdk.java.net/jdk/pull/7436/files/141be4e7..3700e1db

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7436&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7436&range=00-01

  Stats: 5 lines in 1 file changed: 0 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7436.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7436/head:pull/7436

PR: https://git.openjdk.java.net/jdk/pull/7436



More information about the client-libs-dev mailing list