Running following command(run TestGCOld hotspot jtreg test) on Linux-x64 cause 64 bit JVM exit with SIGFPE signal:
java -XX:+UseConcMarkSweepGC -XX:CMSOldPLABNumRefills=9223372036854775808 TestGCOld 10 10 10 10 100
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x00007f6ca7fe2bde, pid=14991, tid=14996
#
# JRE version: Java(TM) SE Runtime Environment (9.0) (fastdebug build 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt, mixed mode, tiered, compressed oops, concurrent mark sweep gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x8b6bde] CompactibleFreeListSpaceLAB::compute_desired_plab_size()+0xbe
#
...
hs_err_pid14991.log is attached.
Also, can be reproduced by running javac:
javac -J-XX:+UseConcMarkSweepGC -J-XX:CMSOldPLABNumRefills=9223372036854775808 HelloWorld.java
32 bit JVM also affected:
java -XX:+UseConcMarkSweepGC -XX:CMSOldPLABNumRefills=2147483648 TestGCOld 10 10 10 10 100
The problem in overflow in compute_desired_plab_size() function:
void CompactibleFreeListSpaceLAB::compute_desired_plab_size() {
...
MIN2(CMSOldPLABMax,
_global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
...
}
'_global_num_workers[i]*CMSOldPLABNumRefills' can results in 0 due to the overflow and this can cause division by zero.
java -XX:+UseConcMarkSweepGC -XX:CMSOldPLABNumRefills=9223372036854775808 TestGCOld 10 10 10 10 100
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x00007f6ca7fe2bde, pid=14991, tid=14996
#
# JRE version: Java(TM) SE Runtime Environment (9.0) (fastdebug build 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt, mixed mode, tiered, compressed oops, concurrent mark sweep gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x8b6bde] CompactibleFreeListSpaceLAB::compute_desired_plab_size()+0xbe
#
...
hs_err_pid14991.log is attached.
Also, can be reproduced by running javac:
javac -J-XX:+UseConcMarkSweepGC -J-XX:CMSOldPLABNumRefills=9223372036854775808 HelloWorld.java
32 bit JVM also affected:
java -XX:+UseConcMarkSweepGC -XX:CMSOldPLABNumRefills=2147483648 TestGCOld 10 10 10 10 100
The problem in overflow in compute_desired_plab_size() function:
void CompactibleFreeListSpaceLAB::compute_desired_plab_size() {
...
MIN2(CMSOldPLABMax,
_global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills))));
...
}
'_global_num_workers[i]*CMSOldPLABNumRefills' can results in 0 due to the overflow and this can cause division by zero.