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

Infinite recursion from within finally clause (stack overflow) segfaults VM

XMLWordPrintable

    • Icon: Backport Backport
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 1.4-pool
    • None
    • hotspot

      Compiling and running the following example segfaults the default
      VM in JDK 1.3.0rc1-S. With '-classic', the stack overflow is reported
      properly. The simpler definition, commented out, works OK. Apparently,
      it is important that the recursive call occur within a 'finally' clause.

      public class Fault {
        
        public static void main(String[] args) {
          Fault x = new Fault();
          x.foo();
        }

        /*
        boolean foo() {
          return foo();
        }
        */

        boolean foo() {
          try {
          }
          finally {
            return foo();
          }
        }

      }

            vkulkarnsunw Vaibhav Kulkarni (Inactive)
            tmoscovisunw Tal Moscovitz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: