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

System.err cannot print ThreadDeath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • None
    • sparc
    • solaris_9

      in the following code, e.printStackTrace() does nothing on Solaris but it works on Windows XP.

      class Death {
      public static void main(String[] args) throws Throwable{
      Thread t = new Thread() {
      public void run() {
                                  try {
                                      while(true);
                                  }catch(ThreadDeath e) {
      e.printStackTrace();
      System.out.println(e);
      throw e;
                                  }finally {
      System.out.println("finally reached");
                                  }
      }
      };
                      t.start();
      Thread.sleep(2000);
      System.out.println("state " + t.getState() + "\tisAlive " + t.isAlive());
      t.stop();
      System.out.println("state " + t.getState() + "\tisAlive " + t.isAlive());
      Thread.sleep(2000);
      System.out.println("2sec later state " + t.getState() + "\tisAlive " + t.isAlive());
      }
      }

      ###@###.### 2005-07-13 04:28:52 GMT

            psoper Pete Soper (Inactive)
            mleisunw Mike Lei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: