Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent data access violations (GUARDED_BY_VIOLATION) #342

Open
jewzaam opened this issue Apr 28, 2016 · 0 comments
Open

Concurrent data access violations (GUARDED_BY_VIOLATION) #342

jewzaam opened this issue Apr 28, 2016 · 0 comments
Labels

Comments

@jewzaam
Copy link
Member

jewzaam commented Apr 28, 2016

Reported by coverity (https://scan.coverity.com/projects/lightblue-platform-lightblue?tab=overview)

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


*** CID 99714: Concurrent data access violations (GUARDED_BY_VIOLATION)
/lightblue-migrator/migrator/src/main/java/com/redhat/lightblue/migrator/ThreadMonitor.java: 216 in com.redhat.lightblue.migrator.ThreadMonitor.runNow()()

210         private boolean runNow=false;
211
212         public void runNow() {
213             synchronized(waiter) {
214                 waiter.notifyAll();
215             }
 CID 99714:  Concurrent data access violations  (GUARDED_BY_VIOLATION)
Accessing "runNow" without holding lock "ThreadMonitor.waiter". Elsewhere, "com.redhat.lightblue.migrator.ThreadMonitor.runNow" is accessed with "ThreadMonitor.waiter" held 2 out of 3 times.
216             runNow=true;
217         }
218
219         @Override
220         public void run() {
221             LOGGER.debug("Starting with thread timeout:{}",threadTimeout);

*** CID 99713: Concurrent data access violations (GUARDED_BY_VIOLATION)
/lightblue-migrator/migrator/src/main/java/com/redhat/lightblue/migrator/ThreadMonitor.java: 156 in com.redhat.lightblue.migrator.ThreadMonitor.getStatus(com.redhat.lightblue.migrator.MonitoredThread)()

150             for(MonitoredThread t:dead) {
151                 threads.remove(t);
152             }
153         }
154
155         public Status getStatus(MonitoredThread t) {
 CID 99713:  Concurrent data access violations  (GUARDED_BY_VIOLATION)
 Accessing "threadMap" without holding lock "ThreadMonitor.this". Elsewhere, "com.redhat.lightblue.migrator.ThreadMonitor.threadMap" is accessed with "ThreadMonitor.this" held 5 out of 7 times.
156             ThreadStatus s=threadMap.get(t);
157             if(s!=null)
158                 return s.status;
159             else
160                 return null;
161         }
@jewzaam jewzaam added the ready label Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant