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

Double invocation of java.io.CharArrayReader constructor can crash VM

    XMLWordPrintable

Details

    • b04
    • x86
    • linux
    • Verified

    Description



      Name: kaC94536 Date: 11/12/99



      The following test crashes Linux VM:

      ----------------------------- test.java ------------------------
      import java.io.CharArrayReader;

      public class test {
          public static void main(String[] args) {
              char[] chars={};
              CharArrayReader car;
              car = new CharArrayReader(chars);
              chars = null;
              car = new CharArrayReader(chars);
          }
      }
      -------------------------------- output --------------------------

      $ java -fullversion
      java full version "1.2.2-RC1"
      $ java -Djava.compiler=javacomp -cp . test
      Segmentation fault (core dumped)

      ------------------------------------------------------------------

      Being run without JIT VM does everithing well:

      -------------------------------- output --------------------------

      $ java -cp . test
      Warning: JIT compiler "sunwjit" not found. Will use interpreter.
      Exception in thread "main" java.lang.NullPointerException:
              at java.io.CharArrayReader.<init>(CharArrayReader.java:46)
              at test.main(test.java:9)
      $

      ======================================================================

      ======================================================================

      Attachments

        Activity

          People

            caustinsunw Calvin Austin (Inactive)
            kanisimosunw Konstantin Anisimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: