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

(process) test/java/lang/ProcessBuilder/Basic.java failing with "Bad file number" (sol)

XMLWordPrintable

    • b114
    • 7
    • b116
    • generic
    • generic
    • Not verified

      The changes for 6981138 added a new test that closes the process output stream asynchronously, causing any threads reading from that stream to fail with an IOException.

      The test expects the exception message to be "Bad file descriptor" but it should be "Bad file number".

      Here's a sample failure on solaris-sparc:

      $ java Basic
      This appears to be a Unix system.
      Testing ASCII environment values
      Testing directory .
      Testing directory ..
      Testing directory /
      Testing directory /bin
      java.io.IOException: Bad file number
              at java.io.FileInputStream.readBytes(Native Method)
              at java.io.FileInputStream.read(FileInputStream.java:241)
              at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:271)
              at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
              at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
              at Basic$65.run(Basic.java:1844)

      Passed = 9539, failed = 1

      Exception in thread "main" java.lang.AssertionError: Some tests failed
              at Basic.main(Basic.java:2148)

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: