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

Crash when empty body of super abstract class invoke after 1500 times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • hotspot
    • None
    • x86
    • windows_2000


      In Java3D we have this call in DirectionalLightRetained
      which extends LightRetained

       public void update(long ctx, int lightSlot, double scale) {
      super.update( ctx, lightSlot, scale) ;
      ...
          }

      where LightRetained is an abstract class with empty body,

        public void update(long ctx, int lightSlot, double scale){}

      It was found that under jdk1.4-rc-b89, when
      DirectionalLightRetained is invoked 1500 times the JVM will
      crash at super.update( ctx, lightSlot, scale) ;
      without any stacktrace.

      There are two workarounds, either
      (1) Avoid invoking the super method when the body is empty
      OR
      (2) Add some content in the LightRetained.update()
          so that it is not empty (e.g. System.out.println)

      I've hack in another Java3D version in the attachment to
      make the above class and method public and contruct
      a test program as follows



      import javax.media.j3d.*;

      public class Test extends Thread {

         Test(){
         }


         public void run() {
             // This force J3D.dll library load
             VirtualUniverse v = new VirtualUniverse();

              DirectionalLightRetained t = new DirectionalLightRetained();
      int i = 0;

      while (true) {
      System.out.println( "" + i);
      t.update(0, 0, i++);
      }
         }

        public static void main(String[] args) {
            (new Test()).start();
          }

      }

      Under win2K (I'm using 2 cpu), the call will crash when i=1500.
      It is probably the hotspot compiler kick it at that time that
      cause the crash.

      To reproduce, please put the attach library and dll under
      your JDK path jre/ext/lib and jre/bin
      and run
      java Test


      Note that this problem did not exists in jdk1.3.1

            dmcox David Cox (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: