[ https://issues.apache.org/jira/browse/HBASE-27990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832312#comment-17832312 ]
Hudson commented on HBASE-27990: -------------------------------- Results for branch branch-2.5 [build #503 on builds.a.o|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/]: (/) *{color:green}+1 overall{color}* ---- details (if available): (/) {color:green}+1 general checks{color} -- For more information [see general report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/General_20Nightly_20Build_20Report/] (/) {color:green}+1 jdk8 hadoop2 checks{color} -- For more information [see jdk8 (hadoop2) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK8_20Nightly_20Build_20Report_20_28Hadoop2_29/] (/) {color:green}+1 jdk8 hadoop3 checks{color} -- For more information [see jdk8 (hadoop3) report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/] (/) {color:green}+1 jdk11 hadoop3 checks{color} -- For more information [see jdk11 report|https://ci-hbase.apache.org/job/HBase%20Nightly/job/branch-2.5/503/JDK11_20Nightly_20Build_20Report_20_28Hadoop3_29/] (/) {color:green}+1 source release artifact{color} -- See build output for details. (/) {color:green}+1 client integration test{color} > BucketCache causes ArithmeticException due to improper blockSize value > checking > -------------------------------------------------------------------------------- > > Key: HBASE-27990 > URL: https://issues.apache.org/jira/browse/HBASE-27990 > Project: HBase > Issue Type: Sub-task > Components: BucketCache > Reporter: ConfX > Assignee: ConfX > Priority: Critical > Labels: pull-request-available > Fix For: 2.4.18, 2.7.0, 3.0.0-beta-2, 2.6.1, 2.5.9 > > Attachments: HBASE-27990.patch, reproduce.sh > > > h2. What happened > There is no value checking for parameter > {{{}hbase.blockcache.minblocksize{}}}. This may cause improper calculations > and crashes the system like division by 0. > h2. Buggy code > In {{{}BucketCache.java{}}}, there is no value checking for {{blockSize}} and > this variable is directly used to calculate the {{{}blockNumCapacity{}}}. > When {{blockSize}} is mistakenly set to 0, the code would cause division by 0 > and throw ArithmeticException to crash the system. > {noformat} > public BucketCache(String ioEngineName, long capacity, int blockSize, int[] > bucketSizes, > int writerThreadNum, int writerQLen, String persistencePath, int > ioErrorsTolerationDuration, > Configuration conf) throws IOException { > ... > long blockNumCapacity = capacity / blockSize; > ...{noformat} > h2. How to reproduce > (1) set hbase.blockcache.minblocksize=0 > (2) run > org.apache.hadoop.hbase.io.hfile.TestCacheConfig#testBucketCacheConfigL1L2Setup > you should observe the following failure: > {noformat} > java.lang.ArithmeticException: / by zero > at > org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.<init>(BucketCache.java:282) > at > org.apache.hadoop.hbase.io.hfile.BlockCacheFactory.createBucketCache(BlockCacheFactory.java:238) > at > org.apache.hadoop.hbase.io.hfile.BlockCacheFactory.createBlockCache(BlockCacheFactory.java:110) > at > org.apache.hadoop.hbase.io.hfile.TestCacheConfig.testBucketCacheConfigL1L2Setup(TestCacheConfig.java:325) > ...{noformat} > For an easy reproduction, run the reproduce.sh in the attachment. > We are happy to provide a patch if this issue is confirmed. -- This message was sent by Atlassian Jira (v8.20.10#820010)