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

Executing too many commands causes interpreter to crash

XMLWordPrintable

    • 1.1
    • sparc
    • generic
    • Not verified

      class Crash {
          public static void main(String[] args) {
              Runtime r = Runtime.getRuntime();
              String cmd = "/bin/true";
              while (true) {
                  try {
                      Process p = r.exec(cmd);
                  } catch (Exception e) {
                      System.err.println("Exception " + e);
                  }
              }
          }
      }

      Consider the above program. When I run it under Solaris with JDK Beta, I get the
      following after a few seconds:

      SIGSEGV 11* segmentation violation
          si_signo [11]: SIGSEGV 11* segmentation violation
          si_errno [0]: Error 0
          si_code [1]: SEGV_ACCERR [addr: 0xa0bc8]
       
              stackbase=EFFFF2FC, stackpointer=EFFFEFE0
       
      Full thread dump:
          "Thread-4" (TID:0xee3005b8, sys_thread_t:0xef460de8) prio=5
          "Finalizer thread" (TID:0xee300358, sys_thread_t:0xef490de8) prio=1
          "Async Garbage Collector" (TID:0xee300308, sys_thread_t:0xef4c0de8) prio=1
          "Idle thread" (TID:0xee300290, sys_thread_t:0xef4f0de8) prio=0
          "clock handler" (TID:0xee300098, sys_thread_t:0xef5b0de8) prio=11
          "main" (TID:0xee300048, sys_thread_t:0x7c9c8) prio=5 *current thread*
              java.lang.UNIXProcess.<init>(UNIXProcess.java:117)
              java.lang.Runtime.exec(Runtime.java)
              Crash.main(crash.java:7)
      Monitor Cache Dump:
      Registered Monitor Dump:
          Finalize me queue lock: unowned
          Thread queue lock: unowned
          Class lock: unowned
          Java stack lock: unowned
          Code rewrite lock: unowned
          Heap lock: unowned
          Has finalization queue lock: unowned
          Monitor IO lock: unowned
          Child death monitor: unowned
          Event monitor: unowned
          I/O monitor: unowned
          Alarm monitor: unowned
              Waiting to be notified:
                  "clock handler"
          Sbrk lock: unowned
          Monitor cache lock: unowned
          Monitor registry: monitor owner: "main"
      Thread Alarm Q:
      Segmentation fault (core dumped)

      DREL 11/27/95

            tlindholsunw Timothy Lindholm (Inactive)
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: