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

JDK1.1 class initialization protocol bug - *crashes* on Sparc/Solaris

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1 P1
    • None
    • 1.1
    • hotspot
    • None
    • sparc
    • solaris_2.5



      Name: el35337 Date: 01/09/97

      If during the static initialization of a class hierarchy,
                   an active use occurs of a class that is scheduled for
                   initialization, but not initialized (because the active
                   use occurs during its superclass initialization), then
                   the JVM crashes with a segmentation violation

                   This did not happen with 1.0.2, but happens with 1.1beta1
                   and 1.1beta2.

                   Example code:

      ------------------------------
      class statinit0
      {
        static statinit test ;
        static
          { System.out.println ("entering static init for statinit0") ;
            test = new statinit () ;
            System.out.println ("leaving static init for statinit0") ;
          }
      }

      public class statinit extends statinit0
      {
        static int a = 0 ;
        static int b, c ;
        static
          { System.out.println ("entering static init for statinit") ;
            b = 0 ;
            c = 7 ;
            System.out.println ("leaving static init for statinit") ;
          }


        public statinit ()
          { a ++ ;
            b ++ ;
            c ++ ;
            System.out.println ("constructor for statinit, a=" + a + " b=" + b + " c=" + c) ;
          }

        static public void main (String [] args)
          { System.out.println ("entering main") ;
            statinit s = new statinit () ;
            System.out.println ("leaving main") ;
          }
      }
      ------------------------------

                 Output under 1.0.2:

      ------------------------------
      entering static init for statinit0
      entering static init for statinit
      leaving static init for statinit
      constructor for statinit, a=1 b=1 c=8
      leaving static init for statinit0
      entering static init for statinit
      leaving static init for statinit
      entering main
      constructor for statinit, a=2 b=1 c=8
      leaving main
      ------------------------------

                 Output under 1.1

      ------------------------------
      entering static init for statinit0
      entering static init for statinit
      leaving static init for statinit
      constructor for statinit, a=1 b=1 c=8
      leaving static init for statinit0
      SIGSEGV 11* segmentation violation
          si_signo [11]: SIGSEGV 11* segmentation violation
          si_errno [0]: Error 0
          si_code [1]: SEGV_ACCERR [addr: 0x0]

              stackbase=EFFFF184, stackpointer=EFFFED80

      Full thread dump:
          "Finalizer thread" (TID:0xee3002f8, sys_thread_t:0xef570de0, state:R) prio=1
          "Async Garbage Collector" (TID:0xee3002b0, sys_thread_t:0xef670de0, state:R) prio=1
          "Idle thread" (TID:0xee300268, sys_thread_t:0xef770de0, state:R) prio=0
          "clock handler" (TID:0xee300180, sys_thread_t:0xef7b0de0, state:CW) prio=11
          "main" (TID:0xee300150, sys_thread_t:0x614f0, state:R) prio=5 *current thread*
      Monitor Cache Dump:
               java.lang.Class@EE3030E0/EE34C7F0 (key=0xee3030e0): monitor owner 614f0: "main"
      Registered Monitor Dump:
          Finalize me queue lock: unowned
          Thread queue lock: unowned
          Name and type hash table lock: unowned
          String intern lock: unowned
          JNI global reference lock: unowned
          BinClass lock: unowned
          Class loading lock: unowned
          Java stack lock: unowned
          Code rewrite lock: unowned
          Heap lock: unowned
          Has finalization queue lock: unowned
          Monitor IO lock: unowned
          Child death monitor: unowned
          Event monitor: unowned
          I/O monitor: unowned
          Alarm monitor: unowned
         Waiting to be notified:
           "clock handler"
          Sbrk lock: unowned
          Monitor cache expansion lock: unowned
          Monitor registry: monitor owner 614f0: "main"
      Thread Alarm Q:
      Abort
      ------------------------------

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

            nsaraiyasunw Nakul Saraiya (Inactive)
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: