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

invocation of String concat(null) crashes VM

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description



      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>

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

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: