New Coverity report is here. I deleted three finds which were in test code.

---------- Forwarded message ----------
From: <[email protected]>
Date: Wed, Apr 12, 2017 at 3:59 PM
Subject: New Defects reported by Coverity Scan for Apache ActiveMQ Artemis
To: [email protected]



Hi,

Please find the latest report on new defect(s) introduced to Apache
ActiveMQ Artemis found with Coverity Scan.

7 new defect(s) introduced to Apache ActiveMQ Artemis found with Coverity
Scan.
4 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 7 of 7 defect(s)


** CID 1428142:  Concurrent data access violations  (GUARDED_BY_VIOLATION)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/
NamedLiveNodeLocatorForReplication.java: 108 in org.apache.activemq.artemis.
core.server.impl.NamedLiveNodeLocatorForReplication.getLiveConfiguration()()


____________________________________________________________
____________________________________________
*** CID 1428142:  Concurrent data access violations  (GUARDED_BY_VIOLATION)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/
NamedLiveNodeLocatorForReplication.java: 108 in org.apache.activemq.artemis.
core.server.impl.NamedLiveNodeLocatorForReplication.getLiveConfiguration()()
102        public String getNodeID() {
103           return nodeID;
104        }
105
106        @Override
107        public Pair<TransportConfiguration, TransportConfiguration>
getLiveConfiguration() {
>>>     CID 1428142:  Concurrent data access violations
(GUARDED_BY_VIOLATION)
>>>     Accessing "liveConfigurations" without holding lock "
NamedLiveNodeLocatorForReplication.lock.lock()". Elsewhere,
"org.apache.activemq.artemis.core.server.impl.NamedLiveNodeLocatorForReplication.liveConfigurations"
is accessed with "NamedLiveNodeLocatorForReplication.lock.lock()" held 5
out of 6 times.
108           return liveConfigurations.peek();
109        }
110
111        @Override
112        public void notifyRegistrationFailed(boolean alreadyReplicating)
{
113           try {

** CID 1428143:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/
SharedNothingBackupActivation.java: 211 in org.apache.activemq.artemis.
core.server.impl.SharedNothingBackupActivation.run()()


____________________________________________________________
____________________________________________
*** CID 1428143:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/
SharedNothingBackupActivation.java: 211 in org.apache.activemq.artemis.
core.server.impl.SharedNothingBackupActivation.run()()
205                    }
206                    activeMQServer.getNodeManager().setNodeID(nodeID);
207                 }
208
209                 try {
210                    if (logger.isTraceEnabled()) {
>>>     CID 1428143:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "possibleLive".
211                       logger.trace("Calling clusterController.
connectToNodeInReplicatedCluster(" + possibleLive.getA() + ")");
212                    }
213                    clusterControl = clusterController.
connectToNodeInReplicatedCluster(possibleLive.getA());
214                 } catch (Exception e) {
215                    logger.debug(e.getMessage(), e);
216                    if (possibleLive.getB() != null) {


____________________________________________________________
____________________________________________
*** CID 1428146:  FindBugs: Correctness  (FB.EC_UNRELATED_TYPES)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java:
720 in org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.
bindingQuery(org.apache.activemq.artemis.api.core.SimpleString)()
714
715           List<SimpleString> names = new ArrayList<>();
716
717           // make an exception for the management address (see
HORNETQ-29)
718           ManagementService managementService = getManagementService();
719           if (managementService != null) {
>>>     CID 1428146:  FindBugs: Correctness  (FB.EC_UNRELATED_TYPES)
>>>     Call to String.equals(org.apache.activemq.artemis.api.core.
SimpleString).
720              if
(realAddress.equals(managementService.getManagementAddress()))
{
721                 return new BindingQueryResult(true, names,
autoCreateQeueus, autoCreateAddresses, defaultPurgeOnNoConsumers,
defaultMaxConsumers);
722              }
723           }
724
725           SimpleString bindAddress = new SimpleString(realAddress);



____________________________________________________________
____________________________________________
*** CID 1428148:  FindBugs: Bad practice  (FB.RV_RETURN_VALUE_IGNORED_
BAD_PRACTICE)
/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java:
122 in org.apache.activemq.artemis.integration.FileBroker.
createDirectories(org.apache.activemq.artemis.core.config.
impl.FileConfiguration)()
116
117
118        private void createDirectories(FileConfiguration
fileConfiguration) {
119           fileConfiguration.getPagingLocation().mkdirs();
120           fileConfiguration.getJournalLocation().mkdirs();
121           fileConfiguration.getBindingsLocation().mkdirs();
>>>     CID 1428148:  FindBugs: Bad practice  (FB.RV_RETURN_VALUE_IGNORED_
BAD_PRACTICE)
>>>     Another occurrence here
122           fileConfiguration.getLargeMessagesLocation().mkdirs();
123        }
124
125        @Override
126        public void stop() throws Exception {
127           stop(false);


____________________________________________________________
____________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.
net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-
2Bd2MGckcRZSbhom32dlDl11LWEm9nX1rtAWaC-2BDSVBpUSy28m9Zb8yC8TsR8PEkb70
GF-2BiZPHs-3D_FskC5xBa3KJMdLzpQ7DMPdi-2Bg7iORJg0iEJDpvzM9wB7RF8hxWs3
bmvVaFgFAQvTuBGT0hrZhYWvUHIQlXAXi0Yw2XQOZsASFaAcWm-
2FLi8xJbNsE9vdgIrBAhe3KnioFEN9XlpBF2wV1Soc4uSGMzMBrezMv5K8vd
bliXxEvK4-2Fyhum-2Bc9-2FJJKbxyddiMo-2F7ZeBM-2B-2BFCXTMjCI1YGt113g-3D-3D

-- 
Jiří Daněk

Reply via email to