[ 
https://issues.apache.org/jira/browse/FELIX-6318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Baptiste Onofré updated FELIX-6318:
----------------------------------------
    Affects Version/s: framework-6.0.3
                       framework-5.6.12

> Tiny thread-safety bug in BundleWiringImpl
> ------------------------------------------
>
>                 Key: FELIX-6318
>                 URL: https://issues.apache.org/jira/browse/FELIX-6318
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-6.0.3, framework-5.6.12
>            Reporter: Richard Hernandez
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>
> In BundleWiringImple::getClassLoaderInternal, you're using double-checked 
> locking to access the field m_classLoader. However, you're not using it 
> entirely correctly. The current code assigns the volatile field to a local 
> variable, null-checks the volatile field, and returns the local variable if 
> the second read of the volatile field is not null. While highly improbable, 
> it's possible for the first read of the volatile variable to be null and the 
> second read to not be. This would cause `BundleWiringImpl::getClassLoader` to 
> return null.
>  
> See 
> https://github.com/apache/felix-dev/blob/master/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java#L713-L717



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to