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

StackOverflowError is not thrown on Windows XP

XMLWordPrintable

    • x86
    • windows_xp

      "StackOverflowError is not thrown" on Windows XP Professional.

      I tried my program ( as given below ) with jdk1.4.0 b86 , jdk1.4.0 b80 & jdk1.3.1 b24 - and it's not throwing stack overflow error .It's just exiting without throwing stackoverflowerror after some iterations.

      Program is throwing StackOverflowError on solaris & other windows.( not tried this on Windows XP Home Edition , since I don't have XP Home Edition )

      But with jdk1.3.0 it's throwing error , I got o/p as below :

      -----------------------------------------------------------------------
      i= :9006
      #
      # An EXCEPTION_STACK_OVERFLOW exception has been detected in native code outside the VM.
      # Program counter=0x77f534f9
      #
      [1] + Done(139) java CatchStackError
        1720 Segmentation violation java
      [C:/sreejith] java -version
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      -----------------------------------------------------------------------

      ---------------------------------testcase------------------------------------
      public class CatchStackError{
        static int recursiveDepth =20000;

        public static void main(String[] args) throws Exception {
         
              CatchStackError cse = new CatchStackError();
              cse.recursive(1);
            
        }
        void recursive(int i) {
          i = i +1;
            
          if (i <recursiveDepth) {
             System.out.println("i= :"+i);
             recursive(i);
          }
                  
              
        }
        
      }
      ------------------------------------------------------------------------------

            jcoomes John Coomes (Inactive)
            saksunw Sreejith Ak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: