RFR: Fix negative index OOB exception in string dedup stress test

Zhengyu Gu zgu at redhat.com
Thu Oct 18 12:51:45 UTC 2018


On 10/18/2018 02:52 AM, Aleksey Shipilev wrote:
> On 10/18/2018 02:09 AM, Zhengyu Gu wrote:
>> It is indeed the result of Math.abs(Integer.MIN_VALUE) = Integer.MIN_VALUE, which is a negative
>> value (-2147483648).
>>
>> Webrev: http://cr.openjdk.java.net/~zgu/shenandoah/dedup_neg_index/webrev.00/
> 
> Consider using nextInt(int) instead:
>   https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextInt-int-
> 
> There are two another nextInt usages in the same file that need to be fixed as well.
Yep, rushed a bit.

Made further cleanup, narrowed the range of number of strings that test 
generates, may help reproducibility, e.g. test timeout, etc.

Webrev: 
http://cr.openjdk.java.net/~zgu/shenandoah/dedup_neg_index/webrev.01/

Test:
   Retested twice with early script.

> 
> Also, un-quarantine the test, if you believe that is the last bug there.

Not sure about this. I am going to put tier3 into a loop on gotland to 
make sure.

Thanks,

-Zhengyu

> 
> -Aleksey
> 


More information about the shenandoah-dev mailing list