[ 
https://jira.codehaus.org/browse/MNG-5676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=351713#comment-351713
 ] 

BJ Hargrave edited comment on MNG-5676 at 8/22/14 9:46 AM:
-----------------------------------------------------------

Probably. The implementation of loadClass(String,boolean) incorrectly "forgets" 
about class loading locks already returned to callers of getClassLoadingLock. 
So if the code calls getClassLoadingLock and synchronizes on the lock and then 
calls super.loadClass(String,boolean) before findLoadedClass/defineClass, 
another thread that calls getClassLoadingLock after the first thread calls 
super.loadClass(String,boolean) will get a different lock object. So both 
threads can then race to define the class and boom.

Basically, if ClassLoader.loadClass(String,boolean) is called in a critical 
section protected by the lock from ClassLoader.getClassLoadingLock, you are in 
trouble. So the workaround is to override getClassLoadingLock.


was (Author: bjhargrave):
Probably. The implementation of loadClass(String,boolean) incorrectly "forgets" 
about class loading locks already returned to callers of getClassLoadingLock. 
So if the code calls getClassLoadingLock and synchronizes on the lock and then 
calls super.loadClass(String,boolean) before findLoadedClass/defineClass, 
another thread that calls getClassLoadingLock after the first thread calls 
super.loadClass(String,boolean) will get a different lock object. So both 
threads can then race to define the class and boom.

> mvn -U crashes with IBM JDK
> ---------------------------
>
>                 Key: MNG-5676
>                 URL: https://jira.codehaus.org/browse/MNG-5676
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.1.1, 3.2.2
>         Environment: IBM JDK, OpenSuSE enterprise server 11
>            Reporter: Dan Tran
>
> details discussion is at
> http://maven.40175.n5.nabble.com/Upgrade-to-3-1-1-causes-problems-td5776875.html
> work around is replace boot/plexus-classworlds-2.5.x.jar with 
> plexus-classworlds-2.4.1.jar as discussed at the link



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to