[jboss-jira] [JBoss JIRA] (JBWEB-311) JspConfig init isn't thread safe and can cause ConcurrentModificationException

Aaron Ogburn (JIRA) issues at jboss.org
Thu Mar 26 17:46:19 EDT 2015


     [ https://issues.jboss.org/browse/JBWEB-311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Ogburn updated JBWEB-311:
-------------------------------
    Attachment:     (was: reproducer.zip)


> JspConfig init isn't thread safe and can cause ConcurrentModificationException
> ------------------------------------------------------------------------------
>
>                 Key: JBWEB-311
>                 URL: https://issues.jboss.org/browse/JBWEB-311
>             Project: JBoss Web
>          Issue Type: Bug
>    Affects Versions: JBossWeb-2.1.13.GA
>            Reporter: Aaron Ogburn
>            Assignee: Aaron Ogburn
>         Attachments: reproducer.zip
>
>
> JspConfig init isn't thread safe and can cause the following ConcurrentModificationException:
> {code}
> java.util.ConcurrentModificationException 
> at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) 
> at java.util.AbstractList$Itr.next(AbstractList.java:343) 
> at org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:303) 
> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:112) 
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:333) 
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313) 
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300) 
> at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585) 
> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312) 
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
> {code}
> Issue occurs like so:
> 1) thread a starts JspConfig.init/proccessWebDotXml
> 2) thread b starts JspConfig.init/proccessWebDotXml
> 3) thread a finishes JspConfig.init/proccessWebDotXml and then calls JspConfig.findJspProperty
> 4) thread b sets the jspProperties vector before thread a gets an iterator of it
> 5) thread b modifies the jspProperties vector, causing the ConcurrentModificationException in thread a



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list