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

linux: Recursive invocation of static method can crash JVM

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: hotspot
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description



      Name: iaR10016 Date: 09/14/2000



      JDK version:
      java version "1.3.0rc1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-b17)
      Java HotSpot(TM) Client VM (build 1.3.0rc1-b17, mixed mode)

      The following test example crashes vm with "Segmentation fault" error
      or with error 4F533F4C494E55580E43505005BC in client and server mode
      under Linux JDK 1.3.

      The test always passes in classic mode and under Solaris JDK 1.3.

      -------------------- test.java ----------------------------------

      public class test1 {

          public static int counter = 1;

          static int Runner() {
              System.out.println("Runner: "+counter);
              counter = counter * -1;
              int i = counter;
              if(counter < 2) counter += Runner();
              return i;
           }


          public static void main (String [] args ) {
              System.out.println("OK: " + run());
          }

           public static int run() {
              try{
                  Runner();
              } catch (StackOverflowError e) {
                  return 0;
              } catch (OutOfMemoryError e) {
                  return 0;
              }
              return 2;
          }
      }

      -----------------------------------------------------------------

      Sample output is:

      ...
      $ java test
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      ...
      Runner: -1
      Runner: 1
      Runner: -1
      An irrecoverable stack overflow has occurred.
      #
      # HotSpot Virtual Machine Error, Unexpected Signal 11
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Error ID: 4F533F4C494E55580E43505005BC
      #
      # Problematic Thread: prio=1 tid=0x804e768 nid=0x16a1 runnable
      #
      Abort
      $
      $ java test
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      ...
      Runner: -1
      Runner: 1
      Runner: -1
      Segmentation fault
      $ java -classic test
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      Runner: 1
      Runner: -1
      Runner: 1
      ...
      Runner: -1
      Runner: 1
      Runner: -1
      Runner: 1OK: 0
      ...

      I use Redhat Linux 6.1 and the following computers configurations:

      1.Intel Pentium III 600MHz (2) / 256 Mb / HDD IBM 8.7 Gb UWSCSI /
        CD-ROM drive ATAPI 40X IDE / video S3 Trio32/Trio64 ( Redhat 6.1 )

      2.Intel Pentium III 800MHz / 256Mb / HDD 17 Gb SCSI / video Matrox G200 AGP /
        CD-ROM drive/ Sound on board VIA686a

      3.Cyrix M2 300MHz / 128 Mb / HDD QUANTUM FIREBALL 4.3 Gb IDE /
        CD-ROM drive SAMSUNG SC-140F 40X IDE / video Alliance Promotion AT25

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duke J. Duke (Inactive)
              Reporter:
              irasunw Ira Ira (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: