Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C79EB10659 for ; Fri, 17 Oct 2014 02:00:21 +0000 (UTC) Received: (qmail 49773 invoked by uid 500); 17 Oct 2014 02:00:21 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 49694 invoked by uid 500); 17 Oct 2014 02:00:21 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Delivered-To: moderator for dev@hbase.apache.org Received: (qmail 44059 invoked by uid 99); 17 Oct 2014 01:59:03 -0000 X-ASF-Spam-Status: No, hits=0.9 required=5.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of scan-admin@coverity.com) Date: Thu, 16 Oct 2014 18:58:37 -0700 From: scan-admin@coverity.com To: dev@hbase.apache.org Message-ID: <544077cd3e661_3961b5b314336bc@scan.coverity.com.mail> Subject: New Defects reported by Coverity Scan for Apache HBase Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Oct 2014 01:58:56.0181 (UTC) FILETIME=[E8D34E50:01CFE9AD] X-Virus-Checked: Checked by ClamAV on apache.org Hi, Please find the latest report on new defect(s) introduced to Apache HBase found with Coverity Scan. 174 new defect(s) introduced to Apache HBase found with Coverity Scan. 125 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 20 of 174 defect(s) ** CID 1064696: Value not atomically updated (ATOMICITY) /hbase-server/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java: 135 in org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate.maintainStats()() /hbase-server/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java: 135 in org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate.maintainStats()() ** CID 1064763: Logically dead code (DEADCODE) /hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java: 1243 in org.apache.hadoop.hbase.util.Bytes$LexicographicalComparerHolder$UnsafeComparer.compareTo(byte[], int, int, byte[], int, int)() ** CID 1064879: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java: 201 in org.apache.hadoop.hbase.client.HTableMultiplexer.getHTable(org.apache.hadoop.hbase.TableName)() ** CID 1064851: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 552 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.getStdParams()() ** CID 1064857: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 675 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.getMedianParams()() ** CID 1064849: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 773 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() ** CID 1064856: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 676 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.getMedianParams()() ** CID 1064850: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 776 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() ** CID 1064776: Dereference after null check (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 371 in org.apache.hadoop.hbase.regionserver.MemStore.getNextRow(org.apache.hadoop.hbase.KeyValue, java.util.NavigableSet)() ** CID 1064848: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 774 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() ** CID 1064846: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java: 162 in org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper.restoreHdfsRegions()() ** CID 1064860: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java: 181 in org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.setClusterStatus(org.apache.hadoop.hbase.ClusterStatus)() ** CID 1064855: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 454 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$AvgCallBack.getAvgArgs()() ** CID 1064852: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 553 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.getStdParams()() ** CID 1064784: Explicit null dereferenced (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotLogSplitter.java: 176 in org.apache.hadoop.hbase.snapshot.SnapshotLogSplitter.splitLog(org.apache.hadoop.fs.Path)() ** CID 1064793: Dereference after null check (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java: 133 in org.apache.hadoop.hbase.snapshot.TakeSnapshotUtils.verifyAllLogsGotReferenced(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.fs.Path, java.util.Set, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos$SnapshotDescription, org.apache.hadoop.fs.Path)() ** CID 1064796: Explicit null dereferenced (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java: 916 in org.apache.hadoop.hbase.regionserver.HStore.flushCache(long, java.util.SortedSet, org.apache.hadoop.hbase.regionserver.TimeRangeTracker, java.util.concurrent.atomic.AtomicLong, org.apache.hadoop.hbase.monitoring.MonitoredTask)() ** CID 1064904: Using invalid iterator (INVALIDATE_ITERATOR) /hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java: 308 in org.apache.hadoop.hbase.io.hfile.slab.SingleSizeCache.evictBlocksByHfileName(java.lang.String)() ** CID 1064892: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java: 828 in org.apache.hadoop.hbase.master.RegionStates.getRegionInfo(byte[])() ** CID 1064901: Using invalid iterator (INVALIDATE_ITERATOR) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java: 314 in org.apache.hadoop.hbase.client.HTablePool.close()() ________________________________________________________________________________________________________ *** CID 1064696: Value not atomically updated (ATOMICITY) /hbase-server/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java: 135 in org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate.maintainStats()() 129 protected void maintainStats() { 130 int curOps = this.getPreviousIntervalNumOps(); 131 if (curOps > 0) { 132 long curTime = this.getPreviousIntervalAverageTime(); 133 long totalTime = curTime * curOps; 134 if (curTime == 0 || totalTime / curTime == curOps) { >>> CID 1064696: Value not atomically updated (ATOMICITY) >>> Using "curOps", an unreliable value, inside a synchronous method ("super.inc(curOps, totalTime)"). This code might not be thread safe or might indicate a source of unnecessary synchronization. 135 super.inc(curOps, totalTime); 136 } else { 137 LOG.info("Stats for " + this.getName() + " overflowed! resetting"); 138 } 139 } 140 } /hbase-server/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java: 135 in org.apache.hadoop.hbase.metrics.PersistentMetricsTimeVaryingRate.maintainStats()() 129 protected void maintainStats() { 130 int curOps = this.getPreviousIntervalNumOps(); 131 if (curOps > 0) { 132 long curTime = this.getPreviousIntervalAverageTime(); 133 long totalTime = curTime * curOps; 134 if (curTime == 0 || totalTime / curTime == curOps) { >>> CID 1064696: Value not atomically updated (ATOMICITY) >>> Using "totalTime", an unreliable value, inside a synchronous method ("super.inc(curOps, totalTime)"). This code might not be thread safe or might indicate a source of unnecessary synchronization. 135 super.inc(curOps, totalTime); 136 } else { 137 LOG.info("Stats for " + this.getName() + " overflowed! resetting"); 138 } 139 } 140 } ________________________________________________________________________________________________________ *** CID 1064763: Logically dead code (DEADCODE) /hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java: 1243 in org.apache.hadoop.hbase.util.Bytes$LexicographicalComparerHolder$UnsafeComparer.compareTo(byte[], int, int, byte[], int, int)() 1237 1238 // Use binary search 1239 int n = 0; 1240 int y; 1241 int x = (int) diff; 1242 if (x == 0) { >>> CID 1064763: Logically dead code (DEADCODE) >>> Execution cannot reach this statement: "x = (int)(diff >>> 32);". 1243 x = (int) (diff >>> 32); 1244 n = 32; 1245 } 1246 1247 y = x << 16; 1248 if (y == 0) { ________________________________________________________________________________________________________ *** CID 1064879: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableMultiplexer.java: 201 in org.apache.hadoop.hbase.client.HTableMultiplexer.getHTable(org.apache.hadoop.hbase.TableName)() 195 public HTableMultiplexerStatus getHTableMultiplexerStatus() { 196 return new HTableMultiplexerStatus(serverToFlushWorkerMap); 197 } 198 199 200 private HTable getHTable(TableName tableName) throws IOException { >>> CID 1064879: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "this.tableNameToHTableMap" without holding lock "HTableMultiplexer.tableNameToHTableMap". Elsewhere, "org.apache.hadoop.hbase.client.HTableMultiplexer.tableNameToHTableMap" is accessed with "HTableMultiplexer.tableNameToHTableMap" held 2 out of 3 times. 201 HTable htable = this.tableNameToHTableMap.get(tableName); 202 if (htable == null) { 203 synchronized (this.tableNameToHTableMap) { 204 htable = this.tableNameToHTableMap.get(tableName); 205 if (htable == null) { 206 htable = new HTable(conf, tableName); ________________________________________________________________________________________________________ *** CID 1064851: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 552 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.getStdParams()() 546 class StdCallback implements Batch.Callback, Long>> { 547 long rowCountVal = 0l; 548 S sumVal = null, sumSqVal = null; 549 550 public Pair, Long> getStdParams() { 551 List l = new ArrayList(); >>> CID 1064851: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "sumVal" without holding lock "StdCallback.this". Elsewhere, "org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.sumVal" is accessed with "StdCallback.this" held 2 out of 3 times. 552 l.add(sumVal); 553 l.add(sumSqVal); 554 Pair, Long> p = new Pair, Long>(l, rowCountVal); 555 return p; 556 } 557 ________________________________________________________________________________________________________ *** CID 1064857: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 675 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.getMedianParams()() 669 new TreeMap>(Bytes.BYTES_COMPARATOR); 670 class StdCallback implements Batch.Callback> { 671 S sumVal = null, sumWeights = null; 672 673 public Pair>, List> getMedianParams() { 674 List l = new ArrayList(); >>> CID 1064857: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "sumVal" without holding lock "StdCallback.this". Elsewhere, "org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.sumVal" is accessed with "StdCallback.this" held 2 out of 3 times. 675 l.add(sumVal); 676 l.add(sumWeights); 677 Pair>, List> p = 678 new Pair>, List>(map, l); 679 return p; 680 } ________________________________________________________________________________________________________ *** CID 1064849: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 773 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() 767 } 768 769 return null; 770 } finally { 771 if (v != null) { 772 // in all cases, remember the last KV iterated to >>> CID 1064849: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "snapshotIt" without holding lock "MemStoreScanner.this". Elsewhere, "org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.snapshotIt" is accessed with "MemStoreScanner.this" held 5 out of 6 times. 773 if (it == snapshotIt) { 774 snapshotItRow = v; 775 } else { 776 kvsetItRow = v; 777 } 778 } ________________________________________________________________________________________________________ *** CID 1064856: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 676 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.getMedianParams()() 670 class StdCallback implements Batch.Callback> { 671 S sumVal = null, sumWeights = null; 672 673 public Pair>, List> getMedianParams() { 674 List l = new ArrayList(); 675 l.add(sumVal); >>> CID 1064856: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "sumWeights" without holding lock "StdCallback.this". Elsewhere, "org.apache.hadoop.hbase.client.coprocessor.AggregationClient$2$StdCallback.sumWeights" is accessed with "StdCallback.this" held 2 out of 3 times. 676 l.add(sumWeights); 677 Pair>, List> p = 678 new Pair>, List>(map, l); 679 return p; 680 } 681 ________________________________________________________________________________________________________ *** CID 1064850: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 776 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() 770 } finally { 771 if (v != null) { 772 // in all cases, remember the last KV iterated to 773 if (it == snapshotIt) { 774 snapshotItRow = v; 775 } else { >>> CID 1064850: Unguarded write (GUARDED_BY_VIOLATION) >>> Accessing "kvsetItRow" without holding lock "MemStoreScanner.this". Elsewhere, "org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.kvsetItRow" is accessed with "MemStoreScanner.this" held 3 out of 4 times. 776 kvsetItRow = v; 777 } 778 } 779 } 780 } 781 ________________________________________________________________________________________________________ *** CID 1064776: Dereference after null check (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 371 in org.apache.hadoop.hbase.regionserver.MemStore.getNextRow(org.apache.hadoop.hbase.KeyValue, java.util.NavigableSet)() 365 * @return Next row or null if none found. If one found, will be a new 366 * KeyValue -- can be destroyed by subsequent calls to this method. 367 */ 368 private KeyValue getNextRow(final KeyValue key, 369 final NavigableSet set) { 370 KeyValue result = null; >>> CID 1064776: Dereference after null check (FORWARD_NULL) >>> Comparing "key" to null implies that "key" might be null. 371 SortedSet tail = key == null? set: set.tailSet(key); 372 // Iterate until we fall into the next row; i.e. move off current row 373 for (KeyValue kv: tail) { 374 if (comparator.compareRows(kv, key) <= 0) 375 continue; 376 // Note: Not suppressing deletes or expired cells. Needs to be handled ________________________________________________________________________________________________________ *** CID 1064848: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: 774 in org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.getNext(java.util.Iterator)() 768 769 return null; 770 } finally { 771 if (v != null) { 772 // in all cases, remember the last KV iterated to 773 if (it == snapshotIt) { >>> CID 1064848: Unguarded write (GUARDED_BY_VIOLATION) >>> Accessing "snapshotItRow" without holding lock "MemStoreScanner.this". Elsewhere, "org.apache.hadoop.hbase.regionserver.MemStore$MemStoreScanner.snapshotItRow" is accessed with "MemStoreScanner.this" held 3 out of 4 times. 774 snapshotItRow = v; 775 } else { 776 kvsetItRow = v; 777 } 778 } 779 } ________________________________________________________________________________________________________ *** CID 1064846: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java: 162 in org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper.restoreHdfsRegions()() 156 Set snapshotRegionNames = SnapshotReferenceUtil.getSnapshotRegionNames(fs, snapshotDir); 157 if (snapshotRegionNames == null) { 158 LOG.warn("Nothing to restore. Snapshot " + snapshotDesc + " looks empty"); 159 return null; 160 } 161 >>> CID 1064846: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "parentsMap" without holding lock "RestoreSnapshotHelper.parentsMap". Elsewhere, "org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper.parentsMap" is accessed with "RestoreSnapshotHelper.parentsMap" held 2 out of 3 times. 162 RestoreMetaChanges metaChanges = new RestoreMetaChanges(parentsMap); 163 164 // Identify which region are still available and which not. 165 // NOTE: we rely upon the region name as: "table name, start key, end key" 166 List tableRegions = getTableRegions(); 167 if (tableRegions != null) { ________________________________________________________________________________________________________ *** CID 1064860: Unguarded write (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java: 181 in org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.setClusterStatus(org.apache.hadoop.hbase.ClusterStatus)() 175 this.slop = conf.getFloat("hbase.regions.slop", 0.001F); 176 } 177 178 @Override 179 public void setClusterStatus(ClusterStatus st) { 180 super.setClusterStatus(st); >>> CID 1064860: Unguarded write (GUARDED_BY_VIOLATION) >>> Accessing "this.clusterStatus" without holding lock "StochasticLoadBalancer.this". Elsewhere, "org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.clusterStatus" is accessed with "StochasticLoadBalancer.this" held 2 out of 3 times. 181 this.clusterStatus = st; 182 updateRegionLoad(); 183 for(CostFromRegionLoadFunction cost : regionLoadFunctions) { 184 cost.setClusterStatus(st); 185 } 186 } ________________________________________________________________________________________________________ *** CID 1064855: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 454 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$AvgCallBack.getAvgArgs()() 448 final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); 449 class AvgCallBack implements Batch.Callback> { 450 S sum = null; 451 Long rowCount = 0l; 452 453 public Pair getAvgArgs() { >>> CID 1064855: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "sum" without holding lock "AvgCallBack.this". Elsewhere, "org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$AvgCallBack.sum" is accessed with "AvgCallBack.this" held 2 out of 3 times. 454 return new Pair(sum, rowCount); 455 } 456 457 @Override 458 public synchronized void update(byte[] region, byte[] row, Pair result) { 459 sum = ci.add(sum, result.getFirst()); ________________________________________________________________________________________________________ *** CID 1064852: Unguarded read (GUARDED_BY_VIOLATION) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java: 553 in org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.getStdParams()() 547 long rowCountVal = 0l; 548 S sumVal = null, sumSqVal = null; 549 550 public Pair, Long> getStdParams() { 551 List l = new ArrayList(); 552 l.add(sumVal); >>> CID 1064852: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "sumSqVal" without holding lock "StdCallback.this". Elsewhere, "org.apache.hadoop.hbase.client.coprocessor.AggregationClient$1$StdCallback.sumSqVal" is accessed with "StdCallback.this" held 2 out of 3 times. 553 l.add(sumSqVal); 554 Pair, Long> p = new Pair, Long>(l, rowCountVal); 555 return p; 556 } 557 558 @Override ________________________________________________________________________________________________________ *** CID 1064784: Explicit null dereferenced (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotLogSplitter.java: 176 in org.apache.hadoop.hbase.snapshot.SnapshotLogSplitter.splitLog(org.apache.hadoop.fs.Path)() 170 LOG.debug("+ regionName=" + Bytes.toString(regionName)); 171 } 172 173 // Append Entry 174 key = new HLogKey(newRegionName, tableName, key.getLogSeqNum(), key.getWriteTime(), 175 key.getClusterIds(), key.getNonceGroup(), key.getNonce()); >>> CID 1064784: Explicit null dereferenced (FORWARD_NULL) >>> Calling a method on null object "writer". 176 writer.append(new HLog.Entry(key, entry.getEdit())); 177 } 178 } catch (IOException e) { 179 LOG.warn("Something wrong during the log split", e); 180 } finally { 181 log.close(); ________________________________________________________________________________________________________ *** CID 1064793: Dereference after null check (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/TakeSnapshotUtils.java: 133 in org.apache.hadoop.hbase.snapshot.TakeSnapshotUtils.verifyAllLogsGotReferenced(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.fs.Path, java.util.Set, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos$SnapshotDescription, org.apache.hadoop.fs.Path)() 127 assertNotNull(snapshot, "No server logs added to snapshot", snapshotLogs); 128 } else { 129 assertNull(snapshot, "Snapshotted server logs that don't exist", snapshotLogs); 130 } 131 132 // check the number of servers >>> CID 1064793: Dereference after null check (FORWARD_NULL) >>> Calling a method on null object "realLogs". 133 Set>> serverEntries = realLogs.asMap().entrySet(); 134 Set>> snapshotEntries = snapshotLogs.asMap().entrySet(); 135 assertEquals(snapshot, "Not the same number of snapshot and original server logs directories", 136 serverEntries.size(), snapshotEntries.size()); 137 138 // verify we snapshotted each of the log files ________________________________________________________________________________________________________ *** CID 1064796: Explicit null dereferenced (FORWARD_NULL) /hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java: 916 in org.apache.hadoop.hbase.regionserver.HStore.flushCache(long, java.util.SortedSet, org.apache.hadoop.hbase.regionserver.TimeRangeTracker, java.util.concurrent.atomic.AtomicLong, org.apache.hadoop.hbase.monitoring.MonitoredTask)() 910 IOException iie = new InterruptedIOException(); 911 iie.initCause(e); 912 throw iie; 913 } 914 } 915 } >>> CID 1064796: Explicit null dereferenced (FORWARD_NULL) >>> Throwing null exception "lastException". 916 throw lastException; 917 } 918 919 /* 920 * @param path The pathname of the tmp file into which the store was flushed 921 * @param logCacheFlushId ________________________________________________________________________________________________________ *** CID 1064904: Using invalid iterator (INVALIDATE_ITERATOR) /hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java: 308 in org.apache.hadoop.hbase.io.hfile.slab.SingleSizeCache.evictBlocksByHfileName(java.lang.String)() 302 * This is never called, as evictions are handled in the SlabCache layer, 303 * implemented in the event we want to use this as a standalone cache. 304 */ 305 @Override 306 public int evictBlocksByHfileName(String hfileName) { 307 int evictedCount = 0; >>> CID 1064904: Using invalid iterator (INVALIDATE_ITERATOR) >>> Attempting to obtain another element from "backingMap.keySet()" after it's been modified. 308 for (BlockCacheKey e : backingMap.keySet()) { 309 if (e.getHfileName().equals(hfileName)) { 310 this.evictBlock(e); 311 } 312 } 313 return evictedCount; ________________________________________________________________________________________________________ *** CID 1064892: Unguarded read (GUARDED_BY_VIOLATION) /hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java: 828 in org.apache.hadoop.hbase.master.RegionStates.getRegionInfo(byte[])() 822 * Get the HRegionInfo from cache, if not there, from the hbase:meta table 823 * @param regionName 824 * @return HRegionInfo for the region 825 */ 826 protected HRegionInfo getRegionInfo(final byte [] regionName) { 827 String encodedName = HRegionInfo.encodeRegionName(regionName); >>> CID 1064892: Unguarded read (GUARDED_BY_VIOLATION) >>> Accessing "regionStates" without holding lock "RegionStates.this". Elsewhere, "org.apache.hadoop.hbase.master.RegionStates.regionStates" is accessed with "RegionStates.this" held 8 out of 10 times. 828 RegionState regionState = regionStates.get(encodedName); 829 if (regionState != null) { 830 return regionState.getRegion(); 831 } 832 833 try { ________________________________________________________________________________________________________ *** CID 1064901: Using invalid iterator (INVALIDATE_ITERATOR) /hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java: 314 in org.apache.hadoop.hbase.client.HTablePool.close()() 308 * Closes all the HTable instances , belonging to all tables in the table 309 * pool. 310 *

311 * Note: this is a 'shutdown' of all the table pools. 312 */ 313 public void close() throws IOException { >>> CID 1064901: Using invalid iterator (INVALIDATE_ITERATOR) >>> Attempting to obtain another element from "tables.keySet()" after it's been modified. 314 for (String tableName : tables.keySet()) { 315 closeTablePool(tableName); 316 } 317 this.tables.clear(); 318 } 319 ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/728?tab=overview To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py