Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4766061

Crimson throws InternalError: fillbuf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.1
    • xml
    • x86
    • linux

      Name: gm110360 Date: 10/21/2002


      FULL PRODUCT VERSION :
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      Linux 2.4.19 #4 SMP Thu Oct 10 10:25:12 PDT 2002 i686
      unknown


      A DESCRIPTION OF THE PROBLEM :
      The crimson XML parser is choking on valid XML. Its a
      problem to do with ]]> characters spanning the 8K parsing
      buffer.

      The following URLs include a test case and patch to resolve
      the problem:
      http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4947
      http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5089

      This wasn't a problem in the pre 1.4.1 release because I
      don't think crimson was included in those releases.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4947

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.InternalError: fillbuf
      at org.apache.crimson.parser.InputEntity.parsedContent
      (InputEntity.java:545)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1826)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)



      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.io.*;
      import javax.xml.parsers.*;

      import org.w3c.dom.*;
      import org.xml.sax.InputSource;

      public class CrimsonTest {

          public static void main(String[] args) {

              try {

                  CharArrayWriter wrt = new CharArrayWriter(10000);
                  // length: 6
                  wrt.write("<test>");
                  for (int i = 0; i < 100; i++) {
                      // length: 81 = 8 + 64 + 9
                      wrt.write("<filler>123456789 123456789 123456789 123456789
      123456789 123456789 1234</filler>");
                  }
                  // position: 8106 = 6 + 100x81
                  // length: 63 = 15 + 32 + 16
                  wrt.write("<anotherFiller>123456789 123456789 123456789
      12</anotherFiller>");
                  // position: 8169 = 8106 + 63
                  // length: 11
                  wrt.write("<failsHere>");
                  // position: 8180 = 8169 + 11
                  wrt.write("here: "]");
                  // 0123456789 12
                  wrt.write("</failsHere></test>");
                  wrt.close();

                  Reader rdr = new CharArrayReader(wrt.toCharArray());
                  DocumentBuilder db = DocumentBuilderFactory.newInstance
      ().newDocumentBuilder();
                  Document doc = db.parse(new InputSource(rdr));

                  System.out.println("All worked");

              } catch (Throwable e) {
                  e.printStackTrace();
              }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      The workaround is to patch the crimson code and use: -
      Xbootclasspath/p:crimson.jar to work around the bug.
      (Review ID: 165899)
      ======================================================================
      ###@###.### 2002-12-27

            gsharmasunw Gopal Sharma (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: