Hi, new results for Coverity Scan are here.

Before, though, I would like to give honorable mention to thing from
Coverity Scan backlog which was found some time ago and never was in these
e-mails of mine

 82   boolean addSubscription(MqttTopicSubscription subscription,
WildcardConfiguration wildcardConfiguration) {

CID 1419151 (#1 of 1): JLM: Synchronization on java.util.concurrent objects
(FB.JLM_JSR166_UTILCONCURRENT_MONITORENTER)
1. defect: Synchronization performed on java.util.concurrent.Concurren
tHashMap.
 83      synchronized (subscriptions) {
 84         addressMessageMap.putIfAbsent(MQTTUtil.convertMQTTAddressFil
terToCore(subscription.topicName(), wildcardConfiguration), new
ConcurrentHashMap<Long, Integer>());

According to http://www.cs.umd.edu/~pugh/MistakesThatMatter.pdf slides
32,33 this is almost always a bug and it was rather prevalent in JBoss...

Another instance of this

100   void removeSubscription(String address) {

CID 1419085 (#1 of 1): JLM: Synchronization on java.util.concurrent objects
(FB.JLM_JSR166_UTILCONCURRENT_MONITORENTER)1. defect: Synchronization
performed on java.util.concurrent.ConcurrentHashMap.
101      synchronized (subscriptions) {
102         subscriptions.remove(address);
103         addressMessageMap.remove(address);
104      }
105   }


Hi,

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

1 new defect(s) introduced to Apache ActiveMQ Artemis found with Coverity
Scan.


New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1426233:  Program hangs  (LOCK_INVERSION)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java:
399 in org.apache.activemq.artemis.core.replication.ReplicationManager.
flowControl()()

9. lock_order: Acquiring lock PagingStoreImpl.lock while holding
ReplicationManager.replicationLock conflicts with the lock order
established elsewhere. [show details
<https://scan7.coverity.com/eventId=3237539-10&modelId=3237539-0&fileInstanceId=13594886&filePath=%2Fartemis-server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Factivemq%2Fartemis%2Fcore%2Freplication%2FReplicationManager.java&fileStart=281&fileEnd=308>
]

____________________________________________________________
____________________________________________
*** CID 1426233:  Program hangs  (LOCK_INVERSION)
/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java:
399 in org.apache.activemq.artemis.core.replication.ReplicationManager.
flowControl()()
393
394        /**
395         * This was written as a refactoring of sendReplicatePacket.
396         * In case you refactor this in any way, this method must hold a
lock on replication lock. .
397         */
398        private boolean flowControl() {
>>>     CID 1426233:  Program hangs  (LOCK_INVERSION)
>>>     Acquiring lock "ReplicationManager.replicationLock".
399           synchronized (replicationLock) {
400              // synchronized (replicationLock) { -- I'm not adding this
because the caller already has it
401              // future maintainers of this code please be aware that
the intention here is hold the lock on replication lock
402              if (!replicatingChannel.getConnection().isWritable(this)) {
403                 try {
404                    logger.trace("flowControl waiting on writable
replication");

https://scan7.coverity.com/reports.htm#v10043/p14213/
fileInstanceId=13594886&defectInstanceId=3237539&mergedDefectId=1426233

-- 
Jiří Daněk

Reply via email to