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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.3.0
    • hotspot
    • tiger
    • sparc
    • solaris_2.6

        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();
            }
          }

        }

        william.maddox@Eng 2000-01-21

              coleenp Coleen Phillimore
              wmaddoxsunw William Maddox (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: