hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scan-ad...@coverity.com
Subject New Defects reported by Coverity Scan for Apache HBase
Date Fri, 17 Oct 2014 01:58:37 GMT

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<Pair<List<S>, Long>>
{
547           long rowCountVal = 0l;
548           S sumVal = null, sumSqVal = null;
549     
550           public Pair<List<S>, Long> getStdParams() {
551             List<S> l = new ArrayList<S>();
>>>     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<List<S>, Long> p = new Pair<List<S>, 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<byte[], List<S>>(Bytes.BYTES_COMPARATOR);
670         class StdCallback implements Batch.Callback<List<S>> {
671           S sumVal = null, sumWeights = null;
672     
673           public Pair<NavigableMap<byte[], List<S>>, List<S>>
getMedianParams() {
674             List<S> l = new ArrayList<S>();
>>>     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<NavigableMap<byte[], List<S>>, List<S>> p =
678               new Pair<NavigableMap<byte[], List<S>>, List<S>>(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<List<S>> {
671           S sumVal = null, sumWeights = null;
672     
673           public Pair<NavigableMap<byte[], List<S>>, List<S>>
getMedianParams() {
674             List<S> l = new ArrayList<S>();
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<NavigableMap<byte[], List<S>>, List<S>> p =
678               new Pair<NavigableMap<byte[], List<S>>, List<S>>(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<KeyValue> 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<KeyValue> 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<String> 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<HRegionInfo> 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<Pair<S, Long>> {
450           S sum = null;
451           Long rowCount = 0l;
452     
453           public Pair<S, Long> 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<S, Long>(sum, rowCount);
455           }
456     
457           @Override
458           public synchronized void update(byte[] region, byte[] row, Pair<S, Long>
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<List<S>, Long> getStdParams() {
551             List<S> l = new ArrayList<S>();
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<List<S>, Long> p = new Pair<List<S>, 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<Entry<String, Collection<String>>> serverEntries = realLogs.asMap().entrySet();
134         Set<Entry<String, Collection<String>>> 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        * <p>
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




Mime
View raw message