activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiri Danek <jda...@redhat.com>
Subject Re: [DISCUSS] Coverity Scan for Artemis
Date Thu, 23 Mar 2017 12:40:07 GMT
---------- Forwarded message ----------
From: <scan-admin@coverity.com>
Date: Fri, Mar 17, 2017 at 10:59 AM
Subject: New Defects reported by Coverity Scan for Apache ActiveMQ Artemis
To: jdanek@redhat.com



Hi,

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

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


** CID 1418581:  Exceptional resource leaks  (RESOURCE_LEAK)
/tests/integration-tests/src/test/java/org/apache/activemq/a
rtemis/tests/integration/client/ConsumerTest.java: 419 in
org.apache.activemq.artemis.tests.integration.client.ConsumerTest.internalSend(int,
int)()


____________________________________________________________
____________________________________________
*** CID 1418581:  Exceptional resource leaks  (RESOURCE_LEAK)
/tests/integration-tests/src/test/java/org/apache/activemq/a
rtemis/tests/integration/client/ConsumerTest.java: 419 in
org.apache.activemq.artemis.tests.integration.client.ConsumerTest.internalSend(int,
int)()
413
414              TextMessage msg = (TextMessage) consumer.receive(1000);
415              Assert.assertEquals("testSelectorExampleFromSpecs:2",
msg.getText());
416
417           } finally {
418              connection.close();
>>>     CID 1418581:  Exceptional resource leaks  (RESOURCE_LEAK)
>>>     Variable "factorySend" going out of scope leaks the resource it
refers to.
419           }
420        }
421
422        @Test
423        public void testConsumerAckImmediateAutoCommitTrue() throws
Exception {
424           ClientSessionFactory sf = createSessionFactory(locator);

** CID 1418580:  Null pointer dereferences  (NULL_RETURNS)
/tests/integration-tests/src/test/java/org/apache/activemq/a
rtemis/tests/integration/client/ConsumerTest.java: 317 in
org.apache.activemq.artemis.tests.integration.client.ConsumerTest.internalSend(int,
int)()


____________________________________________________________
____________________________________________
*** CID 1418580:  Null pointer dereferences  (NULL_RETURNS)
/tests/integration-tests/src/test/java/org/apache/activemq/a
rtemis/tests/integration/client/ConsumerTest.java: 317 in
org.apache.activemq.artemis.tests.integration.client.ConsumerTest.internalSend(int,
int)()
311        public void internalSend(int protocolSender, int
protocolConsumer) throws Throwable {
312
313           ConnectionFactory factorySend = createFactory(protocolSender);
314           ConnectionFactory factoryConsume = protocolConsumer ==
protocolSender ? factorySend : createFactory(protocolConsumer);
315
316
>>>     CID 1418580:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "factorySend".
317           Connection connection = factorySend.createConnection();
318
319           try {
320              Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
321              javax.jms.Queue queue = session.createQueue(QUEUE.toSt
ring());
322              MessageProducer producer = session.createProducer(queue);

** CID 1418579:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/co
re/paging/cursor/PagedReferenceImpl.java: 137 in
org.apache.activemq.artemis.core.paging.cursor.PagedReferenc
eImpl.getScheduledDeliveryTime()()


____________________________________________________________
____________________________________________
*** CID 1418579:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/co
re/paging/cursor/PagedReferenceImpl.java: 137 in
org.apache.activemq.artemis.core.paging.cursor.PagedReferenc
eImpl.getScheduledDeliveryTime()()
131
132        @Override
133        public long getScheduledDeliveryTime() {
134           if (deliveryTime == null) {
135              try {
136                 Message msg = getMessage();
>>>     CID 1418579:  Null pointer dereferences  (NULL_RETURNS)
>>>     Unboxing null object "msg.getScheduledDeliveryTime()".
137                 return msg.getScheduledDeliveryTime();
138              } catch (Throwable e) {
139                 ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e);
140                 return 0L;
141              }
142           }

** CID 1418578:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java:
2373 in org.apache.activemq.artemis.core.server.impl.QueueImpl.moveB
etweenSnFQueues(org.apache.activemq.artemis.api.core.SimpleString,
org.apache.activemq.artemis.core.transaction.Transaction,
org.apache.activemq.artemis.core.server.MessageReference)()


____________________________________________________________
____________________________________________
*** CID 1418578:  Null pointer dereferences  (NULL_RETURNS)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java:
2373 in org.apache.activemq.artemis.core.server.impl.QueueImpl.moveB
etweenSnFQueues(org.apache.activemq.artemis.api.core.SimpleString,
org.apache.activemq.artemis.core.transaction.Transaction,
org.apache.activemq.artemis.core.server.MessageReference)()
2367           Binding targetBinding;
2368
2369           // remove the old route
2370           for (SimpleString propName : copyMessage.getPropertyNames())
{
2371              if (propName.startsWith(Message.HDR_ROUTE_TO_IDS)) {
2372                 oldRouteToIDs = (byte[]) copyMessage.removeProperty(pro
pName.toString());
>>>     CID 1418578:  Null pointer dereferences  (NULL_RETURNS)
>>>     Calling a method on null object "oldRouteToIDs".
2373                 final String hashcodeToString =
oldRouteToIDs.toString(); // don't use Arrays.toString(..) here
2374                 logger.debug("Removed property from message: " +
propName + " = " + hashcodeToString + " (" +
ByteBuffer.wrap(oldRouteToIDs).getLong()
+ ")");
2375
2376                 // there should only be one of these properties so
potentially save some loop iterations
2377                 break;
2378              }


____________________________________________________________
____________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.n
et/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2
MGckcRZSbhom32dlDl11LWEm9nX1rtAWaC-2BDSVBpUSy28m9Zb8yC8TsR8P
Ekb70GF-2BiZPHs-3D_FskC5xBa3KJMdLzpQ7DMPdi-2Bg7iORJg0iEJDpvz
M9wDEBs83dhsMiiHLs6eTC5vNN8SQrPHx5Y-2FunG8Ul9-2FtGelYwdL08hg
4PK4L5N-2FrzHT6HG-2B7H7X8f0pdTqUNCmfC4-2BO8FqmU2U7GA8fkpPkZD
935bABKyBgetbGXKZruAnUZrfa21ulwAIB5-2FFiJfax8q9bLx0-2B99BNXR
eKbArA-2BJg-3D-3D

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message