Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-15 Thread Nikita Sakharin
> `Collections.rotate` method contains a bug. This method throws > IndexOutOfBoundsException on arrays larger than $2^{30}$ elements. The way to > reproduce: > > final int size = (1 << 30) + 1; > final List list = new ArrayList<>(size); > for (int i = 0; i < size; ++i) > list.add((byte) 0);

Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-15 Thread Aleksey Shipilev
On Tue, 15 Aug 2023 09:45:43 GMT, Nikita Sakharin wrote: >> `Collections.rotate` method contains a bug. This method throws >> IndexOutOfBoundsException on arrays larger than $2^{30}$ elements. The way >> to reproduce: >> >> final int size = (1 << 30) + 1; >> final List list = new ArrayList<>(s

Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-16 Thread Stuart Marks
On Tue, 15 Aug 2023 09:51:40 GMT, Aleksey Shipilev wrote: >> Nikita Sakharin has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8314236: change bug number and summary > > test/jdk/java/util/Collections/RotateHuge.java line 27: > >> 25: *

Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-17 Thread Aleksey Shipilev
On Wed, 16 Aug 2023 21:38:09 GMT, Stuart Marks wrote: >> test/jdk/java/util/Collections/RotateHuge.java line 27: >> >>> 25: * @test >>> 26: * @bug 8314236 >>> 27: * @summary Overflow in Collections.rotate >> >> Since this test takes >4G of heap to hold the list with compressed oops, and >>

Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-18 Thread Nikita Sakharin
On Tue, 15 Aug 2023 09:54:48 GMT, Aleksey Shipilev wrote: >> Nikita Sakharin has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8314236: change bug number and summary > > src/java.base/share/classes/java/util/Collections.java line 810: > >

Re: RFR: 8314236: Overflow in Collections.rotate [v2]

2023-08-18 Thread Nikita Sakharin
On Wed, 16 Aug 2023 21:38:09 GMT, Stuart Marks wrote: >> Thanks! Done > > @nikita-sakharin > > Thanks for finding this bug and offering to fix it! (And @shipilev thanks for > your assistance on this.) > > Putting the test into a separate JVM will work, but I don't think it's > necessary to ac