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

(fp.bugs 1919)write to broken pipe loops infinitely instead of throwing exceptio

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.0
    • 1.0
    • hotspot
    • 1.0beta
    • sparc
    • solaris_2.4
    • Not verified

      >From: ###@###.### (Christopher Lindblad)


      Here is a little java program that creates a subprocess, waits for it to exit,
      and then sends some data to it. Instead of an error being signalled when data
      is sent through the broken pipe to the subprocess, the java runtime goes into
      an infinite loop. I also have included a snippet of truss output to prove
      that java is indeed looping.

      public class process1 {
          public static void main(String[] args) {
      /* create a new process */
      Process p = Runtime.getRuntime().exec("/bin/sh -c exit");
      /* wait for it to exit */
      p.waitFor();
      /* now send data to it */
      p.getOutputStream().write(new byte[1024]);
          }
      }


      Error Message:

      Log file:

      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
          Received signal #13, SIGPIPE [ignored]
      ....

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: