muse-dev[bot] commented on a change in pull request #6103:
URL: https://github.com/apache/skywalking/pull/6103#discussion_r550025450



##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/WitnessClassFinder.java
##########
@@ -36,6 +36,17 @@
      * @return true, if the given witnessClass exists, through the given 
classLoader.
      */
     public boolean exist(String witnessClass, ClassLoader classLoader) {
+        return getResolution(witnessClass, classLoader)

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method 
`WitnessClassFinder.exist(...)` indirectly reads without synchronization from 
container `this.poolMap` via call to `Map.get(...)`. Potentially races with 
write in method `WitnessClassFinder.getResolution(...)`.
    Reporting because another access to the same memory occurs on a background 
thread, although this access may not.

##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/plugin/WitnessClassFinder.java
##########
@@ -46,9 +57,9 @@ public boolean exist(String witnessClass, ClassLoader 
classLoader) {
             }
         }
         TypePool typePool = poolMap.get(mappingKey);

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method 
`WitnessClassFinder.getResolution(...)` reads without synchronization from 
container `this.poolMap` via call to `Map.get(...)`. Potentially races with 
write in method `WitnessClassFinder.getResolution(...)`.
    Reporting because this access may occur on a background thread.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to