Uploaded image for project: 'JBoss Web'
  1. JBoss Web
  2. JBWEB-311

JspConfig init isn't thread safe and can cause ConcurrentModificationException

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: JBossWeb-2.1.13.GA
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      See the attached reproducer.zip/jbweb311.sh

      Show
      See the attached reproducer.zip/jbweb311.sh

      Description

      JspConfig init isn't thread safe and can cause the following ConcurrentModificationException:

      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)
      

      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

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                aogburn Aaron Ogburn
                Reporter:
                aogburn Aaron Ogburn
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: