FYI, I just uploaded a fresh build off of 1.7.3-SNAPSHOT. Nothing scary
in the defects, but if anyone is interested, at least there's a recent
build to look at.
-------- Original Message --------
Subject: New Defects reported by Coverity Scan for Accumulo
Date: Fri, 08 Jul 2016 10:01:02 -0700
From: [email protected]
To: [email protected]
Hi,
Please find the latest report on new defect(s) introduced to Accumulo
found with Coverity Scan.
11 new defect(s) introduced to Accumulo found with Coverity Scan.
203 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 11 of 11 defect(s)
** CID 1357389: Concurrent data access violations (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357389: Concurrent data access violations (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/LogServlet.java:
48 in
org.apache.accumulo.monitor.servlets.LogServlet.pageBody(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.StringBuilder)()
42 }
43
44 @Override
45 protected void pageBody(HttpServletRequest req,
HttpServletResponse resp, StringBuilder sb) {
46 AccumuloConfiguration conf =
Monitor.getContext().getConfiguration();
47 boolean clear = true;
CID 1357389: Concurrent data access violations (SINGLETON_RACE)
In call to "conf.get(org.apache.accumulo.core.conf.Property.MONITOR_LOG_DATE_FORMAT)",
"org.apache.accumulo.core.conf.Property.MONITOR_LOG_DATE_FORMAT" is modified without proper
synchronization. This member might be written by multiple threads serving simultaneous requests, leading to
unpredictable behavior. (The virtual call resolves to
"org.apache.accumulo.core.client.impl.ClientContext.1.get".)
48 final String dateFormatStr =
conf.get(Property.MONITOR_LOG_DATE_FORMAT);
49 SimpleDateFormat fmt;
50 try {
51 fmt = new SimpleDateFormat(dateFormatStr);
52 } catch (IllegalArgumentException e) {
53 log.warn("Could not instantiate SimpleDateFormat with
format string of '" + dateFormatStr + "', using default format string");
** CID 1357388: (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357388: (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/Basic.java:
88 in
org.apache.accumulo.monitor.servlets.trace.Basic.getScanner(java.lang.StringBuilder)()
82 final AuthenticationToken at;
83 Map<String,String> loginMap =
conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
84 // May be null
85 String keytab =
loginMap.get(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey() + "keytab");
86
87 if (saslEnabled && null != keytab) {
CID 1357388: (SINGLETON_RACE)
In call to "conf.get(org.apache.accumulo.core.conf.Property.TRACE_USER)",
"org.apache.accumulo.core.conf.Property.TRACE_USER" is modified without proper synchronization.
This member might be written by multiple threads serving simultaneous requests, leading to unpredictable
behavior. (The virtual call resolves to "org.apache.accumulo.core.client.impl.ClientContext.1.get".)
88 principal =
SecurityUtil.getServerPrincipal(conf.get(Property.TRACE_USER));
89 try {
90 traceUgi =
UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytab);
91 } catch (IOException e) {
92 throw new RuntimeException("Failed to login as trace
user", e);
93 }
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/Basic.java:
95 in
org.apache.accumulo.monitor.servlets.trace.Basic.getScanner(java.lang.StringBuilder)()
89 try {
90 traceUgi =
UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, keytab);
91 } catch (IOException e) {
92 throw new RuntimeException("Failed to login as trace
user", e);
93 }
94 } else {
CID 1357388: (SINGLETON_RACE)
In call to "conf.get(org.apache.accumulo.core.conf.Property.TRACE_USER)",
"org.apache.accumulo.core.conf.Property.TRACE_USER" is modified without proper synchronization.
This member might be written by multiple threads serving simultaneous requests, leading to unpredictable
behavior. (The virtual call resolves to "org.apache.accumulo.core.conf.SiteConfiguration.get".)
95 principal = conf.get(Property.TRACE_USER);
96 }
97
98 if (!saslEnabled) {
99 if (loginMap.isEmpty()) {
100 Property p = Property.TRACE_PASSWORD;
** CID 1357387: Concurrent data access violations (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357387: Concurrent data access violations (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/Basic.java:
117 in
org.apache.accumulo.monitor.servlets.trace.Basic.getScanner(java.lang.StringBuilder)()
111 at = token;
112 }
113 } else {
114 at = null;
115 }
116
CID 1357387: Concurrent data access violations (SINGLETON_RACE)
In call to "conf.get(org.apache.accumulo.core.conf.Property.TRACE_TABLE)",
"org.apache.accumulo.core.conf.Property.TRACE_TABLE" is modified without proper synchronization.
This member might be written by multiple threads serving simultaneous requests, leading to unpredictable
behavior. (The virtual call resolves to "org.apache.accumulo.core.conf.SiteConfiguration.get".)
117 final String table = conf.get(Property.TRACE_TABLE);
118 Scanner scanner;
119 if (null != traceUgi) {
120 try {
121 scanner = traceUgi.doAs(new
PrivilegedExceptionAction<Scanner>() {
122
** CID 1357386: Concurrent data access violations (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357386: Concurrent data access violations (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java:
59 in
org.apache.accumulo.monitor.servlets.BasicServlet.doGet(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()
53
54 @Override
55 public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
56 StringBuilder sb = new StringBuilder();
57 try {
58 Monitor.fetchData();
CID 1357386: Concurrent data access violations (SINGLETON_RACE)
In call to
"org.apache.accumulo.monitor.Monitor.getContext().getConfiguration().get(org.apache.accumulo.core.conf.Property.MONITOR_BANNER_TEXT)",
"org.apache.accumulo.core.conf.Property.MONITOR_BANNER_TEXT" is modified without proper
synchronization. This member might be written by multiple threads serving simultaneous requests, leading to
unpredictable behavior. (The virtual call resolves to
"org.apache.accumulo.core.client.impl.ClientContext.1.get".)
59 bannerText =
sanitize(Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_TEXT));
60 bannerColor =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_COLOR).replace("'",
"'");
61 bannerBackground =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_BACKGROUND).replace("'",
"'");
62 pageStart(req, resp, sb);
63 pageBody(req, resp, sb);
64 pageEnd(req, resp, sb);
** CID 1357385: Concurrent data access violations (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357385: Concurrent data access violations (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java:
60 in
org.apache.accumulo.monitor.servlets.BasicServlet.doGet(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()
54 @Override
55 public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
56 StringBuilder sb = new StringBuilder();
57 try {
58 Monitor.fetchData();
59 bannerText =
sanitize(Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_TEXT));
CID 1357385: Concurrent data access violations (SINGLETON_RACE)
In call to
"org.apache.accumulo.monitor.Monitor.getContext().getConfiguration().get(org.apache.accumulo.core.conf.Property.MONITOR_BANNER_COLOR)",
"org.apache.accumulo.core.conf.Property.MONITOR_BANNER_COLOR" is modified without proper
synchronization. This member might be written by multiple threads serving simultaneous requests, leading to
unpredictable behavior. (The virtual call resolves to
"org.apache.accumulo.core.client.impl.ClientContext.1.get".)
60 bannerColor =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_COLOR).replace("'",
"'");
61 bannerBackground =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_BACKGROUND).replace("'",
"'");
62 pageStart(req, resp, sb);
63 pageBody(req, resp, sb);
64 pageEnd(req, resp, sb);
65 } catch (Throwable t) {
** CID 1357384: Concurrent data access violations (SINGLETON_RACE)
________________________________________________________________________________________________________
*** CID 1357384: Concurrent data access violations (SINGLETON_RACE)
/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java:
61 in
org.apache.accumulo.monitor.servlets.BasicServlet.doGet(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)()
55 public void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
56 StringBuilder sb = new StringBuilder();
57 try {
58 Monitor.fetchData();
59 bannerText =
sanitize(Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_TEXT));
60 bannerColor =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_COLOR).replace("'",
"'");
CID 1357384: Concurrent data access violations (SINGLETON_RACE)
In call to
"org.apache.accumulo.monitor.Monitor.getContext().getConfiguration().get(org.apache.accumulo.core.conf.Property.MONITOR_BANNER_BACKGROUND)",
"org.apache.accumulo.core.conf.Property.MONITOR_BANNER_BACKGROUND" is modified without proper
synchronization. This member might be written by multiple threads serving simultaneous requests, leading to
unpredictable behavior. (The virtual call resolves to
"org.apache.accumulo.core.client.impl.ClientContext.1.get".)
61 bannerBackground =
Monitor.getContext().getConfiguration().get(Property.MONITOR_BANNER_BACKGROUND).replace("'",
"'");
62 pageStart(req, resp, sb);
63 pageBody(req, resp, sb);
64 pageEnd(req, resp, sb);
65 } catch (Throwable t) {
66 log.error("Error building page " + req.getRequestURI(), t);
** CID 1357383: (NULL_RETURNS)
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
113 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
115 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
________________________________________________________________________________________________________
*** CID 1357383: (NULL_RETURNS)
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
113 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
107 boolean add = true;
108
109 for (TCondition tc : scm.getConditions()) {
110
111 Range range;
112 if (tc.hasTimestamp)
CID 1357383: (NULL_RETURNS)
Dereferencing a pointer that might be null "tc.getCv()" when calling "Text".
113 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()), tc.getTs());
114 else
115 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()));
116
117 SortedKeyValueIterator<Key,Value> iter =
buildIterator(systemIter, tc);
118
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
115 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
109 for (TCondition tc : scm.getConditions()) {
110
111 Range range;
112 if (tc.hasTimestamp)
113 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()), tc.getTs());
114 else
CID 1357383: (NULL_RETURNS)
Dereferencing a pointer that might be null "tc.getCv()" when calling "Text".
115 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()));
116
117 SortedKeyValueIterator<Key,Value> iter =
buildIterator(systemIter, tc);
118
119 ByteSequence cf = new ArrayByteSequence(tc.getCf());
120 iter.seek(range, Collections.singleton(cf), true);
** CID 1357382: (NULL_RETURNS)
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
113 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
115 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
________________________________________________________________________________________________________
*** CID 1357382: (NULL_RETURNS)
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
113 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
107 boolean add = true;
108
109 for (TCondition tc : scm.getConditions()) {
110
111 Range range;
112 if (tc.hasTimestamp)
CID 1357382: (NULL_RETURNS)
Dereferencing a pointer that might be null "tc.getCq()" when calling "Text".
113 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()), tc.getTs());
114 else
115 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()));
116
117 SortedKeyValueIterator<Key,Value> iter =
buildIterator(systemIter, tc);
118
/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java:
115 in
org.apache.accumulo.tserver.ConditionCheckerContext.checkConditions(org.apache.accumulo.core.iterators.SortedKeyValueIterator,
org.apache.accumulo.tserver.data.ServerConditionalMutation)()
109 for (TCondition tc : scm.getConditions()) {
110
111 Range range;
112 if (tc.hasTimestamp)
113 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()), tc.getTs());
114 else
CID 1357382: (NULL_RETURNS)
Dereferencing a pointer that might be null "tc.getCq()" when calling "Text".
115 range = Range.exact(new Text(scm.getRow()), new
Text(tc.getCf()), new Text(tc.getCq()), new Text(tc.getCv()));
116
117 SortedKeyValueIterator<Key,Value> iter =
buildIterator(systemIter, tc);
118
119 ByteSequence cf = new ArrayByteSequence(tc.getCf());
120 iter.seek(range, Collections.singleton(cf), true);
** CID 1357380: Concurrent data access violations (GUARDED_BY_VIOLATION)
/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java:
280 in
org.apache.accumulo.fate.zookeeper.ZooCache$2.run(org.apache.zookeeper.ZooKeeper)()
________________________________________________________________________________________________________
*** CID 1357380: Concurrent data access violations (GUARDED_BY_VIOLATION)
/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java:
280 in
org.apache.accumulo.fate.zookeeper.ZooCache$2.run(org.apache.zookeeper.ZooKeeper)()
274 @Override
275 public byte[] run(ZooKeeper zooKeeper) throws
KeeperException, InterruptedException {
276 Stat stat = null;
277 cacheReadLock.lock();
278 try {
279 if (cache.containsKey(zPath)) {
CID 1357380: Concurrent data access violations (GUARDED_BY_VIOLATION)
Accessing "statCache" without holding lock "ZooCache.cacheWriteLock.lock()". Elsewhere,
"org.apache.accumulo.fate.zookeeper.ZooCache.statCache" is accessed with
"ZooCache.cacheWriteLock.lock()" held 5 out of 6 times.
280 stat = statCache.get(zPath);
281 copyStats(status, stat);
282 return cache.get(zPath);
283 }
284 } finally {
285 cacheReadLock.unlock();
** CID 1357379: Null pointer dereferences (FORWARD_NULL)
/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java: 217 in
org.apache.accumulo.proxy.Proxy.createProxyServer(com.google.common.net.HostAndPort,
org.apache.thrift.protocol.TProtocolFactory, java.util.Properties,
org.apache.accumulo.core.client.ClientConfiguration)()
________________________________________________________________________________________________________
*** CID 1357379: Null pointer dereferences (FORWARD_NULL)
/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java: 217 in
org.apache.accumulo.proxy.Proxy.createProxyServer(com.google.common.net.HostAndPort,
org.apache.thrift.protocol.TProtocolFactory, java.util.Properties,
org.apache.accumulo.core.client.ClientConfiguration)()
211 ThriftServerType serverType = DEFAULT_SERVER_TYPE;
212 if (!THRIFT_SERVER_TYPE_DEFAULT.equals(serverTypeStr)) {
213 serverType = ThriftServerType.get(serverTypeStr);
214 }
215
216 SslConnectionParams sslParams = null;
CID 1357379: Null pointer dereferences (FORWARD_NULL)
Assigning: "saslParams" = "null".
217 SaslServerConnectionParams saslParams = null;
218 switch (serverType) {
219 case SSL:
220 sslParams =
SslConnectionParams.forClient(ClientContext.convertClientConfig(clientConf));
221 break;
222 case SASL:
** CID 1357373: Concurrent data access violations (ATOMICITY)
/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java: 533
in org.apache.accumulo.tserver.NativeMap.mutate(java.util.List, int)()
________________________________________________________________________________________________________
*** CID 1357373: Concurrent data access violations (ATOMICITY)
/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java: 533
in org.apache.accumulo.tserver.NativeMap.mutate(java.util.List, int)()
527
528 modCount++;
529
530 int count = 0;
531 while (iter.hasNext() && count < 10) {
532 Mutation mutation = iter.next();
CID 1357373: Concurrent data access violations (ATOMICITY)
Using an unreliable value of "mutationCount" inside the second locked section. If the
data that "mutationCount" depends on was changed by another thread, this use might be
incorrect.
533 mutationCount = _mutate(mutation, mutationCount);
534 count += mutation.size();
535 }
536 } finally {
537 wlock.unlock();
538 }
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://scan.coverity.com/projects/accumulo?tab=overview
To manage Coverity Scan email notifications for "[email protected]",
click
https://scan.coverity.com/subscriptions/edit?email=josh.elser%40gmail.com&token=9ab0764ecebcd70b5ff2d25f8033c7a7