RFR(xs): 8145192: 'count' variable can overflow in PSMarkSweep::invoke on 64 bit JVM
Tom Benson
tom.benson at oracle.com
Fri Jan 22 20:52:17 UTC 2016
Hi,
I think it would be *slightly* more logical to instead reduce
MarkSweepAlwaysCompactCount to a uint, since there should be no need for
it to be anywhere near even that large. But I don't feel too strongly,
and that would require changing the test.
So, the change looks OK to me.
Tom
On 1/22/2016 2:56 PM, sangheon wrote:
> Hi all,
>
> Could I have reviews for this tiny change to avoid zero division?
>
> 'uintx' type flag 'MarkSweepAlwaysCompactCount' is used to set 'uint'
> type local variable and this would result in an overflow for big
> numbers(>max_juint).
> As a solution, this local variable should be changed to 'uintx'.
>
> I didn't add a new test as JDK-8144578 enables to check this problem.
>
> CR: https://bugs.openjdk.java.net/browse/JDK-8145192
> Webrev: http://cr.openjdk.java.net/~sangheki/8145192/webrev.00
> Testing: JPRT, manual test[1]
>
> [1]: Call System.gc() with VM option of '-XX:+UseParallelGC
> -XX:-UseParallelOldGC -XX:MarkSweepAlwaysCompactCount=4294967296'
> (=max_juint + 1).
>
> Thanks,
> Sangheon
More information about the hotspot-gc-dev
mailing list