Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-7401

JBWEB-216: Fix concurrency issue with sharing InputStreams in JBossWeb

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: EAP_EWP 5.2.0
    • Component/s: Web
    • Labels:
      None
    • Affects:
      Release Notes
    • Patch Instructions:
      Hide
      SHORT DESCRIPTION:
              Provide fix for JBWEB-216.
      LONG DESCRIPTION:
              Patch to fix Apache BZ #48760 -- Fix concurrency issue with sharing InputStreams
      MANUAL INSTALL INSTRUCTIONS:
              Replace the existing %JBOSS_HOME%/server/%JBOSSCONF%/deploy/jbossweb.sar/jbossweb.jar with the new jbossweb.jar
      COMPATIBILITY:
             5.1.2
      SUPERSEDES:
              N/A
      CREATOR:
              Kyle Lape/Mike Millson
      DATE:
              25-October-2011
      Show
      SHORT DESCRIPTION:         Provide fix for JBWEB-216 . LONG DESCRIPTION:         Patch to fix Apache BZ #48760 -- Fix concurrency issue with sharing InputStreams MANUAL INSTALL INSTRUCTIONS:         Replace the existing %JBOSS_HOME%/server/%JBOSSCONF%/deploy/jbossweb.sar/jbossweb.jar with the new jbossweb.jar COMPATIBILITY:        5.1.2 SUPERSEDES:         N/A CREATOR:         Kyle Lape/Mike Millson DATE:         25-October-2011
    • Release Notes Text:
      Hide
      There was a concurrency issue in Tomcat. When the <systemitem>javax.servlet.ServletOutputStream.write</systemitem> method got accessed by multiple threads, it sometimes got called while the previous thread had not yet finished writing of the byte buffer, or when its own buffer had not yet been flushed. This resulted in corrupted output and the following exception was thrown:

      <screen>
      SEVERE: Servlet.service() for servlet default threw exception
      java.io.IOException: Bad file number
      at java.io.FileInputStream.readBytes(Native Method)
      at java.io.FileInputStream.read(FileInputStream.java:199)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
      at java.io.FilterInputStream.read(FilterInputStream.java:90)
      at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:1968)
      at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1714)
      at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:809)
      at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:325)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      </screen>

      This update modifies the underlying source code and ensures that such concurrency is avoided. The <systemitem>javax.servlet.ServletOutputStream.write</systemitem> method can now be accessed by multiple threads without causing the previously mentioned issue.
      Show
      There was a concurrency issue in Tomcat. When the <systemitem>javax.servlet.ServletOutputStream.write</systemitem> method got accessed by multiple threads, it sometimes got called while the previous thread had not yet finished writing of the byte buffer, or when its own buffer had not yet been flushed. This resulted in corrupted output and the following exception was thrown: <screen> SEVERE: Servlet.service() for servlet default threw exception java.io.IOException: Bad file number at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:199) at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) at java.io.FilterInputStream.read(FilterInputStream.java:90) at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:1968) at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:1714) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:809) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:325) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) </screen> This update modifies the underlying source code and ensures that such concurrency is avoided. The <systemitem>javax.servlet.ServletOutputStream.write</systemitem> method can now be accessed by multiple threads without causing the previously mentioned issue.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • Docs QE Status:
      NEW

      Description

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jfclere Jean-Frederic Clere
                  Reporter:
                  klape Kyle Lape
                  Writer:
                  Petr Penicka
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: