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

invocation of String concat(null) crashes VM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • hotspot
    • x86
    • linux



      Name: kaC94536 Date: 11/15/99



      The following test crashes Linux VM, which is run with JIT:

      ----------------------------- test.java ------------------------

      public class test {
         public static void main( String[] argv ) {
            String s1=null;
            String s2=new String("Some string");
            try {
              s2.concat(s1);
            } catch (NullPointerException e) {
               System.out.println("OK.");
            }
         }
      }

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

      linux-2 kdos/test> /public/jdk/jdk1.2.2/linux/bin/java -fullversion
      java full version "1.2.2-RC1"
      linux-2 kdos/test> /public/jdk/jdk1.2.2/linux/bin/java
      -Djava.compiler=javacomp test
      Segmentation fault
      linux-2 kdos/test>

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

      Being run without JIT VM does everything well:

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

      linux-2 kdos/test> /public/jdk/jdk1.2.2/linux/bin/java -Djava.compiler=none
      test
      Warning: JIT compiler "none" not found. Will use interpreter.
      OK.
      linux-2 kdos/test>

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

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

            hongzh Hong Zhang
            kanisimosunw Konstantin Anisimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: