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

VM crashes during second division by long zero divisor

XMLWordPrintable

    • x86
    • linux



      Name: kaC94536 Date: 12/21/99


      The following test crashes Linux JDK 1.2.2 VM with JIT enabled. The test tries
      twice to divide one long variable by another long variable that is equal to
      zero. Note that division executes inside void foo. First division raises
      ArithmeticException, but second division crashes VM.
      The test passes under Linux JDK 1.2.2 VM with JIT disabled as well as under
      Solaris JDK 1.2.2 VM.
      Bug affects test misc/jit_tests/t093 from testbase_ss.
      The bug #4296564 with similar test for int zero divisor was fixed.
      ---------------------------- test.java ------------------------------------
      public class test {
        static long i, j;
        static void foo() {
          i /= j;
        }
        public static void main(String argv[]) {
          try {
             foo();
          } catch(ArithmeticException x) {
             System.out.println("Oops!");
          }
          try {
             foo();
          } catch(ArithmeticException x) {
             System.out.println("OK");
          }
        }
      }
      ----------------------------- output --------------------------------------
      [kdos@linux-1]$ java -fullversion
      java full version "1.2.2-RC2-J"
      [kdos@linux-1]$ java -Xfuture -Djava.compiler=NONE test
      Oops!
      OK
      [kdos@linux-1]$ java -Xfuture -Djava.compiler=javacomp test
      Oops!
      SIGFPE 8* arithmetic exception
          si_signo [8]: SIGFPE 8* arithmetic exception
          si_errno [0]: Success
          si_code [0]: SI_USER [pid: 0, uid: 0]
              stackpointer=0xbffff6d4

      Full thread dump Classic VM (1.2.2-RC2-J, green threads):
          "Finalizer" (TID:0x40e95320, sys_thread_t:0x81080f0, state:CW) prio=8
              at java.lang.Object.wait(Native Method)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:112)
              at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
              at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
          "Reference Handler" (TID:0x40e953b0, sys_thread_t:0x81033a0, state:CW)
      prio=10
              at java.lang.Object.wait(Native Method)
              at java.lang.Object.wait(Object.java:424)
              at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
          "Signal dispatcher" (TID:0x40e953e0, sys_thread_t:0x81014e8, state:CW)
      prio=5
          "main" (TID:0x40e951e0, sys_thread_t:0x804c358, state:R) prio=5
              at test.main(test.java:13)
      Monitor Cache Dump:
          java.lang.ref.Reference$Lock@40E953C0/40ECAB20: <unowned>
              Waiting to be notified:
                  "Reference Handler" (0x81033a0)
          java.lang.ref.ReferenceQueue$Lock@40E95338/40ECB028: <unowned>
              Waiting to be notified:
                  "Finalizer" (0x81080f0)
      Registered Monitor Dump:
          Invoker change lock: <unowned>
          utf8 hash table: <unowned>
          JNI pinning lock: <unowned>
          JNI global reference lock: <unowned>
          BinClass lock: <unowned>
          Class linking lock: <unowned>
          System class loader lock: <unowned>
          Code rewrite lock: <unowned>
          Heap lock: <unowned>
          Monitor cache lock: owner "main" (0x804c358) 1 entry
          Dynamic loading lock: <unowned>
          Monitor IO lock: <unowned>
          User signal monitor: <unowned>
              Waiting to be notified:
                  "Signal dispatcher" (0x81014e8)
          Child death monitor: <unowned>
          I/O monitor: <unowned>
          Alarm monitor: <unowned>
              Waiting to be notified:
                  <unknown thread> (0x80577c0)
          Thread queue lock: owner "main" (0x804c358) 1 entry
          Monitor registry: owner "main" (0x804c358) 1 entry

      [kdos@linux-1]$

      ---------------------------------------------------------------------------
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: