[ 
https://issues.apache.org/jira/browse/POOL-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168489#comment-13168489
 ] 

Samira Tasharofi commented on POOL-193:
---------------------------------------

This bug was detected using [Keshmesh | http://keshmesh.cs.illinois.edu] which 
is a static tool for finding concurrency bug pattern. 
[Keshmesh|http://keshmesh.cs.illinois.edu/] reported the accesses to 
{{org.apache.commons.pool2.impl.GenericObjectPool.evictor}} as instances of a 
generalized form of the 
[VNA00-J|https://www.securecoding.cert.org/confluence/display/java/VNA00-J.+Ensure+visibility+when+accessing+shared+primitive+variables]
 bug pattern. We used 
{{org.apache.commons.pool2.impl.GenericObjectPool.startEvictor(long)}} as entry 
point.
                
> It is safer to make org.apache.commons.pool2.impl.GenericObjectPool.evictor 
> volatile
> ------------------------------------------------------------------------------------
>
>                 Key: POOL-193
>                 URL: https://issues.apache.org/jira/browse/POOL-193
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>         Environment: Platform: All
>            Reporter: Samira Tasharofi
>              Labels: concurrency
>             Fix For: 2.0
>
>
> A field of 
> [org.apache.commons.pool2.impl.GenericObjectPool<T>|http://svn.apache.org/repos/asf/!svn/bc/1206499/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java]
>  might need to be synchronized. Field 
> {{org.apache.commons.pool2.impl.GenericObjectPool.evictor}} is read and 
> written in method 
> {{org.apache.commons.pool2.impl.GenericObjectPool.startEvictor(long)}}, which 
> might be called by multiple threads concurrently. Is there a possibility that 
> {{org.apache.commons.pool2.impl.GenericObjectPool.startEvictor(long)}} gets 
> invoked concurrently? Would it be safer to make 
> {{org.apache.commons.pool2.impl.GenericObjectPool.evictor}} {{volatile}}?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to